Repository navigation
feat: install eza from its release binary where no package exists - #63
Merged
Merged
Conversation
Debian 12 and Ubuntu 22.04 have no eza package. The failed install degraded modern-aliases as a whole, which also dropped the cat and find aliases although bat and fd were installed. A fallback so far stood in for a module's whole package list, so a release entry for eza alone would have left bat and fd uninstalled. A fallback can now name the packages it stands in for with `replaces`: it is used only when one of those is unavailable, and the manager still installs the module's other packages. Without `replaces` nothing changes. modern-aliases gets a release fallback for eza on Linux x86_64 and arm64.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Debian 12 and Ubuntu 22.04 have no
ezapackage.apt-get install ezafails with exit status 100 andmodern-aliasesis degraded as a whole, which also drops thecatandfindaliases althoughbatandfdare installed.A release fallback alone would not have fixed it: a fallback stood in for a module's whole package list, so
batandfdwould no longer have been installed.Change
[[packages.fallback]]acceptsreplaces, the manager packages the entry stands in for. The fallback is used only when one of those is unavailable; every other missing package stays with the manager. An unavailable package thatreplacesdoes not name also stays with the manager, so its install error degrades the module as before.replacesa fallback stands in for the whole package list. No existing module changes behaviour.replacesis validated: each name must be a package the manifest lists for at least one manager.modern-aliasesgets a release fallback forezav0.23.5 withreplaces = ["eza"]: the static musl build on Linux x86_64, the glibc build on arm64 (upstream has no musl build there; it needs glibc 2.18).docs/writing-a-module.md, the README module table, the changelog andCLAUDE.md.Limits
ezapackage the module is still degraded.Test plan
Ran locally:
make test(race detector)make lintNew tests:
internal/engine/partial_fallback_test.go: the plan for each combination of unavailable packages; apply installs the manager package and the release binary, records both in the lockfile and has nothing to do on the second run; a failed manager install and a failed download each degrade the module.internal/module/manifest_test.go:replacesaccepts listed packages and rejects an unknown name.modules/builtin_test.go:modern-aliaseshas the eza release entry with assets for amd64 and arm64.The SHA-256 of both assets was checked against the downloaded archives, and the archive member is
eza.For a reviewer: on Debian 12, run
omnishell applywithmodern-aliasesenabled and open a new shell.command -v ezashould resolve to~/.config/omnishell/vendor/bin/eza, andls,catandfindshould be aliased. This was not run on such a host yet.