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

use the correct path to include Compiler.jl in release builds #56601

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

KristofferC
Copy link
Member

#56409 broke PackageCompiler (or other use cases where you want to compile a new core compiler from a release build) since it hardcoded the relative path ../usr/ from Base to the shared directory but this is not true in releases where it is at ...

The workaround here is ugly but I couldn't come up with anything better to compute that relative path based only on BUILDROOT. Maybe it can work as a nerd snipe for someone to improve it.

base/Base_compiler.jl Outdated Show resolved Hide resolved
@@ -288,7 +293,11 @@ process_sysimg_args!()

function isready end

include(strcat(BUILDROOT, "../usr/share/julia/Compiler/src/Compiler.jl"))
if file_exists(strcat(BUILDROOT, "../usr/share/julia/Compiler/src/Compiler.jl"))
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why the usr/share, resp share portion of this can't be folded into the definition of BUILDROOT. We're fully in control of that path both in the Makefile and in PackageCompiler. That seems like the right place for this complexity.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to make a "local" fix.

I don't think it can be folded into BUILDROOT because you then hit the same thing where you don't know the path to base based on BUILDROOT.

I think this shouldn't use BUILDROOT at all but instead the "datadir":

julia/Make.inc

Line 322 in 4ed8814

build_datarootdir := $(build_prefix)/share

which could be passed in as an additional argument?

Copy link
Member

Choose a reason for hiding this comment

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

Well, there's two options I think. One is to DATAROOTDIR that instead of BUILDROOT, since currently, I believe we always link DATAROOTDIR/julia/base to BUILDROOT/base, so that was what I meant above. However, on second thought, I'm not convinced that that's right at all. Various downstream packages expect the full base sources to be available in usr/share, which I imagine is broken right now for an out of tree build. That's out of the scope of this PR, but if you want to use two arguments to be robust for potential rearrangement there, I think that's fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

With the latest commit I can build a sysimage on both a release and source with JuliaLang/PackageCompiler.jl#1002

@IanButterworth
Copy link
Member

This will also need updating, or better yet making more robust to these kind of changes

const COMPILER_DIR = "././../usr/share/julia/Compiler/"

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