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

notary: fix build #39684

Merged
merged 1 commit into from Apr 30, 2018
Merged

notary: fix build #39684

merged 1 commit into from Apr 30, 2018

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Apr 29, 2018

Motivation for this change

The package is broken on master for some time now:
https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.notary.x86_64-linux/all

The main reason for the breackage is that the Makefile script attempts
to retrieve the latest git commit by using git rev-parse which breaks
as git is not in the build environment. This could be fixed by using
?= rather than := for the GITCOMMIT variable in the make script
to easily override GITCOMMIT in the buildPhase.

See the Hydra logs for reference:
https://nix-cache.s3.amazonaws.com/log/ib4qp8h4r8d830ra4fah38l7ybb82gp7-notary-0.6.0.drv

Furthermore some refactoring was applied:

  • Activated the test suite for cmd/notary to confirm the basic
    functionality when building for NixOS.

  • Added {pre,post} hooks for {build,install}Phase

  • Added myself as maintainer to have more people available in case of
    further breakage.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: notary

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin
shrinking /nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin/bin/notary
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin/bin
patching script interpreter paths in /nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin
checking for references to /build in /nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin...
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
/nix/store/6d5k010byb7417v58y441aqwqmc7l2gk-notary-0.6.1-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: notary

Partial log (click to expand)

ok      github.com/theupdateframework/notary/client     180.424s
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/jaxml6885qglzl4w3jd9garjs0i3jbcf-notary-0.6.1-bin
shrinking /nix/store/jaxml6885qglzl4w3jd9garjs0i3jbcf-notary-0.6.1-bin/bin/notary
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/jaxml6885qglzl4w3jd9garjs0i3jbcf-notary-0.6.1-bin/bin
patching script interpreter paths in /nix/store/jaxml6885qglzl4w3jd9garjs0i3jbcf-notary-0.6.1-bin
checking for references to /build in /nix/store/jaxml6885qglzl4w3jd9garjs0i3jbcf-notary-0.6.1-bin...
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip

@xeji
Copy link
Contributor

xeji commented Apr 29, 2018

This builds fine but your patches have a side effect:

 $ ./notary  version
notary
 Version:    
 Git commit: 

Now this isn't crucial but if it would be great if you could at least patch the version number in there somehow (users probably don't care about the git commit anyway).

@Ma27 Ma27 changed the title notary: fix build WIP notary: fix build Apr 29, 2018
@Ma27
Copy link
Member Author

Ma27 commented Apr 29, 2018

yeah you're absolutely right, I guess this is because buildGoPackage doesn't watch for the make files.
I'll try to fix this tomorrow, but now I have to get some sleep :-)

The package is broken on master for some time now:
https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.notary.x86_64-linux/all

The main reason for the breackage is that the `Makefile` script attempts
to retrieve the latest git commit by using `git rev-parse` which breaks
as `git` is not in the build environment. This could be fixed by using
`?=` rather than `:=` for the `GITCOMMIT` variable in the `make` script
to easily override `GITCOMMIT` in the `buildPhase`.

See the Hydra logs for reference:
https://nix-cache.s3.amazonaws.com/log/ib4qp8h4r8d830ra4fah38l7ybb82gp7-notary-0.6.0.drv

Furthermore some refactoring was applied:

* Activated the test suite for `cmd/notary` to confirm the basic
  functionality when building for NixOS.

* Added {pre,post} hooks for `{build,install}Phase`

* Added myself as maintainer to have more people available in case of
  further breakage.
@Ma27 Ma27 changed the title WIP notary: fix build notary: fix build Apr 30, 2018
@Ma27
Copy link
Member Author

Ma27 commented Apr 30, 2018

@xeji thanks for your feedback - I fixed the problem!
buildGoPackage doesn't use the Makefile, but automatically detects go packages that will be built manually, so the original idea with makeFlags and buildTargets was simply wrong - sorry!

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: notary

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin
shrinking /nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin/bin/notary
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin/bin
patching script interpreter paths in /nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin
checking for references to /build in /nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin...
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
/nix/store/dbh4yy429d8p9ihcc7y4m3bfcfwxqslj-notary-0.6.1-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: notary

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin
shrinking /nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin/bin/notary
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin/bin
patching script interpreter paths in /nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin
checking for references to /build in /nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin...
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
/nix/store/gwlr93170zf0xahqg5pqziysaz3i3whl-notary-0.6.1-bin

@xeji
Copy link
Contributor

xeji commented Apr 30, 2018

Great, thank you!

@xeji xeji merged commit 69d4bdc into NixOS:master Apr 30, 2018
@Ma27 Ma27 deleted the fix-notary branch April 30, 2018 09:01
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

3 participants