Skip to content

vendor: github.com/urfave/cli v1.22.9 and fix "verify-vendor" script#6997

Merged
kzys merged 2 commits intocontainerd:mainfrom
thaJeztah:update_urfave
May 27, 2022
Merged

vendor: github.com/urfave/cli v1.22.9 and fix "verify-vendor" script#6997
kzys merged 2 commits intocontainerd:mainfrom
thaJeztah:update_urfave

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented May 27, 2022

fix verify-vendor if go.mod does not contain replace rules

Before this patch, if the go.mod did not contain a replace rule, jq would fail
(Cannot iterate over null), and Bash would produce an error when trying to add
an empty $key to map_requires:

make verify-vendor
+ verify-vendor
  jq: error (at <stdin>:581): Cannot iterate over null (null)
  /go/src/github.com/containerd/containerd//script/verify-go-modules.sh: line 44: map_replaces_1[$key]: bad array subscript
  make: *** [Makefile:435: verify-vendor] Error 1

vendor: github.com/urfave/cli v1.22.9

The regression in v1.22.2 has been resolved, so we can drop the
replace rule and use the latest v1.22.x version.

full diff: urfave/cli@v1.22.1...v1.22.9

@thaJeztah
Copy link
Copy Markdown
Member Author

I'll work on a follow-up to this one to see if we can make use of the new urfave_cli_no_docs build-tag as well (see urfave/cli#1383)

@thaJeztah
Copy link
Copy Markdown
Member Author

Hmm... what's this error?

+ verify-vendor
go: downloading github.com/Microsoft/hcsshim/test v0.0.0-20210408205431-da33ecd607e1
jq: error (at <stdin>:581): Cannot iterate over null (null)
/home/runner/work/containerd/containerd/src/github.com/containerd/containerd//script/verify-go-modules.sh: line 44: map_replaces_1[$key]: bad array subscript
Makefile:422: recipe for target 'verify-vendor' failed
make: *** [verify-vendor] Error 1

Before this patch, if the go.mod did not contain a replace rule, jq would fail
(Cannot iterate over null), and Bash would produce an error when trying to add
an empty `$key` to `map_requires`:

    make verify-vendor
    + verify-vendor
      jq: error (at <stdin>:581): Cannot iterate over null (null)
      /go/src/github.com/containerd/containerd//script/verify-go-modules.sh: line 44: map_replaces_1[$key]: bad array subscript
      make: *** [Makefile:435: verify-vendor] Error 1

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah changed the title vendor: github.com/urfave/cli v1.22.9 vendor: github.com/urfave/cli v1.22.9 and fix "verify-vendor" script May 27, 2022
The regression in v1.22.2 has been resolved, so we can drop the
replace rule and use the latest v1.22.x version.

full diff: urfave/cli@v1.22.1...v1.22.9

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

Pushed a commit to fix the vendor check

@thaJeztah
Copy link
Copy Markdown
Member Author

Failures should probably not be related (as #6998 went green); let me close/reopen to trigger CI

@thaJeztah thaJeztah closed this May 27, 2022
@thaJeztah thaJeztah reopened this May 27, 2022
@thaJeztah
Copy link
Copy Markdown
Member Author

Hmm.. that didn't seem to trigger the cirrus jobs (which were the ones failing); perhaps it's just slow to report, so let's see

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM 🎉 (nice to see the replace rules disappearing!)

@kzys kzys merged commit c76559a into containerd:main May 27, 2022
@thaJeztah thaJeztah deleted the update_urfave branch May 27, 2022 17:56
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

Successfully merging this pull request may close these issues.

3 participants