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

pass-import: fix environment bugs #41371

Merged
merged 1 commit into from Jun 2, 2018
Merged

Conversation

jbaum98
Copy link
Contributor

@jbaum98 jbaum98 commented Jun 1, 2018

Motivation for this change

Fixes #41323.

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/)
  • Fits CONTRIBUTING.md.

@orivej
Copy link
Contributor

orivej commented Jun 1, 2018

Haven't been able to build because of the many rebuilds triggered by #41369, but working on it.

You can test your changes with --run "export PREFIX" instead of --export PREFIX. I suspect that this will not help, but even if it does #41369 should not yet be merged because it does not seem useful for other packages.

@xeji
Copy link
Contributor

xeji commented Jun 1, 2018

Rebase gone wrong, the extra commits don't belong here.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Jun 1, 2018

Sorry I'll fix it. I built with --run "export PREFIX" and it worked! I didn't know about the --run flag. So I'll rebase this right without relying on that other pull request.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Jun 2, 2018

This only fixes one of the issues, now there is a different problem related to PASSWORD_STORE_BIN being set to $0, because it assumes that it is being invoked as /path/to/pass import.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Jun 2, 2018

Using --argv0 doesn't help either, because exec -a doesn't seem to have an effect on shell scripts with a shebang.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Jun 2, 2018

Since I can't figure out how to set $0 through the shebang, I'm going to use sed to replace it with a path to the pass binary. Doesn't seem like the best way but I can't figure out a better one.

@jbaum98 jbaum98 changed the title Pass import fix pass-import: fix environment bugs Jun 2, 2018
@xeji
Copy link
Contributor

xeji commented Jun 2, 2018

@GrahamcOfBorg build passExtensions.pass-import

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: passExtensions.pass-import

Partial log (click to expand)

pass-import is installed succesfully

post-installation fixup
gzipping man pages under /nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2/share/man/
strip is /nix/store/r5mcn9vqq80v5pfqp45d7290cis7dwp4-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2/lib
patching script interpreter paths in /nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2
/nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2/lib/password-store/extensions/import.bash: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/i9g6883w05pyj9aa4sl8hn945qyy6j53-bash-4.4-p19/bin/bash"
/nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2/lib/password-store/import/import.py: interpreter directive changed from "/usr/bin/env python3" to "/nix/store/bk112qbk195h53yzw5jq2c2zj3kfc3sa-python3-3.6.5-env/bin/python3"
/nix/store/6zh8iyd7mw6kl6vlw2acshjbg7pyi1xm-pass-import-2.2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: passExtensions.pass-import

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2
gzipping man pages under /nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2/share/man/
strip is /nix/store/92d2ifxcni4n3zx9s8wnkcjlvnx5ajlc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2/lib
patching script interpreter paths in /nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2
/nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2/lib/password-store/extensions/import.bash: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/m47apl3hq3i52fzy2cz24378p0xn4lyx-bash-4.4-p19/bin/bash"
/nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2/lib/password-store/import/import.py: interpreter directive changed from "/usr/bin/env python3" to "/nix/store/sjhraxgsdinr6crg8wahcs9j6x24hlcz-python3-3.6.5-env/bin/python3"
checking for references to /build in /nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2...
/nix/store/ivxckcywwhl8mfxkn0g2zlqi4h27a141-pass-import-2.2

@xeji xeji merged commit 32ff88c into NixOS:master Jun 2, 2018
@xeji xeji mentioned this pull request Jun 2, 2018
8 tasks
@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: passExtensions.pass-import

Partial log (click to expand)

copying path '/nix/store/8djk909yzc0lngahdan5yl652qa06bl3-python3.6-defusedxml-0.5.0' from 'https://cache.nixos.org'...
copying path '/nix/store/dsr1mw33zcx300i4j4z1s7zh24qy7scg-python3-3.6.5-env' from 'https://cache.nixos.org'...
copying path '/nix/store/6sjyc9j6pqlqpjbh0djlbxp834qmjzaz-texinfo-6.5' from 'https://cache.nixos.org'...
copying path '/nix/store/8i2chclkaz1360v59h66lhy8z4h2v7cb-binutils-wrapper-2.30' from 'https://cache.nixos.org'...
copying path '/nix/store/9sh21njz4kmk50jr4gi9sqqprfvh6r9s-gcc-wrapper-7.3.0' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/bhqkrs98x77apk777620yn10q7i1vmsp-pinentry-1.1.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/gj8v8d9dlk6pm25w39hzysrbbc3c5nih-gnupg-2.2.7.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/xikrrz347hp812ph183d3dxvv2agjwhp-password-store-1.7.1.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/g7bx1ii0f8x2819cp79djzn1y8pilzs8-pass-import-2.2.drv': 2 dependencies couldn't be built
error: build of '/nix/store/g7bx1ii0f8x2819cp79djzn1y8pilzs8-pass-import-2.2.drv' failed

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