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

aws-iam-authenticator: 0.4.0 -> 0.5.2 #109015

Merged
merged 2 commits into from Feb 9, 2021
Merged

Conversation

ivankovnatsky
Copy link
Contributor

@ivankovnatsky ivankovnatsky commented Jan 11, 2021

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ivankovnatsky
Copy link
Contributor Author

did not invest much time into this for now:

builder for '/nix/store/d8haqdf4av9dg4wjpz0lzapz9zs61yn1-aws-iam-authenticator-0.5.2.drv' failed with exit code 1; last 10 log lines:
          /nix/store/v76kr0rbcghcc6vx70k6xdd2ifqid98c-go-1.15.6/share/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/mapper (from $GOROOT)
         /build/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/mapper (from $GOPATH)
  go/src/github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator/server.go:26:2: cannot find package "sigs.k8s.io/aws-iam-authenticator/pkg/server" in any of:
    /build/go/src/github.com/kubernetes-sigs/aws-iam-authenticator/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/server (vendor tree)
       /nix/store/v76kr0rbcghcc6vx70k6xdd2ifqid98c-go-1.15.6/share/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/server (from $GOROOT)
         /build/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/server (from $GOPATH)
  go/src/github.com/kubernetes-sigs/aws-iam-authenticator/cmd/aws-iam-authenticator/token.go:23:2: cannot find package "sigs.k8s.io/aws-iam-authenticator/pkg/token" in any of:
      /build/go/src/github.com/kubernetes-sigs/aws-iam-authenticator/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token (vendor tree)
        /nix/store/v76kr0rbcghcc6vx70k6xdd2ifqid98c-go-1.15.6/share/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/token (from $GOROOT)
          /build/go/src/sigs.k8s.io/aws-iam-authenticator/pkg/token (from $GOPATH)
cannot build derivation '/nix/store/2a4h1nhn2baf4qijrmsy644qc159gw3g-env.drv': 1 dependencies couldn't be built

will get back.

@NelsonJeppesen
Copy link
Contributor

I started work on this before I saw this PR - I did get a build working if you want to steal my code NelsonJeppesen@edc923a

I'm brand new to Nix, but it was recomened to me to switch to buildGoModule

@ivankovnatsky
Copy link
Contributor Author

ivankovnatsky commented Jan 17, 2021

Hey @NelsonJeppesen, as you say, if you didn't raise a pr we probably could do it here, to minimize actions.

1 package built:
aws-iam-authenticator

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/463

@kalbasit
Copy link
Member

kalbasit commented Feb 7, 2021

@GrahamcOfBorg build aws-iam-authenticator

Copy link
Member

@kalbasit kalbasit left a comment

Choose a reason for hiding this comment

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

Please set ldflags to -s -w at the minimum to shrink the size of the binary (look for examples in nixpkgs). I recommend also looking upstream if they support embedding a version in the binary.

@ofborg ofborg bot requested a review from kalbasit February 8, 2021 09:05
@kalbasit
Copy link
Member

kalbasit commented Feb 8, 2021

@ivankovnatsky I'm afk, could please double check that the version is reported correctly by the binary?

Also, your last commit is removing stdenv that you added in the first commit, please squash those two commits so you end up with two commits one for the update and the other for ldflags.

Co-authored-by: Nelson Jeppesen <50854675+NelsonJeppesen@users.noreply.github.com>
@kalbasit kalbasit merged commit a073dd5 into NixOS:master Feb 9, 2021
@ivankovnatsky
Copy link
Contributor Author

@kalbasit good catch, thanks. i'm not a big expert in go software packaging, so i took it from here: https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/master/.goreleaser.yaml#L16.

but i still could not get the version running the cli (sorry i didn't respond earlier, will create new pr no problem):

tools/security/aws-iam-authenticator on  patch-10 ❯ nix-build -E 'with import <nixpkgs> {} ; callPackage ./default.nix {}';
/nix/store/b6q5pb3wdxvl21n5vzwhy9prf929m9a7-aws-iam-authenticator-0.5.2
tools/security/aws-iam-authenticator on  patch-10 ❯ ./result/bin/aws-iam-authenticator version
{"Version":"unversioned"}
tools/security/aws-iam-authenticator on  patch-10 ❯

am i doing it wrong?

@kalbasit
Copy link
Member

kalbasit commented Feb 9, 2021

@ivankovnatsky no worries I pushed ab987e2 to fix it. The version variable used to be called differently in version 0.5.2 as you can see here.

@ivankovnatsky
Copy link
Contributor Author

@kalbasit, good catch, thanks.

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