-
-
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
Add LIBEXECDIR relative folder constant #33777
Conversation
Maybe @vtjnash can also review. If agreeable with all reviewers this needs a backport to the RC. |
I'll also add a basic 7z check test if I receive further approval on this. |
Why not assign an absolute path (like Sys.BINDIR * "../libexecdir") as it is done for Sys.STDLIB? Even though there might be other cases, I think it will be more useful since there is no situation I can think of where one wants the relative path. In other words, if you already propose usage like On the other hand, after reading into the new Artifacts-system I became uncertain whether making this a public API is wanted as it could end in file/version conflicts in that directory if not properly managed. What do you think about it? |
The reason why they're not absolute values is because we want Julia itself to be relocatable; if you compile Julia in one location, then move the executable (like when you download it off of the internet) that absolute path is no longer valid. We actually do a surprising amount of work in the C runtime to special-case We could, of course, export something like |
That's the exact reason, why I suggested:
I really meant to assign that line into Sys.LIBEXECDIR (Though I guess the first run inlines that, thus inlining and resolving as constant would need to be delayed, or is that the actual problem?). Then it is built relative from bindir but always usable as an absolute path. Best from both worlds in my opinion. EDIT: Would
Is there any way to somehow fill a variable on every new run? (Preventing @pure inlining and constant propagation?) That'd be the way how to fill such a variable. Somewhat like a static const in Java which would be filled upon loading of the class. Well, at the end it might be the best to just screw that and only make accessing those execs via artifacts part of the public api. I guess that would be the best solution anyway. |
FWIW
are already relative so might make sense to keep things consistent. |
So the consistency between BINDIR and the relative ones comes from the different module location I guess. whatever DIR is found in Base is to be assumed relative. For Sys it is assumed to be absolute? |
OK test failures are unrelated ( LoadError: LoadError: "hard kill repl test" |
It is certainly possible to add a runtime global const that gives you |
However after discussion, adding a runtime global const that gives the absolute path isn't the best course to take. There are plans to replace the whole 7z machinery et. al with equivalents in pure Julia , which will avoid their need completely. As that is the case @staticfloat and I agree that this is a good solution until then, since we should opt for consistency. |
Should we merge this and add it to 1.3 Yeah I was initially very pro LIBEXECDIR but given the larger plans it's a bit annoying to introduce it then potentially remove it in a future release. However, I suppose it's not so bad since it's guaranteed to only hold 7z and the name of the folder is a variable so it can change (even if an exotic configuration) and thus it's safer to introduce it for robustness. |
How about labeling it as 1.4 only in the docs and adding a description/link to the upcoming system? |
This is more relevant to address in 1.3, since the libexec changes happened in this release. |
Ah, well, of course my question should be rephrased: How about specifying
that the constant will be available only until version 1.x where it will be
replaced with a new, better system?
Am 12. November 2019 16:42:31 schrieb "Mustafa M." <notifications@github.com>:
… This is more relevant to address in 1.3, since the libexec changes happened
in this release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I don't think we need to remove this in a future release. We also provide |
@staticfloat if you approve can you merge this or are you waiting on someone else to also review?
Sure, but at the same time I think it will be empty on windows after removing 7z since it's the only exe that lives in the folder on Windows. (Not arguing against, just thought I should mention this) |
|
Those are where my question was pointing to, whether the usage by packages
will soon be discouraged in favour of the new artifacts system?
Am 12. November 2019 18:28:34 schrieb Milan Bouchet-Valat
<notifications@github.com>:
… I don't think we need to remove this in a future release. We also provide
LIBDIR, which isn't going to be removed, and the cost of an additional
variable is quite low.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@KristofferC Do you think this can be backported to 1.3? Since the 7z change has been introduced in that release, it would be cool to provide the solution to access it too. |
@staticfloat, please squash PRs like this. |
It's on the backport branch now. |
Thanks @KristofferC ! |
BTW since this and the other constants defined in the same file are private, this doesn't need a news item right? (In all the other constants are undocumented) |
cc @staticfloat is this how we want the API ?
Base.LIBEXECDIR return
..\\libexecdir
and users will need to doThis mirrors how some of the other constants are computed.