Fix CI Builds for Nix and Rust #238
Merged
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.
This PR addresses several issues causing failures in the Nix and Rust CI workflows.
Context:
Cargo.lockfile generated with a newer Rust version (v4 format) being incompatible with the older Rust toolchain (1.77.2) provided by thenixos-24.05Nixpkgs channel.magic-nix-cache-action) was also deprecated and causing errors.Cargo.lock, subsequent Rust test failures and compilation errors occurred due to code incompatibilities with Rust 1.77.2 and platform-specific test behavior.actions-rs/toolchainaction.Changes:
.github/workflows/nix.yml:DeterminateSystems/magic-nix-cache-actionwith the recommendedDeterminateSystems/flakehub-cache-action.permissionsblock (id-token: write,contents: read) for theflakehub-cache-action.Cargo.lockto the v3 format version compatible with Rust 1.77.2 from thenixos-24.05channel (done manually, reflected in git history)..github/workflows/rust.yml:actions-rs/toolchainaction.latest,1.86.0(stable), and1.77.2Rust versions.rustimages corresponding to the matrix versions.actions/cache@v4for Cargo registry/git data and the./targetdirectory to improve performance.Cargo.lockto workflow trigger paths.src/commands/edge_app/utils.rs:test_transform_edge_app_instance_path_to_instance_manifest_with_env_instance_override_should_return_overrided_manifest_pathto compare only the filenames instead of full paths. This resolves failures caused by differing temporary directory paths between macOS and Linux build environments.src/commands/serde_utils.rs:Option::is_none_or(stabilized in Rust 1.86) with the equivalentOption::map_or(|s| s.is_empty())logic to ensure compatibility with the older Rust 1.77.2 toolchain used in the Nix build.Reasoning:
Cargo.lockwas chosen over overriding the Rust version inflake.nixto maintain stability and avoid using thenixos-unstablechannel.