Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto eol=lf
quest/** merge=quest
.github/actions/nextest/VERSION text eol=lf
nix/Cargo.nix linguist-generated
3 changes: 3 additions & 0 deletions .github/actions/nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ runs:
- uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main
with:
determinate: false
# Packages build one derivation per crate, which leaves all but one
# core idle at Nix's default of one job.
extra-conf: |
accept-flake-config = true
max-jobs = auto
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: Nightly
#
# The `release-*` jobs are diff-independent because the release workflows only
# ever run on a tag: a change that compiles under plain cargo can still break a
# release artifact (crane vendors and stubs sources in ways cargo never does,
# release artifact (the per-crate Nix build resolves features and filters sources itself,
# the wheel builds in a manylinux container, the Kotlin/Swift/Go/Dart packages
# link the FFI on every platform) and nothing notices until the tag is pushed.
#
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ PRs into `release` use a merge commit, so their history survives until they land
- Use conventional-commit subjects (`feat(watch): ...`, `fix: ...`, `chore: ...`, `docs: ...`)
- Never commit binaries or build artifacts (`.a`, `.so`, `.dylib`, `.dll`, wheels).
- Keep other binary files, such as images and fixtures, under 500 KiB; list an unavoidable exception in `sh/large-files.allow` with a reason.
- `nix/Cargo.nix`, the Nix packages' per-crate build plan, is generated from the manifests and `Cargo.lock`: `just fix` (or `just rs cargo-nix`) regenerates it, and `just check` fails while it is stale. It needs Nix; without it, leave the plan stale and the merge queue's fixer regenerates it, as it does the workspace-hack.

# PRs

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ opt-level = 3

# The Go mirror stores native staticlibs in Git, whose per-file limit is 100 MB.
# Keep all release entry points on the same compact native profile.
# nix/crates.nix restates this profile for the Nix packages; change both.
[profile.release]
lto = "fat"
codegen-units = 1
Expand Down
4 changes: 3 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
// so a formatter rewriting it would fight the generator on every `just fix`.
// - Recorded audio traces, which record.ts writes one arrival per line so a
// re-recording diffs cleanly; the formatter would undo that.
// - crate2nix's hash cache, which `just rs cargo-nix` writes.
"includes": [
"**",
"!rs/moq-mux/src/container/ts/test_data",
"!rs/moq-audio/src/decode/test_data/*.ts",
"!**/*.svg",
"!doc/concept/audio-jitter/*.json",
"!test/audio-quality/traces/*.json"
"!test/audio-quality/traces/*.json",
"!nix/crate-hashes.json"
]
},
"linter": {
Expand Down
16 changes: 0 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -43,7 +42,6 @@
self,
nixpkgs,
flake-utils,
crane,
rust-overlay,
quest,
...
Expand All @@ -61,7 +59,7 @@
github-runner-vm = import ./nix/modules/github-runner-vm.nix;
};

overlays.default = import ./nix/overlay.nix { inherit crane; };
overlays.default = import ./nix/overlay.nix;
}
// eachSupportedSystem (
system:
Expand Down Expand Up @@ -738,20 +736,24 @@

# Heavy Rust CI (clippy / doc / test) runs via `just check` and `just
# test` (see rs/justfile), reaching mbx through the Cargo shim the dev
# shell puts on PATH. Neither path goes through crane.
# `nix flake check` is kept -- it still validates flake eval + builds the
# runner tests. The dispatcher runs it for Nix and packaging inputs;
# Rust source changes use the Cargo gate above. Release
# artifacts still build via crane `buildPackage` (see `packages` above /
# release-*.yml).
# shell puts on PATH. `nix flake check` validates flake eval and builds
# the checks below; the dispatcher runs it for Nix and packaging
# inputs. Release artifacts build per crate (nix/crates.nix).
#
# Which compiler cache those runs get is a workflow concern
# (`.github/actions/rust-cache`); nothing here configures it.
checks = {
package-source-assets = pkgs.runCommand "package-source-assets" { } ''
test -f "${overlayPkgs.moq-boy.src}/rs/moq-video/src/frame/nv12_resize.ptx"
touch "$out"
'';
# The per-crate source filter keeps what moq-video embeds.
package-source-assets =
let
moq-video = pkgs.lib.findFirst (
crate: crate.crateName == "moq-video"
) (throw "moq-boy links no moq-video") overlayPkgs.moq-boy.completeDeps;
in
pkgs.runCommand "package-source-assets" { } ''
test -f "${moq-video.src}/src/frame/nv12_resize.ptx"
touch "$out"
'';
}
// pkgs.lib.optionalAttrs (system == "x86_64-linux") (
import ./nix/runner/checks.nix { inherit pkgs; }
Expand Down
9 changes: 5 additions & 4 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,17 @@ build closure from `nix develop --profile`, uploading only missing paths, plus
builds outside the dev shell. An independent x86 Linux job builds and pushes
the `moq-relay`, `moq`, and `moq-boy` closures that Smoke's nix channel and
demo deploys pin by commit (`just gh cache-rev`), which read them without
write keys. Their existing Crane `cargoArtifacts` outputs
are published first so later builds can substitute them when their inputs
are unchanged; those inputs include the patched `kio` sources. The other
write keys. They build one derivation per crate (`nix/crates.nix`), and the
crates they link (`.#<package>.deps`) are published first, so a later build
rebuilds only the crates whose source, features, or dependencies changed. The other
platforms have no Smoke nix lane. Runtime warms serialize: the active run
finishes and new pushes replace only the pending run, avoiding duplicate
builds without starving publication or delaying the dev-shell matrix.
Its lifecycle rule (`infra/nix/lifecycle.json`) deletes each object 14 days
after upload. `nix copy` never re-uploads a path the bucket already has, so a
path many commits reuse keeps its first upload's age. Each job therefore
records the store paths it pushed under `roots/<commit>/`, then copies every
records the store paths it pushed under `roots/<commit>/`, the runtime job its
dependency crates too, since no runtime closure references them, then copies every
object in that commit's recorded closures that is over a week old onto itself,
restarting its age; it fails if any is already gone. The newest cached
commit, the one Smoke pins, therefore substitutes in full while `main` keeps
Expand Down
Loading