-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix 7z and zlib problems #33493
Fix 7z and zlib problems #33493
Conversation
Glad to have the fix. Can you explain the purpose of the newly introduced |
If we were to, for instance, ship |
I don't know if the cleanup of 7z into libexec is worth the slightly breaking change. I see 7z and possibly curl an exception needed in order to to bootstrap Pkg before the artifact machinery is ready to serve. Do you expect anything else to go into libexec? I'd expect that any other executable should be invoked using the artifact framework. |
@phlavenk I think the advantage of this approach is that it prevents polluting your environment with unnecessary executables and shared libraries. This can especially be an issue if you add Julia's |
I think it is worth it; we need to be good neighbors to not accidentally override other program's
Precisely; we are of the same mind about this. |
Thank you both for explanation, libexec is definitely the right way of dealing with dependencies. |
We should really provide |
@@ -294,7 +299,7 @@ endif | |||
else | |||
|
|||
# Install `7z` into libexec/ | |||
$(INSTALL_M) $(build_bindir)/7z $(DESTDIR)$(libexecdir)/ | |||
$(INSTALL_M) $(build_bindir)/7z$(EXE) $(DESTDIR)$(libexecdir)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, when USE_SYSTEM_P7ZIP=1
, this should probably create a symlink to the system's executable, just like we do for libraries? Otherwise we can't recommend users to look for 7z in libexecdir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't know where 7z
will be on the host system; there is no single install location that is standard. Packages that want to support non-default installations of Julia should probably push Sys.LIBEXECDIR
(I like that suggestion, feel free to open a PR and I'll review it) onto the front of ENV["PATH"]
, then use Sys.which()
to search for 7z
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't pushing libexecdir in front of of PATH
go against the idea that this folder shouldn't interfere with other users? Callers could just try $(Sys.LIBEXECDIR)/7z
, and use Sys.which
only if that fails.
TBH that's really not a priority for me right now (I just came across this on Slack).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mean push it system-wide or even Julia-process-wide; I mean something like:
7z_path = withenv("PATH" => string(Sys.LIBEXECDIR, Sys.iswindows() ? ";" : ":", ENV["PATH"]) do
Sys.which(`7z`)
end
Now that this is merged, before packages will change to yet another hardcoded path, might the suggestion |
I would be happy to review a |
ref #33777 Where I don't do exactly |
@staticfloat do you recall which commit actually moved 7z to the libexec folder (and created that folder)? Is it this PR or an earlier one? |
EDIT NVM I think I found it. |
The
7z
executable wasn't getting copied in for Windows because it lacked$(EXE)
. Additionally, there was some confusion within the buildsystem as far as whether things were namedzlib
orlibz
. This is fixed now, and although it doesn't cause confusion to any of the systems we test on, other packages were hitting issues, as reported in #33470 (comment)It is also reported that packages such as
GR.jl
call explicitly$(Sys.BINDIR)/7z.exe
; I do not think we should continue to support this, it's really bad behavior for us to put things into$(Sys.BINDIR)
in general; that's why I moved things tolibexec
, so we should encourage packages to just do aVERSION
check and look injoinpath(Sys.BINDIR, "..", "libexec")
instead.