Skip to content

Conversation

giordano
Copy link
Contributor

This is my initial attempt to address #1259, but there are still things I don't understand, so opening as draft.

CC: @vchuravy.

compression: gz
dir: julia-{name}
check_exe: bin/julia --version
julia_exe: bin/julia
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I define custom fields in this yaml file? I did it for convenience, to avoid repeating some things, but if it doesn't work I'll change this;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can; and that's the intention to let you cascading-ly refer to things later on as you do.

url: https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz
strip_components: 1
create_untar_dir: true
depot: {destination}/depot
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no clue what path destination is, I saw it in

- ./configure --prefix={destination}/{dir}
but I don't know if {destination}/depot is something like /opt/compiler-explorer/julia-{name} or what.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to quote some of these things to make them valid yaml

depot: {destination}/depot
cejl_revision: 532185e32ed03d340e16922c1da330c973047570
after_stage_script:
- JULIA_DEPOT_PATH={depot} {julia_exe} -e 'using Pkg; Pkg.add(; url="https://github.com/giordano/CompilerExplorer.jl", rev="{ce_revision}"); Pkg.precompile()'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is bin/julia (== {julia_exe}) a sensible way to call the julia executable after it has been installed? I followed the check_exe example.

depot: {destination}/depot
cejl_revision: 532185e32ed03d340e16922c1da330c973047570
after_stage_script:
- JULIA_DEPOT_PATH={depot} {julia_exe} -e 'using Pkg; Pkg.add(; url="https://github.com/giordano/CompilerExplorer.jl", rev="{ce_revision}"); Pkg.precompile()'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- JULIA_DEPOT_PATH={depot} {julia_exe} -e 'using Pkg; Pkg.add(; url="https://github.com/giordano/CompilerExplorer.jl", rev="{ce_revision}"); Pkg.precompile()'
- JULIA_DEPOT_PATH={depot}: {julia_exe} -e 'using Pkg; Pkg.add(; url="https://github.com/giordano/CompilerExplorer.jl", rev="{ce_revision}"); Pkg.precompile()'

Any reason for using {depot} instead of {destination}/local/share/julia?

We likely also need a project + manifest in the LOAD_PATH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning adding the package to the global environment, so that we don't have to deal with adding a Project.toml/Manifest.toml here (the latter file being problematic, since it's different for each julia version). But I'm open to better solutions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you use the local depot https://docs.julialang.org/en/v1/base/constants/#Base.DEPOT_PATH

Then we don't need to modify the depot path later one.

I don't think we want to use the default project since the user might try to modify it and this is read-only (might also be fine).

You need : after the path so that we still have the system depot available for the stdlib

@giordano
Copy link
Contributor Author

giordano commented Mar 30, 2024

In order to set JULIA_DEPOT_PATH=/path/to/depot, in https://github.com/compiler-explorer/compiler-explorer/blob/042e2b1c02416ac7039d050bbccba726e1e7ddaf/lib/compilers/julia.ts we need to override getDefaultExecOptions to add JULIA_DEPOT_PATH=... to the environment, right?

@partouf
Copy link
Member

partouf commented Mar 31, 2024

In order to set JULIA_DEPOT_PATH=/path/to/depot, in https://github.com/compiler-explorer/compiler-explorer/blob/042e2b1c02416ac7039d050bbccba726e1e7ddaf/lib/compilers/julia.ts we need to override getDefaultExecOptions to add JULIA_DEPOT_PATH=... to the environment, right?

correct

@mattgodbolt
Copy link
Member

Hi @giordano any desire to complete this PR, or shall I close it? Thanks!

@giordano
Copy link
Contributor Author

giordano commented Oct 6, 2025

I'd like to finish the PR, but I need to understand better how caching works in your infrastructure.

As it is now, the Julia driver script is self-sufficient and doesn't need anything extra, which is nice and simple. However turning it into a proper package would let us (a) cache native code to speed up the workload a little bit, and (b) more easily test the entire workflow.

The point with the package approach is that we want to install the package, have it precompiled, and the cached file(s) be automatically reused every time. Is that doable? Where we should do this installation? In Julia there's the concept of a depot where this code is looked for, but its location can be controlled by setting an environment variable (which is what I was trying to do above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants