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
2 changes: 1 addition & 1 deletion .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
jobs:
native:
# The same dnix commit as pubspec.yaml and flake.lock.
uses: cypherstack/dnix/.github/workflows/native.yml@e91763ef25d084b3a5cf271a0cfee69159b1f779
uses: cypherstack/dnix/.github/workflows/native.yml@2fd2ed73b9037fe11436f2cde832d7e28d672fa9
with:
# Xcode 27 lives on its own public-preview image, not on macos-26.
macos-runner: xcode-27
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

* Update dnix to support native Windows source and development builds through
WSL2, including the `wsl_distribution` user define and fixes for paths
containing percent escapes. Source builds still verify the existing
native-library hashes.
* The build hook, the Nix build, and the workflows now come from the shared `dnix` package; the package keeps `dnix.json`, `dnix.lock`, a two-line hook, and a two-line flake.
* The hook obtains the native library in one of three modes: `prebuilt` downloads the library of the pinned native release and verifies its hash, `source` builds it with the Nix flake and verifies the same hash, and `dev` builds with Nix without the Xcode pin or hash check. Static linking is no longer offered.
* `dnix.lock` is a source file: `update_lock` records what the Rust source builds to and names the release, derived from the hashes, that holds those bytes. CI fails when source and lock disagree and publishes the release when the lock reaches the default branch; nothing is committed by CI.
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@ hooks:
verifies it against the hash recorded there. A mismatch is an error, never
a fallback. Downloads are cached by hash.
- `source` builds the library with Nix, the same build CI uses, and verifies
it against the same hash. Needs Nix on Linux or an Apple Silicon Mac; the
Apple targets need Xcode 27.0.
it against the same hash. Needs Nix on Linux, an Apple Silicon Mac,
or inside WSL2 on Windows; the Apple targets need Xcode 27.0.
- `dev` builds with Nix but skips the Xcode pin and the hash check, for
working on the Rust code. The hook notices a `.dnix-build` file from its
next run on, so touch `dnix.json` after creating it.

On Windows, install Nix in WSL2 and run Dart or Flutter from Windows.
`source` and `dev` invoke `wsl.exe` using the default distribution. To
select another distribution, add `wsl_distribution: Ubuntu-24.04` beside
`build` in the package's user defines. Apple targets still require macOS.
See [dnix's Windows setup](https://github.com/cypherstack/dnix/blob/main/doc/configuration.md#windows-source-builds)
for installation and checkout requirements.

Only dynamic libraries are provided, built for macOS 12, iOS 13 (the arm64
simulator 14), Android API 24, and glibc 2.28 at minimum. iOS stays at 13
because Flutter 3.47 asks build hooks for iOS 13 and writes 13.0 into each
Expand All @@ -59,9 +66,9 @@ default branch. Nothing is ever committed by CI, and old releases stay.

Anyone can rebuild one platform with Nix and compare:
`dart tool/verify_release.dart linux` (or android, windows, macos, ios, or a
target triple), on Windows inside WSL2 for the non-Apple platforms. The Apple
platforms use the Xcode 27.0 bundle under `/Applications`, whatever
`xcode-select` points at.
target triple). Native Windows Dart invokes Nix inside WSL2 for non-Apple
targets. The Apple platforms use the Xcode 27.0 bundle under `/Applications`,
whatever `xcode-select` points at.

### How the build stays reproducible

Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ packages:
dependency: transitive
description:
path: "."
ref: e91763ef25d084b3a5cf271a0cfee69159b1f779
resolved-ref: e91763ef25d084b3a5cf271a0cfee69159b1f779
ref: 2fd2ed73b9037fe11436f2cde832d7e28d672fa9
resolved-ref: 2fd2ed73b9037fe11436f2cde832d7e28d672fa9
url: "https://github.com/cypherstack/dnix.git"
source: git
version: "0.1.0"
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
dnix:
git:
url: https://github.com/cypherstack/dnix.git
ref: e91763ef25d084b3a5cf271a0cfee69159b1f779
ref: 2fd2ed73b9037fe11436f2cde832d7e28d672fa9

dev_dependencies:
test: ^1.26.3
Expand Down
Loading