Skip to content

Update dependencies and drop the abandoned archiver - #13

Merged
lnsp merged 2 commits into
masterfrom
update-dependencies
Jul 25, 2026
Merged

Update dependencies and drop the abandoned archiver#13
lnsp merged 2 commits into
masterfrom
update-dependencies

Conversation

@lnsp

@lnsp lnsp commented Jul 25, 2026

Copy link
Copy Markdown
Member

Why

Every direct dependency was behind:

module from to
github.com/fatih/color v1.17.0 v1.19.0
github.com/schollz/progressbar/v3 v3.17.1 v3.19.1
github.com/spf13/cobra v1.8.1 v1.10.2
golang.org/x/crypto v0.30.0 v0.54.0
golang.org/x/exp 2024-07-07 2026-07-18
golang.org/x/term v0.40.0 v0.45.0

The current releases require Go 1.25, so the go directive moves up with them. Anyone building from source now needs Go 1.25; CI reads the version from go.mod so it follows automatically.

The archiver could not be fixed by a bump

github.com/mholt/archiver/v3 is abandoned upstream, and govulncheck reported three vulnerabilities against it and its rardecode dependency, all with no fixed version available:

All three are in extraction / RAR decoding paths. The CLI only ever used the library to build a gzipped tarball in util.CompressDir and never to extract one, so none were reachable in practice — but the dependency had no path forward regardless.

archive/tar + compress/gzip do the same job directly. govulncheck now reports zero vulnerabilities affecting this code, and ten transitive modules go away with it: brotli, dsnet/compress, snappy, klauspost/compress, klauspost/pgzip, rardecode, pierrec/lz4, ulikunitz/xz, xi2/xz.

Behaviour

The tarball is byte-for-byte equivalent in structure: same relative, slash-separated entry names, same file modes via tar.FileInfoHeader, same symwalk traversal so symlinks are still followed, same ignore-prefix filtering. The one difference is that the redundant "." root entry is no longer emitted.

Testing

go build ./..., go vet ./... and go test ./... all pass. New util/util_test.go covers the archive layout, ignore prefixes and the non-directory error — nothing previously tested the packaging step that every valar deploy depends on.

lnsp added 2 commits July 25, 2026 17:51
Every direct dependency was behind, and the current releases require Go
1.25, so the go directive moves up with them. Notably this picks up
golang.org/x/crypto v0.30.0 -> v0.54.0.

github.com/mholt/archiver/v3 could not be fixed by a version bump: it is
abandoned upstream and govulncheck reports three vulnerabilities against
it and its rardecode dependency with no fixed version available. The CLI
only ever used it to build a gzipped tarball in CompressDir and never to
extract one, so none were reachable in practice, but the dependency had
no path forward.

archive/tar and compress/gzip do the same job directly. That clears all
three findings -- govulncheck now reports zero affecting this code -- and
drops ten transitive modules along with it: brotli, dsnet/compress,
snappy, klauspost/compress, klauspost/pgzip, rardecode, pierrec/lz4,
ulikunitz/xz and xi2/xz.

Add tests for CompressDir covering the archive layout, ignore prefixes
and the non-directory error, since nothing covered the packaging that
every deploy depends on.
@lnsp
lnsp merged commit 173e5c2 into master Jul 25, 2026
3 checks passed
@lnsp
lnsp deleted the update-dependencies branch July 25, 2026 15:55
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.

1 participant