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

go: do not wrap with go get tools #48284

Merged
merged 1 commit into from Oct 13, 2018
Merged

go: do not wrap with go get tools #48284

merged 1 commit into from Oct 13, 2018

Conversation

lukateras
Copy link
Member

@lukateras lukateras commented Oct 12, 2018

Motivation for this change

Related: #46603

These tools are not required for buildGoPackage, while significantly affecting closure size and build time. This essentially reverts 458895d.

cc @fpletz @Mic92 @WilliButz @xeji

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.

See: #46603

These tools are not required for `buildGoPackage`, while
significantly affecting closure size and build time.

This essentially reverts 458895d.
@lukateras
Copy link
Member Author

@GrahamcOfBorg build grafana prometheus_2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: go

Partial log (click to expand)

wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
wrong ELF type
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/qbfg78zpj82fhcxpa7mhnw01m7pc9qn4-go-1.11

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: grafana, prometheus_2

Partial log (click to expand)

github.com/grafana/grafana/vendor/github.com/prometheus/client_model/go
github.com/grafana/grafana/vendor/github.com/matttproud/golang_protobuf_extensions/pbutil
github.com/grafana/grafana/vendor/github.com/prometheus/common/expfmt
github.com/grafana/grafana/vendor/github.com/prometheus/client_golang/prometheus
github.com/grafana/grafana/pkg/models
github.com/grafana/grafana/pkg/tsdb
github.com/grafana/grafana/pkg/tsdb/testdata
github.com/grafana/grafana/scripts/build
builder for '/nix/store/qi5hw8gsz6zcxxnm7fm594gnm0nja1cm-grafana-5.2.4.drv' failed with exit code 48
error: build of '/nix/store/j9f5mwwp6scqs0jjfmgbnif4d1dm1wa3-prometheus-2.4.3.drv', '/nix/store/qi5hw8gsz6zcxxnm7fm594gnm0nja1cm-grafana-5.2.4.drv' failed

Copy link
Contributor

@xeji xeji left a comment

Choose a reason for hiding this comment

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

LGTM. People using go imperatively would have to make sure the required SCM tools are installed and in PATH. It's mostly git anyway, which is usually installed. I think that's fine and the reduction in closure size is worth a minor inconvenience.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: go

Partial log (click to expand)

cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/s506rh65m9khlr7hic0zcck19k2pabcb-go-1.11

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: go

Partial log (click to expand)


ALL TESTS PASSED
---
Installed Go for darwin/amd64 in /nix/store/05pbhfmh6xpy4mgr5qsxr3w98j5n0j02-go-1.11/share/go
Installed commands in /nix/store/05pbhfmh6xpy4mgr5qsxr3w98j5n0j02-go-1.11/share/go/bin
post-installation fixup
strip is /nix/store/9xjkb4xz0b5lmizij9ppxy7lkxdxhx6b-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/05pbhfmh6xpy4mgr5qsxr3w98j5n0j02-go-1.11/bin
patching script interpreter paths in /nix/store/05pbhfmh6xpy4mgr5qsxr3w98j5n0j02-go-1.11
/nix/store/05pbhfmh6xpy4mgr5qsxr3w98j5n0j02-go-1.11

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: grafana, prometheus_2

Partial log (click to expand)

strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/da0c4lb91c18x2nwribfkxzl8h3a3slb-prometheus-2.4.3-bin/bin
patching script interpreter paths in /nix/store/da0c4lb91c18x2nwribfkxzl8h3a3slb-prometheus-2.4.3-bin
checking for references to /build in /nix/store/da0c4lb91c18x2nwribfkxzl8h3a3slb-prometheus-2.4.3-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/wwciglav8cqs8rbq2gjzlcn2gd8lqw5g-prometheus-2.4.3
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/wwciglav8cqs8rbq2gjzlcn2gd8lqw5g-prometheus-2.4.3
checking for references to /build in /nix/store/wwciglav8cqs8rbq2gjzlcn2gd8lqw5g-prometheus-2.4.3...
/nix/store/skv3bgdf4dpywb8f7km3xwmpb4m4icvr-grafana-5.2.4-bin
/nix/store/da0c4lb91c18x2nwribfkxzl8h3a3slb-prometheus-2.4.3-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: prometheus_2

The following builds were skipped because they don't evaluate on x86_64-darwin: grafana

Partial log (click to expand)

installing
post-installation fixup
Moving /nix/store/9b8yz2qcdzqcqfz16blmsc011waapgvl-prometheus-2.4.3-bin/share/doc to /nix/store/701jbk5js3q4fscd0dm398838k0i0mpn-prometheus-2.4.3/share/doc
Removing empty /nix/store/9b8yz2qcdzqcqfz16blmsc011waapgvl-prometheus-2.4.3-bin/share/ and (possibly) its parents
strip is /nix/store/9xjkb4xz0b5lmizij9ppxy7lkxdxhx6b-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/9b8yz2qcdzqcqfz16blmsc011waapgvl-prometheus-2.4.3-bin/bin
patching script interpreter paths in /nix/store/9b8yz2qcdzqcqfz16blmsc011waapgvl-prometheus-2.4.3-bin
strip is /nix/store/9xjkb4xz0b5lmizij9ppxy7lkxdxhx6b-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/701jbk5js3q4fscd0dm398838k0i0mpn-prometheus-2.4.3
/nix/store/9b8yz2qcdzqcqfz16blmsc011waapgvl-prometheus-2.4.3-bin

@Mic92
Copy link
Member

Mic92 commented Oct 12, 2018

I agree, also not those systems are used frequently. Most packages can be probably build with git + bazar.

Copy link
Member

@WilliButz WilliButz left a comment

Choose a reason for hiding this comment

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

Seeing the difference in the dependecy tree and the resulting decreased closure size, I definitely agree with @xeji and think it's worth this minor inconvenience 👍

# before
$ nix path-info -r /nix/store/6p2nyb3kvamrjd3xkc8dym3f9l9pqfcw-go-1.10.3 | wc -l
95

# after
$ nix path-info -r /nix/store/yijwdk569c4fj361vg8f9788i1n8mv7m-go-1.10.3 | wc -l
12

@Mic92 Mic92 merged commit 53255e2 into NixOS:master Oct 13, 2018
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

6 participants