Skip to content

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

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

Merged
merged 3 commits into from
Nov 20, 2024

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.

@KristofferC KristofferC requested a review from Keno November 19, 2024 08:56
@@ -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/"

@KristofferC KristofferC merged commit 0592b54 into master Nov 20, 2024
7 checks passed
@KristofferC KristofferC deleted the kc/compiler_path branch November 20, 2024 16:47
@IanButterworth
Copy link
Member

Indeed this broke #56515

It's not great to ignore a review comment and leave no explanation for doing so.

Screenshot 2024-11-20 at 12 53 20 PM

@KristofferC
Copy link
Member Author

KristofferC commented Nov 20, 2024

I had no idea this would break that... I don't see why since it is included from the same path. I also thought it was already broken in non source builds (where there is no usr in the path so the matching would have failed).

Your comment didn't feel like a review comment about the content of the PR, it felt like a future work note.

Better to use the actual github review system with a "request changes" note if you mean that, to make things clear.

Also, just saying, a regression test in #56515 would presumably have caught this.

@IanButterworth
Copy link
Member

Sorry, I should've been clearer.

serenity4 pushed a commit to serenity4/julia that referenced this pull request May 1, 2025
…ang#56601)

JuliaLang#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 `..`.
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