aws/session-manager-plugin

Upgrade/Re-Vendor (or switch) UUID Library

adrianosela opened this issue · 0 comments

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/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:170:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:176:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:182:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:188:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:194:10: cannot use nil as uuid.UUID value in return statement
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/src/message/messageparser.go:417:14: invalid operation: input == nil (mismatched types uuid.UUID and untyped nil)
../../../../pkg/mod/github.com/aws/session-manager-plugin@v0.0.0-20230315220744-7b544e9f381d/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