Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set JULIA_PROJECT when running the subprocess in ensurecompiled() #995

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DilumAluthge
Copy link
Member

@DilumAluthge DilumAluthge commented Oct 29, 2024

Suppose that you have two different projects, where one project contains the packages that will go into the sysimage, and the other project is a "build project".

As an example, consider the examples/MyLib folder in this repo:

  • The examples/MyLib/Project.toml is the "main project" that contains the packages that will go into the sysimage.
  • The examples/MyLib/build/Project.toml is the "build project". The packages in the "build project" will not go into the sysimage. In this example, the "build project" contains Libdl and PackageCompiler, but neither of those will go into the sysimage.

When the ensurecompiled() function is run, we want to make sure that it precompiles the "main project", not the "build project". That's what this PR does.

@DilumAluthge DilumAluthge changed the title WIP: Set JULIA_PROJECT when running the subprocess in `ensurecompiled() WIP: Set JULIA_PROJECT when running the subprocess in ensurecompiled() Oct 29, 2024
@DilumAluthge DilumAluthge changed the title WIP: Set JULIA_PROJECT when running the subprocess in ensurecompiled() Set JULIA_PROJECT when running the subprocess in ensurecompiled() Oct 29, 2024
@DilumAluthge DilumAluthge marked this pull request as ready for review October 29, 2024 22:36
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.58%. Comparing base (221968a) to head (b38c01c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #995      +/-   ##
==========================================
+ Coverage   84.56%   84.58%   +0.01%     
==========================================
  Files           3        3              
  Lines         823      824       +1     
==========================================
+ Hits          696      697       +1     
  Misses        127      127              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristofferC
Copy link
Member

I would have think this is already the case from the existing code? Do you have something like an MWE where it isn't?

julia> Base.active_project()
"/home/kc/JuliaPkgs/PackageCompiler.jl/examples/MyLib/build/Project.toml"

julia> project = ".."
".."

julia> run(addenv(`$(Base.julia_cmd()) -e '@show Base.load_path()'`, "JULIA_LOAD_PATH" => "$project:@stdlib"));
Base.load_path() = ["/home/kc/JuliaPkgs/PackageCompiler.jl/examples/MyLib/Project.toml", "/home/kc/.julia/juliaup/julia-1.10.6+0.x64.linux.gnu/share/julia/stdlib/v1.10"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants