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

helm: build from source #48092

Merged
merged 2 commits into from Oct 10, 2018
Merged

Conversation

edude03
Copy link
Contributor

@edude03 edude03 commented Oct 9, 2018

Motivation for this change

By building helm from source we can support more platforms. As well, this enables building of the tiller and rudder commands.

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

@nlewo nlewo left a comment

Choose a reason for hiding this comment

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

Could you also rebase this branch with one commit to add yourself in the maintainers list and another one that contains helm changes. Generally, we try to prefix the commit message with the package name. Something such as

helm: build from sources


buildInputs = [ ];
# this is to get buildGoPackage to output to the standard $out folder
outputs = [ "out" ];
Copy link
Member

Choose a reason for hiding this comment

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

Why the bin output would not be suitable? A lot of our Go packages use it.

Copy link
Member

Choose a reason for hiding this comment

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

$out used to contain go source code. I think we are no longer doing this. but changing the defaults should be something we should do treewide.

src = fetchurl {
url = "https://kubernetes-helm.storage.googleapis.com/helm-v${version}-${arch}.tar.gz";
sha256 = checksum;
src = fetchgit {
Copy link
Member

Choose a reason for hiding this comment

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

Could you use fetchFromGithub ?

pkgs/applications/networking/cluster/helm/default.nix Outdated Show resolved Hide resolved
@Mic92 Mic92 changed the title Feature/build helm from source helm: build from source Oct 9, 2018
buildPhase = ''
mkdir -p $out/bin
# this is part two of the hack to get buildGoPackage to output to the standard $out folder
export bin=$out
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason where are not using $bin for everything here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is bin the right thing? Maybe it is, but stdenv uses $out by default normally right? I had a weird issue where the stuff I put in $out didn't end up in result-bin

@edude03 edude03 force-pushed the feature/build-helm-from-source branch 2 times, most recently from fdef96b to bcabf3e Compare October 9, 2018 08:19
@edude03 edude03 force-pushed the feature/build-helm-from-source branch from bcabf3e to c292638 Compare October 9, 2018 08:25
@nlewo
Copy link
Member

nlewo commented Oct 10, 2018

LGTM.
@GrahamcOfBorg build helm

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: helm

Partial log (click to expand)

copying path '/nix/store/3cad7xcanmrmv2pdx7ajkkj4n0p814s9-libdrm-2.4.94-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/rn0afgp3wynihbq4ij2i6c6yp0vz6zsp-libXfixes-5.0.3-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/ygqzphg705x8grwaakijhi9yxkbkq81l-libXdamage-1.1.4-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/w780sp89kgazklkcnyl27mkjagxpv7ks-mesa-noglu-18.2.1-drivers' from 'https://cache.nixos.org'...
copying path '/nix/store/hkqrzx815cmcbzrh0l12ir495hpiplvh-mesa-noglu-18.2.1-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/w51bm5l0pmq921c4ncbzjvbd5hlpr095-libGL-1.0.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/sbhwnywkcjbp8ralcwwx8s60jc9hz7ry-glu-9.0.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/d8clll8nkkysjfjpp693cd7r1c8kpc5f-libGLU-combined' from 'https://cache.nixos.org'...
copying path '/nix/store/k4w9x51w6k849bswahsv0fpiv9s86za3-helm-0.9.0' from 'https://cache.nixos.org'...
/nix/store/k4w9x51w6k849bswahsv0fpiv9s86za3-helm-0.9.0

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

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

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: helm

Partial log (click to expand)

these paths will be fetched (9.41 MiB download, 46.59 MiB unpacked):
  /nix/store/0q1n0w65pv0bvxv3pwjc5crp3d08ljq7-helm-0.9.0
  /nix/store/4w1fva01r7295085h2ba6wglvdpg5kyf-glu-9.0.0-dev
  /nix/store/x464qfk6ppyrjk99m0sfbpg65vxiwfzb-libGLU-combined
copying path '/nix/store/4w1fva01r7295085h2ba6wglvdpg5kyf-glu-9.0.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/x464qfk6ppyrjk99m0sfbpg65vxiwfzb-libGLU-combined' from 'https://cache.nixos.org'...
copying path '/nix/store/0q1n0w65pv0bvxv3pwjc5crp3d08ljq7-helm-0.9.0' from 'https://cache.nixos.org'...
/nix/store/0q1n0w65pv0bvxv3pwjc5crp3d08ljq7-helm-0.9.0

@edude03
Copy link
Contributor Author

edude03 commented Oct 10, 2018

any idea what's going on with the mac build @LnL7?

@nlewo
Copy link
Member

nlewo commented Oct 10, 2018

Arf, sorry, my bad :/
@GrahamcOfBorg build kubernetes-helm

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: kubernetes-helm

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin
shrinking /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin/bin/tiller
shrinking /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin/bin/rudder
shrinking /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin/bin/helm
strip is /nix/store/428gs2z4b8f9byvghzlpbjwjb3a7jwxx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin/bin
patching script interpreter paths in /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin
checking for references to /build in /nix/store/hkz5zf0xwf04rpnb306ypywic9ajxj05-helm-2.11.0-bin...
strip is /nix/store/428gs2z4b8f9byvghzlpbjwjb3a7jwxx-binutils-2.30/bin/strip

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: kubernetes-helm

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin
shrinking /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin/bin/rudder
shrinking /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin/bin/helm
shrinking /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin/bin/tiller
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin/bin
patching script interpreter paths in /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin
checking for references to /build in /nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin...
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
/nix/store/k0ymmdsj3jlnlh6rry64q2ixclq6cxi7-helm-2.11.0-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: kubernetes-helm

Partial log (click to expand)

find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
find: '/nix/store/2agvr2lsfmijyasl2k6f4r49kdbbf52q-helm-2.11.0': No such file or directory
/nix/store/jyv6m1jp7ynw2jkg1f08n8f7gp7lzi4d-helm-2.11.0-bin

@nlewo
Copy link
Member

nlewo commented Oct 10, 2018

Thanks!

@nlewo nlewo merged commit bacaeb2 into NixOS:master Oct 10, 2018
@yurrriq
Copy link
Member

yurrriq commented Jan 30, 2019

@edude03, how did you generate deps.nix? I'm trying to update to 2.12.3, but when I run dep init to convert from Glide to dep, in anticipation of then running dep2nix, it takes HOURS, seems to stall, and then I give up.

@edude03
Copy link
Contributor Author

edude03 commented Jan 31, 2019 via email

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

5 participants