-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
makeWrapper: accept --argv0
flag
#9562
Conversation
/cc @domenkozar |
+1 from me |
I think that by default we might want to keep |
That's right; the current default is for the wrapper to pass argv[0] through, and this patch doesn't do anything to change that. The problem is that when you wrap Firefox, the wrapper must set |
Well, by "unchanged" (during wrapping) I meant what firefox needs – i.e. if you wrap a symlink, you will still get the original |
I'm still not sure we're on the same page here. In a call
So, I'm not sure what your position is on this feature. |
To be short, I agree with merging, but my strongest point was addressed by c234f37 already. I mistakenly thought that firefox problem is about matching basename and not the dirname, as I hadn't read all this properly. I'm sorry for the confusion. |
The main problem in all this is IMHO that the content/meaning of |
done | ||
|
||
# Note: extraFlagsArray is an array containing additional flags | ||
# that may be set by --run actions. | ||
echo exec -a '"$0"' "$original" $flagsBefore '"${extraFlagsArray[@]}"' '"$@"' >> $wrapper | ||
echo exec ${argv0:+-a} $argv0 "$original" \ |
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 understand the $argv0
conditional here. If argv0 is empty, it will exec "" $original
, right? Shouldn't -a
be there always?
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.
No, in fact, that second $argv
should probably be in the conditional. However, another issue was brought to my attention, which I will address in the comments.
As @vcunat said, the semantics of I said something above that I realize now is not quite right. If we call
then the To better address the most common uses of
I think these options are what most people will want when they call Comments? Objections? |
Yes, this new proposal certainly seems the best option so far :-) |
By default `makeWrapper` will not set argv[0] (this is a reversion to the old default behavior). Based on the breakage we have seen from changing the default, this is what most people want. The `wrapProgram` function will send `--argv0 '"$0"'` to `makeWrapper`, i.e. it will continue to pass-through the argv[0] that the wrapper is called with.
Not strictly necessary, but Firefox must be called with exactly this argv[0] every time, so there is no reason to admit any other option.
I changed my mind about Firefox: it doesn't need to be patched now, but we know it needs to be called with a specific argv[0], so there's no reason to allow any pass-through. |
BTW, gtk3-enabled firefox won't start for me on current 15.09 with |
@@ -99,6 +99,7 @@ stdenv.mkDerivation rec { | |||
'' + lib.optionalString enableGTK3 | |||
'' | |||
wrapProgram "$out/bin/firefox" \ | |||
--argv0 "$out/bin/firefox" \ # argv[0] must point to firefox itself |
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.
The comment ruins the backslash ;-)
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.
And even when I fix it, this wrapper doesn't work for me. It seems like the .firefox-wrapped
basename is important, after all.
By default `makeWrapper` will not set argv[0] (this is a reversion to the old default behavior). Based on the breakage we have seen from changing the default, this is what most people want. The `wrapProgram` function will send `--argv0 '"$0"'` to `makeWrapper`, i.e. it will continue to pass-through the argv[0] that the wrapper is called with.
I pushed the general |
Also add a simple test detecting such problems.
@vcunat If that commit fixes Firefox, shall we push it to stable with the |
By default `makeWrapper` will not set argv[0] (this is a reversion to the old default behavior). Based on the breakage we have seen from changing the default, this is what most people want. The `wrapProgram` function will send `--argv0 '"$0"'` to `makeWrapper`, i.e. it will continue to pass-through the argv[0] that the wrapper is called with. (cherry picked from commit 61cad61)
Also add a simple test detecting such problems. (cherry picked from commit f65b692)
Pushed. I was waiting for more mass-rebuild changes to push together to 15.09. |
By default `makeWrapper` will not set argv[0] (this is a reversion to the old default behavior). Based on the breakage we have seen from changing the default, this is what most people want. The `wrapProgram` function will send `--argv0 '"$0"'` to `makeWrapper`, i.e. it will continue to pass-through the argv[0] that the wrapper is called with. (cherry picked from commit 61cad61)
Also add a simple test detecting such problems. (cherry picked from commit f65b692)
This flag allows setting the argv[0] parameter given to the wrapped executable, in case the new argv[0] passthrough functionality is not desired. The argv[0] parameter can be given explicitly, or the old behavior can be recovered by passing an empty argv[0], i.e.
makeWrapper --argv0 "" ...
.This would rebuild 7514 packages.
We need this for a proper fix for a Conkeror bug. There is a workaround which I will apply if this patch is rejected from the
release-15.09
branch. If accepted, I would also merge this into master.