Repository navigation
Kris/various nix fixes - #6344
Open
krisajenkins wants to merge 3 commits into
Open
krisajenkins wants to merge 3 commits into
krisajenkins wants to merge 3 commits into
Conversation
rust-toolchain.toml now pins channel 1.97.1, and the Nix dev shell builds its toolchain from that file via rust-overlay, so the overlay lock should be fresh enough to carry it. Bumped the rust-overlay input in flake.lock with `nix flake update rust-overlay`. Verified with `nix develop -c rustc --version`, which reports 1.97.1.
…bin/head.
The schema_extract tests build a throwaway inspector shell script and run it
through inspect_with. Two of them check that the inspector received the exact
module bytes with:
[ "$(/bin/cat "$2")" = exact-artifact ] || exit 3
That works on a developer machine, so where does it fail? In a Nix build
sandbox, which has no /bin/cat. nixpkgs runs the test suite when it builds
spacetimedb, and the automatic 2.10.2 -> 2.12.0 update has been failing since
these tests landed:
/build/.tmpQddzhq/inspector: line 3: /bin/cat: not found
failures:
schema_extract::tests::local_inspection_passes_exact_bytes_host_and_requires_success
schema_extract::tests::synchronous_generate_adapter_uses_same_exact_byte_protocol_inside_a_runtime
So nixpkgs is stuck on 2.10.2 until someone patches around it.
A third test has the same hardcoded path, but it fails silently instead.
invalid_and_oversize_inspector_output_never_becomes_diagnostics runs
"exec /usr/bin/head -c 16777217 /dev/zero" to check that inspector output over
the 16 MiB limit is rejected. When /usr/bin/head is missing, exec fails, the
script exits non-zero, inspect_with returns an error, and the test passes
because all it checks is that some error came back. In that environment the
oversize path is never exercised at all.
Writing a bare `cat` would not help. configure_inspector_environment clears
the environment on Unix, so the inspector runs with no PATH and the shell
falls back to a default search path, which is just as empty in the sandbox.
The tests now resolve each tool from their own PATH (which the build
environment does populate) and write its absolute path into the script. The
oversize test also asserts on the specific error for each case, so a missing
tool or a script failing for the wrong reason can no longer pass.
- New `tool(name)` helper searches the test process PATH and panics with a
clear message if the tool is missing.
- Both exact-bytes tests interpolate `{cat}` from `tool("cat")`.
- The oversize test uses `tool("head")` and checks for "exceeds output limit";
the invalid-output case checks for "returned invalid schema data".
This branch has not been deployed
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.
Description of Changes
Three changes specifically for the nix builds:
catandheadfrom$PATH.This makes the build and test suite more portable and repeatable.
API and ABI breaking changes
N/A
Rollback safety impact
N/A
Expected complexity level and risk
Testing
Ran the full test suite from a nix shell.