You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os-release (new): ship /etc/os-release in every box via base - #1661
Boxes have no /etc/os-release, so tools that identify the distro refuse to run. The one that prompted this is Rex's installer: rex server install ssh://box exits with "cannot tell which Linux distribution this is". /etc is read-only and built from package outputs, so the file has to come from a package.
This adds an os-release package and puts it in base's runtime_deps, the same way #804 added tzdata.
Changes
New package packages/os-release: it ships the vendor file at usr/lib/os-release and etc/os-release as a relative symlink to it, the layout os-release(5) specifies:
Builds that sniff the distro.fix(base): ship the IANA timezone database in every box #804 broke Tcl, whose configure noticed the new zoneinfo directory. /etc/os-release can trigger the same thing in configure scripts, Python platform/distro, and installers that branch on ID. Watch the rebuild for changed outputs.
Field choice.ID=minimal with no ID_LIKE, on purpose: claiming a parent distro would make tools reach for its package manager. VERSION_ID is optional and can be added later. No BUILD_ID either: the spec defines it as a unique image identifier, which rolling isn't.
Testing
min package patched-build os-release and min package patched-build base both succeeded locally, before this branch was rebased onto the current main. They have not been rerun since the rebase or since the move to /usr/lib/os-release + symlink; the new build.sh was only run by hand outside the sandbox.
Installed the built os-release into a session and confirmed /etc/os-release has the content above.
min check was not run locally: with base changed it evaluates and rebuilds most of the tree. Leaving it to the pipeline.
Not tested: a box with packages = ["base"] at this commit, and the Rex install end to end.
Boxes have no /etc/os-release, so tools that identify the distro refuse
to run (the Rex installer exits with "cannot tell which Linux
distribution this is"). /etc is read-only and built from package
outputs, so the file has to come from a package.
ID=minimal with no ID_LIKE, on purpose: claiming a parent distro would
make tools reach for its package manager.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Reviewing files that changed from the base of the PR and between 7879b4e and 0f52a9c.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The change adds an os-release package that writes and tests the Minimal distribution identity. The base package now includes os-release as a runtime dependency.
Changes: os-release package and base integration
Layer / File(s)
Summary
Build and test os-release packages/os-release/build.ncl, packages/os-release/build.sh
The build specification runs the script, declares two output paths, and checks the ID and NAME values. The script writes the Minimal distribution identity fields and links /etc/os-release to /usr/lib/os-release.
Add os-release to base packages/base/build.ncl
The base build specification imports os-release and adds it to runtime dependencies.
This change adds distribution identity data to every box via base. No concrete defect was found, so the merge risk is minimal. Rebuild effects from distro detection by downstream tools were not exercised.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a new os-release package that ships /etc/os-release in every box through the base package. The raw summary confirms that base now depends on os-release and that the ne…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: a new os-release package that ships /etc/os-release in every box through the base package. The raw summary confirms that base now depends on os-release and that the new package provides /usr/lib/os-release with a relative /etc/os-release symlink. The title is specific and matches the objectives, and it does not describe anything absent from the changeset.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 33979ad and 4947d96.
Files selected for processing: 2
packages/os-release/build.ncl
packages/os-release/build.sh
Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Three things to settle before we pay for the world rebuild:
Rex end to end. Rex's installer is the reason for this PR, but it hasn't been tested against it yet. If Rex only accepts distro IDs it knows, ID=minimal could still fail with "unsupported distribution". Can you hand-place this exact file at /etc/os-release in a box (or a box with the built package installed) and run rex server install ssh://box? That would confirm the fields are enough before every package rebuilds.
A simpler shape (your call).base already writes /etc/hosts from its own build.sh (packages/base/build.sh, outputs.hosts). os-release could be a few more lines there plus an os_release = { glob = "etc/os-release" } | OutputData output, with no new package and no runtime-dep/cycle note. The separate package has one advantage: a box that doesn't use base can opt in. Either is fine.
BUILD_ID=rolling. Minimal has no version number, and os-release(5) suggests BUILD_ID for exactly that; Arch, also rolling, ships BUILD_ID=rolling with no VERSION_ID. Some installers look for VERSION_ID or BUILD_ID, so this one line costs nothing and saves a later rebuild. It's optional.
Checked and fine: #!/bin/sh with only bash-bootstrap (it ships usr/bin/sh), no attrs (same as base/toolchain), OutputData for an etc/ file, no other package ships an os-release, ID=minimal with no ID_LIKE, and the test.
The reason will be displayed to describe this comment to others. Learn more.
Scope matches the title. The diff adds one package with one output and one edge in base. It follows the tzdata change in #804 line for line.
Clobber none. git log on packages/base/build.ncl shows only the tzdata change before this one, and the diff keeps it.
Correctness The build deps give build.sh its sh, mkdir and cat. No dependency cycle exists, because the package uses bash-bootstrap and coreutils, as tzdata does. No other package declares etc/os-release, and no build.sh in the repo reads it. The file content is valid for os-release(5). One finding: the package declares no license_spdx.
Not checked The mass rebuild needs a build. An upstream configure script or installer can read /etc/os-release and change its output, as Tcl did with zoneinfo in #804. The PR body names this risk. I did not check the four packages with a broad etc/* glob for a new match, and I did not run the test.
The reason will be displayed to describe this comment to others. Learn more.
low · The package declares no license_spdx. The license lint (.github/scripts/license_lint.py) will report it as missing license_spdx, and the catalog will carry no license for a package that is in every box. The lint excuses only aggregate packages such as base and toolchain. packages/resolver-quad8/build.ncl, the same kind of config-only package, declares attrs = { license_spdx = "Apache-2.0" } | Attrs and cites LICENSING.md section 1. Add the same attribute here, and add Attrs to the import line. This is one instance: 583 of 591 packages declare the field.
Checked against os-release(5). One change I'd make before the rebuild: the spec puts the vendor file at /usr/lib/os-release and makes /etc/os-release a relative symlink to it. We ship a regular file in /etc only, so a tool that reads just /usr/lib/os-release finds nothing.
with a second output, { glob = "usr/lib/os-release" } | OutputData.
On item 3, I'd skip BUILD_ID=rolling. The spec defines BUILD_ID as a unique identifier for the image originally installed (its example is 2013-03-20.3), which rolling isn't, and it says rolling releases may leave the version fields unset. Add it only if the Rex run shows something needs it.
Since any later edit to this file is another world rebuild: if we want DOCUMENTATION_URL, BUG_REPORT_URL, SUPPORT_URL, or VENDOR_NAME + VENDOR_URL, they should go in now.
…release
os-release(5) puts the vendor file at /usr/lib/os-release and makes
/etc/os-release a relative symlink to it. Shipping only a regular file in
/etc meant a tool reading just /usr/lib/os-release found nothing.
Adds a second output for the vendor file and extends the test to read both
paths. BUILD_ID stays out: the spec defines it as a unique image identifier,
which "rolling" isn't.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A31JRi4PcZ65P9Z1cn49Vr
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
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.
Summary
Boxes have no
/etc/os-release, so tools that identify the distro refuse to run. The one that prompted this is Rex's installer:rex server install ssh://boxexits with "cannot tell which Linux distribution this is"./etcis read-only and built from package outputs, so the file has to come from a package.This adds an
os-releasepackage and puts it inbase'sruntime_deps, the same way #804 addedtzdata.Changes
packages/os-release: it ships the vendor file atusr/lib/os-releaseandetc/os-releaseas a relative symlink to it, the layout os-release(5) specifies:bash-bootstrapandcoreutilsonly. It must not depend onbase, becausebasecarries it at runtime and that would be a cycle.IDandNAME.packages/base/build.ncl: importos-releaseand add it toruntime_deps.Risks
base, so this changes their inputs. fix(base): ship the IANA timezone database in every box #804 paid the same cost./etc/os-releasecan trigger the same thing in configure scripts, Pythonplatform/distro, and installers that branch onID. Watch the rebuild for changed outputs.ID=minimalwith noID_LIKE, on purpose: claiming a parent distro would make tools reach for its package manager.VERSION_IDis optional and can be added later. NoBUILD_IDeither: the spec defines it as a unique image identifier, whichrollingisn't.Testing
min package patched-build os-releaseandmin package patched-build baseboth succeeded locally, before this branch was rebased onto the current main. They have not been rerun since the rebase or since the move to/usr/lib/os-release+ symlink; the newbuild.shwas only run by hand outside the sandbox.os-releaseinto a session and confirmed/etc/os-releasehas the content above.min checkwas not run locally: withbasechanged it evaluates and rebuilds most of the tree. Leaving it to the pipeline.packages = ["base"]at this commit, and the Rex install end to end.Checklist
min checkpasses for the affected packages/harnesses.min patched-build <name>succeeds for any package I added or modified.🤖 Generated with Claude Code
Summary by CodeRabbit
Generated by Claude Code