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

Mk wrapper fixes #19328

Merged
merged 2 commits into from
Feb 5, 2017
Merged

Mk wrapper fixes #19328

merged 2 commits into from
Feb 5, 2017

Conversation

Profpatsch
Copy link
Member

@Profpatsch Profpatsch commented Oct 7, 2016

Motivation for this change

fixes #2537

  • checked rendering of documentation

Two commits that are bundled because they both change make-wrapper.nix and force a mass-rebuild.

First one adds documentation to makeWrapper (also manual).
Second one makes extraFlagsArray local as discussed in #2537.

@mention-bot
Copy link

@Profpatsch, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @ttuegel and @fpletz to be potential reviewers.

doc/stdenv.xml Outdated
@@ -1200,7 +1228,7 @@ echo @foo@

<programlisting>
#! /nix/store/bmwp0q28cf21...-bash-3.2-p39/bin/sh
PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin
//PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin
Copy link
Member

Choose a reason for hiding this comment

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

What does the // do or change here?

@fpletz fpletz changed the base branch from master to staging October 8, 2016 05:42
@fpletz fpletz changed the base branch from staging to master October 8, 2016 05:43
@fpletz
Copy link
Member

fpletz commented Oct 8, 2016

This should be merged to staging together with your other mass rebuild changes.

@@ -1,8 +1,28 @@
# construct an executable file that wraps the actual executable
Copy link
Member

@FRidh FRidh Oct 8, 2016

Choose a reason for hiding this comment

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

shouldn't documentation like this be kept outside of the scripts to prevent a mass-rebuild? See #16173

Copy link
Member Author

Choose a reason for hiding this comment

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

You can bundle changes like this up with other mass rebuilds and you can change the documentation when something in the implementation changes (like it does here)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you can. But why would you? If you keep it out, it is also much easier to include it in other documentation, like the manual.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because documentation should always be as close a possible to the actual source code. Especially symbol-level documentation.
It won’t be changed until the next time this function is modified, and this is going to trigger a MR anyway.

So the documentation in this PR should be reviewed thoroughly and then no mass rebuilds will be necessary (also multiple mass rebuilds can be bundled together).

Copy link
Member Author

Choose a reason for hiding this comment

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

@vcunat @fpletz @FRidh I’d like to merge this, but first this issue should be resolved. What are your thoughts?

Add function documentation to `makeWrapper`.
Also add user documentation to the nixpkgs manual.
extraFlagsArray should not be exposed outside of `makeWrapper`, it
should only be possible to set it inside a script supplied via the
`--run` argument.
@Profpatsch
Copy link
Member Author

Any further comments on this? Otherwise I think we can merge it into staging?

@vcunat vcunat self-assigned this Feb 5, 2017
@vcunat vcunat changed the base branch from master to staging February 5, 2017 13:18
@vcunat vcunat merged commit 5ae1857 into NixOS:staging Feb 5, 2017
vcunat added a commit that referenced this pull request Feb 5, 2017
@vcunat
Copy link
Member

vcunat commented Feb 5, 2017

Thanks! I'm sorry such MRs take so long to merge. I have missed the mention unfortunately. (There are too many many sometimes.)

chkno added a commit to chkno/nixpkgs that referenced this pull request Sep 25, 2019
There is a bug in this feature: It allows extra arguments to leak in
from the environment. For example:

  $ export extraFlagsArray=date
  $ man ls

Note that you get the man page for date rather than for ls. This happens
because 'man' happens to use a wrapper (to add groff to its PATH).

An attempt to fix this was made in 5ae1857 in PR NixOS#19328 for
issue NixOS#2537, but 1. That change didn't actually fix the problem because
it addressed makeWrapper's environment during the build process, not the
constructed wrapper script's environment after installation, and 2. That
change was apparently accidentally lost when merged with 7ff6eec.

Rather than trying to fix the bug again, we remove the extraFlagsArray
feature, since it has never been used in the public repo in the ten
years it has been available.

wrapAclocal continues to use its own, separate flavor of extraFlagsArray
in a more limited context. The analogous bug there was fixed in
4d7d10d in 2011.
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Oct 22, 2019
There is a bug in this feature: It allows extra arguments to leak in
from the environment. For example:

  $ export extraFlagsArray=date
  $ man ls

Note that you get the man page for date rather than for ls. This happens
because 'man' happens to use a wrapper (to add groff to its PATH).

An attempt to fix this was made in 5ae1857 in PR NixOS#19328 for
issue NixOS#2537, but 1. That change didn't actually fix the problem because
it addressed makeWrapper's environment during the build process, not the
constructed wrapper script's environment after installation, and 2. That
change was apparently accidentally lost when merged with 7ff6eec.

Rather than trying to fix the bug again, we remove the extraFlagsArray
feature, since it has never been used in the public repo in the ten
years it has been available.

wrapAclocal continues to use its own, separate flavor of extraFlagsArray
in a more limited context. The analogous bug there was fixed in
4d7d10d in 2011.

(cherry picked from commit a45b3ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants