Skip to content

fix(armory): report empty package lock status#21

Merged
cwilson613 merged 2 commits into
mainfrom
fix/empty-armory-lock-status
May 29, 2026
Merged

fix(armory): report empty package lock status#21
cwilson613 merged 2 commits into
mainfrom
fix/empty-armory-lock-status

Conversation

@cwilson613
Copy link
Copy Markdown
Contributor

Summary

Fixes #20.

nex lock status now treats an absent Armory package lock as a valid empty state instead of surfacing an os error 2 read failure.

Output with no lock:

Armory package lock: absent
roots: 0
materialized packages: 0

lock status is also handled before config resolution, so it works on fresh systems that do not have a Nex repo/config yet.

Tests

nix shell nixpkgs#cargo nixpkgs#rustc nixpkgs#rustfmt -c cargo fmt
nix shell nixpkgs#cargo nixpkgs#rustc -c cargo test lock_status -- --nocapture
nix shell nixpkgs#cargo nixpkgs#rustc -c cargo test

Manual fresh-HOME check:

tmp=$(mktemp -d)
HOME=$tmp nix shell nixpkgs#cargo nixpkgs#rustc -c cargo run -- lock status
rm -rf $tmp

Result:

Armory package lock: absent
roots: 0
materialized packages: 0

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread src/ops/lock_status.rs

let result = status();

match old_home {
@cwilson613 cwilson613 force-pushed the fix/empty-armory-lock-status branch from ac10bf1 to 7ed85ec Compare May 29, 2026 23:38
@cwilson613 cwilson613 merged commit e13859f into main May 29, 2026
3 checks passed
@cwilson613 cwilson613 deleted the fix/empty-armory-lock-status branch May 29, 2026 23:42
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.

nex lock status should report empty state when no package lock exists

3 participants