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

Upgrade/Re-Vendor (or switch) UUID Library #73

Open
adrianosela opened this issue May 26, 2023 · 0 comments
Open

Upgrade/Re-Vendor (or switch) UUID Library #73

adrianosela opened this issue May 26, 2023 · 0 comments

Comments

@adrianosela
Copy link

TL;DR; if my go module/project imports https://github.com/aws/session-manager-plugin and I update all my go deps with go get -u ./..., the library github.com/twinj/uuid (indirect dependency of my project via github.com/aws/session-manager-plugin) will upgrade from v0.0.0-20151029044442-89173bcdda19 (the version used by the ssm plugin lib) to v1.0.0 which introduces breaking changes (the aws ssm plugin library can't build with that version).

Example:

Bumping the version of the uuid library for my project/module (same effect as just running go get -u ./...)

14:36 $ go get -u github.com/twinj/uuid
go: upgraded github.com/twinj/uuid v0.0.0-20151029044442-89173bcdda19 => v1.0.0

Building the binary for my project/module

14:36 $ go build -o my_binary
# github.com/aws/session-manager-plugin/src/message
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:170:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:176:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:182:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:188:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:194:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:417:14: invalid operation: input == nil (mismatched types uuid.UUID and untyped nil)
../../../../pkg/mod/github.com/aws/[email protected]/src/message/messageparser.go:497:25: undefined: uuid.CleanHyphen

The Problem:

This library imports and vendors an old version of github.com/twinj/uuid.

The AWS session manager plugin library is importing and vendoring version v0.0.0-20151029044442-89173bcdda19 of github.com/twinj/uuid.

Running a go get -u ./... on a go project that imports the aws session manager plugin (this repo) and its libraries will break the build of that project.

This is because the UUID library introduced a breaking change and the aws ssm plugin library does not use go modules.

This uuid lib is also deprecated... consider using google's uuid library instead https://github.com/google/uuid.

The Fix:

  • Use go modules

OR

  • Re-vendor the uuid library with its latest release

OR

  • Use a different UUID library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant