Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Conversation

@natsukium
Copy link
Collaborator

Summary

Replace simple wrapper script with two-phase build using deno cache --vendor for deterministic dependency vendoring.

Motivation

The previous implementation was a wrapper script that delegated dependency resolution to runtime. This approach does not pin dependencies at build time.

This change vendors dependencies at build time using deno cache --vendor, which produces deterministic output suitable for Nix's fixed-output derivation. The cache approach was not used because JSR cache metadata contains timestamps and SQLite databases have non-deterministic page ordering.

Changes

  • Add deps derivation that vendors dependencies deterministically
  • Build proper probitas derivation with vendored dependencies
  • Handle platform-specific npm packages by filtering based on os/cpu constraints from deno.lock
  • Add update-nix-hash task chained to update-lock for automatic hash synchronization
  • Include updateDepsHash passthru script for convenient hash updates

Test plan

  • Tested with nix run .#probitas run

Replace the simple wrapper script with a two-phase build that uses
`deno cache --vendor` for deterministic output.
This eliminates non-determinism from JSR cache metadata such as
timestamps and SQLite page ordering, enables proper package installation
with vendored dependencies, and provides build verification.
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lambdalisue
Copy link
Member

Please add nix to GitHub Actions to fix the CI error.

Add `update-nix-hash` task and chain it to `update-lock` so that Nix
flake hashes stay synchronized with Deno lock file changes. This prevents
divergence between Deno and Nix dependency versions.
@lambdalisue lambdalisue merged commit 04c9f1c into probitas-test:main Dec 23, 2025
3 checks passed
@lambdalisue
Copy link
Member

Nice 👍

@natsukium natsukium deleted the feat/deterministic branch December 23, 2025 02:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants