assume-role icon indicating copy to clipboard operation
assume-role copied to clipboard

Build instructions

Open metov opened this issue 3 years ago • 4 comments

Can you please add instructions for building from source? (including for people unfamiliar with Go) I want to try the workaround in https://github.com/remind101/assume-role/issues/54#issuecomment-779355310 but not sure how to build.

metov avatar Apr 13 '21 22:04 metov

Hopefully this will help - I've had the same problem, not too familiar with Go (yet), but figured out how to get it to work.

  • Clone the pr repo to somewhere on your machine: git clone [email protected]:ibisnetworks/assume-role.git
  • Using this article as a guide:
    • cd to the cloned directory
    • Make sure you have go 1.16+ installed, then run these commands:
    • GOOS=darwin GOARCH=amd64 go build -o assume-role main.go
    • You can now test the binary using ./assume-role (you should see some output instead of the segment fault that appeared before)
    • I then copied this binary to the local bin using sudo cp assume-role /usr/local/bin. You might not want to do it this way - you could add the new location to your path, I guess, but this worked for me.
    • You can now test in your terminal with assume-role. You should see the same output you saw a couple of steps above
  • The assume-role command should now be available to use as it was previously (for some reason, in the GOOS step, you can actually use amd64 OR arm64 - both seem to work. Or you can create a universal package as in the linked article - that works also).

Thanks to madsenibis for the work in the pr.

rmjjjt avatar Jun 07 '21 08:06 rmjjjt

I'm getting errors running this:

main.go:16:2: no required module provides package github.com/aws/aws-sdk-go/aws: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:17:2: no required module provides package github.com/aws/aws-sdk-go/aws/credentials: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:18:2: no required module provides package github.com/aws/aws-sdk-go/aws/credentials/stscreds: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:19:2: no required module provides package github.com/aws/aws-sdk-go/aws/session: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:20:2: no required module provides package github.com/aws/aws-sdk-go/service/sts: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:21:2: no required module provides package gopkg.in/yaml.v2: go.mod file not found in current directory or any parent directory; see 'go help modules'

I'm not a go dev, and I'm not sure how to proceed here.

brunns avatar Dec 01 '22 14:12 brunns

I'm getting errors running this:

main.go:16:2: no required module provides package github.com/aws/aws-sdk-go/aws: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:17:2: no required module provides package github.com/aws/aws-sdk-go/aws/credentials: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:18:2: no required module provides package github.com/aws/aws-sdk-go/aws/credentials/stscreds: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:19:2: no required module provides package github.com/aws/aws-sdk-go/aws/session: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:20:2: no required module provides package github.com/aws/aws-sdk-go/service/sts: go.mod file not found in current directory or any parent directory; see 'go help modules'
main.go:21:2: no required module provides package gopkg.in/yaml.v2: go.mod file not found in current directory or any parent directory; see 'go help modules'

I'm not a go dev, and I'm not sure how to proceed here.

@brunns which version of go did you install? I think we've seen something similar and was possibly related to v1.19.x of go. If you are on 1.19.x, try using 1.18.8 and see if that helps.

rmjjjt avatar Dec 01 '22 14:12 rmjjjt

Ah, yes, I'm on 1.19.3.

brunns avatar Dec 01 '22 14:12 brunns