oxidecomputer / oxidecomputer/omicron
`env.sh` is out of sync with prerequisite scripts and doesn't work for all shells
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
The "Prerequisite" sections of the how to run docs (real sled agent, simulated sled agent) recommend using env.sh to setup one's PATH before running the prerequisite scripts in tools (then building and/or running the software).
A couple of things I notice looking at this now:
1. The list of packages that are checked to be in the user's PATH in the prereq scripts is out of sync with env.sh
The items added to PATH here differ from what is checked for by install_builder_prerequisites.sh (namely, those also check for pg_config and pkg-config). This is also true of .envrc.
I was curious how this worked in CI, as the env.sh script is also used in CI to configure PATH for various workflows. I spot checked a random clippy-lint job, I see that /usr/bin is already in PATH, and at least on my linux laptop, that's where pg_config and pkg-config live. This is fine for those dependencies, but it might be nice to have crisper representations of what packages we expect to be in PATH here.
2. env.sh does not work for zsh users
Per @citrus-it, this script does not work in zsh shells, because it ends up inserting embedded newlines:
Example:
% echo $PATH
/home/andy/omicron
/home/andy/omicron/out/dendrite-stub/bin:/home/andy/omicron
/home/andy/omicron/out/clickhouse:/home/andy/omicron
/home/andy/omicron/out/cockroachdb/bin:/home/andy/bin:/usr/bin:/usr/sbin:/opt/ooce/bin:/opt/onbld/bin/i386:/opt/onbld/bin:/home/andy/.cargo/bin
I intend to scope out how easy it would be to move this into an xtask (as a part of #3939 or otherwise).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing env.sh with tools/install_builder_prerequisites.sh and .envrc, then reproduce the PATH output in zsh. Done means the prerequisite package list is consistent and PATH setup no longer inserts embedded newlines; determine from the stated scope whether an xtask is needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- devops, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100