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

Fix help2man.postInstall syntax error under cygwin. #49836

Merged
merged 1 commit into from Nov 15, 2018

Conversation

jbgi
Copy link
Contributor

@jbgi jbgi commented Nov 6, 2018

Motivation for this change

currently fails with

error: syntax error, unexpected '+', at /nix/store/20dlh2idhmcfrcd5b45w75jhi9wjszyp-nixpkgs-ce68b2/pkgs/development/tools/misc/help2man/default.nix:27:32

if isCygwin is true.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

Thanks for catching this! But I think there is a way we can fix it without a mass rebuild.

@@ -23,8 +23,9 @@ stdenv.mkDerivation rec {
cat > $out/bin/help2man <<EOF
#! $SHELL -e
export PERL5LIB=\''${PERL5LIB:+:}$gettext_perl
${stdenv.lib.optionalString stdenv.hostPlatform.isCygwin
"export PATH=\''${PATH:+:}${gettext}/bin"}
Copy link
Member

Choose a reason for hiding this comment

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

The core issue is that Nix doesn't know how to handle \'' inside of ordinary double quotes. To avoid a mass rebuild, you should be able to just switch this to double quotes:

''export PATH=\''${PATH:+:}${gettext}/bin''

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed! thanks.

@Mic92
Copy link
Member

Mic92 commented Nov 15, 2018

@GrahamcOfBorg build help2man

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: help2man

Partial log (click to expand)

these paths will be fetched (0.14 MiB download, 0.50 MiB unpacked):
  /nix/store/47hsl6skn083xnax4kjz9da2976xz27j-perl5.28.0-gettext-1.07
  /nix/store/h6wipi070dpkajavw7w5xa7bi9y83zq6-help2man-1.47.7
copying path '/nix/store/47hsl6skn083xnax4kjz9da2976xz27j-perl5.28.0-gettext-1.07' from 'https://cache.nixos.org'...
copying path '/nix/store/h6wipi070dpkajavw7w5xa7bi9y83zq6-help2man-1.47.7' from 'https://cache.nixos.org'...
/nix/store/h6wipi070dpkajavw7w5xa7bi9y83zq6-help2man-1.47.7

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: help2man

Partial log (click to expand)

these paths will be fetched (0.14 MiB download, 0.50 MiB unpacked):
  /nix/store/2lyf9zca1yyi8g3w9a9xsw48lvc50rh7-help2man-1.47.7
  /nix/store/qp9y16pj7xgxxf7amf251k0n7b131s9n-perl5.28.0-gettext-1.07
copying path '/nix/store/qp9y16pj7xgxxf7amf251k0n7b131s9n-perl5.28.0-gettext-1.07' from 'https://cache.nixos.org'...
copying path '/nix/store/2lyf9zca1yyi8g3w9a9xsw48lvc50rh7-help2man-1.47.7' from 'https://cache.nixos.org'...
/nix/store/2lyf9zca1yyi8g3w9a9xsw48lvc50rh7-help2man-1.47.7

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: help2man

Partial log (click to expand)

these paths will be fetched (0.13 MiB download, 0.49 MiB unpacked):
  /nix/store/hj9lgyvkg1lcijxzkp0fd9grjhak4072-perl5.28.0-gettext-1.07
  /nix/store/y9w4g4i8j8zzk953gzf3arn564vy04ph-help2man-1.47.7
copying path '/nix/store/hj9lgyvkg1lcijxzkp0fd9grjhak4072-perl5.28.0-gettext-1.07' from 'https://cache.nixos.org'...
copying path '/nix/store/y9w4g4i8j8zzk953gzf3arn564vy04ph-help2man-1.47.7' from 'https://cache.nixos.org'...
/nix/store/y9w4g4i8j8zzk953gzf3arn564vy04ph-help2man-1.47.7

@jbgi
Copy link
Contributor Author

jbgi commented Nov 15, 2018

Could this be backported to 18.09?

@Mic92
Copy link
Member

Mic92 commented Nov 15, 2018

backport: 2e79014

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.

None yet

4 participants