From d1d7ea0f6135aacb15e169f54a35e9645d36474d Mon Sep 17 00:00:00 2001 From: Nera maintainer Date: Tue, 24 Nov 2026 18:24:12 +0000 Subject: [PATCH] chore(toolchain): upgrade pinned Rust The workspace, CI, release workflow, and setup guides now share the upgraded Rust toolchain. The lexer and runtime satisfy the new compiler's findings while preserving established output behavior. Lowercase handling retains the OTP 29 Unicode checksum under the newer toolchain. The runtime contract test finds package-local Cargo build artifacts and still checks the unsafe call boundary. The active project status now distinguishes the historical pin from the current one. --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 4 +- CONTRIBUTING.md | 2 +- README.md | 2 +- crates/nera-runtime/src/ffi/string_ops.rs | 55 +++++++++++++++++-- .../tests/exit_signal_contract.rs | 38 +++++++++++-- crates/nera-syntax/src/token.rs | 6 +- docs/PROJECT_STATUS.md | 17 +++--- docs/USAGE.md | 2 +- rust-toolchain.toml | 2 +- 10 files changed, 100 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96eb7f5..c713eaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ permissions: env: CARGO_TERM_COLOR: always - RUST_VERSION: "1.99.0" + RUST_VERSION: "1.100.0" jobs: changes: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 465dd9b..e1c80d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: "1.99.0" + toolchain: "1.100.0" targets: ${{ matrix.cross && matrix.target || '' }} - name: Install cross-compilation tools (Linux aarch64) @@ -52,7 +52,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: release-${{ runner.os }}-rust-1.99.0-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + key: release-${{ runner.os }}-rust-1.100.0-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} - name: Extract version id: version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a40e6bc..3f04cbf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ guidelines for contributing to the project. ### Prerequisites -- **Rust 1.99.0**, selected by `rust-toolchain.toml` and pinned in CI. +- **Rust 1.100.0**, selected by `rust-toolchain.toml` and pinned in CI. Keep the root `Cargo.lock` under version control; update dependencies separately from toolchain changes and rerun the [baseline](docs/PROJECT_STATUS.md). - **A C linker** — `cc` on PATH (Xcode CLI Tools on macOS, `gcc`/`clang` on Linux) diff --git a/README.md b/README.md index 72bc3b6..156ef92 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ See the [installation guide](docs/USAGE.md#installation) for archive setup. To build from source, install [Rust through rustup](https://rustup.rs/), Git and a C linker: Xcode Command Line Tools on macOS, or GCC/Clang on Linux. -The checkout selects Rust 1.99.0. +The checkout selects Rust 1.100.0. Run this in a POSIX shell: diff --git a/crates/nera-runtime/src/ffi/string_ops.rs b/crates/nera-runtime/src/ffi/string_ops.rs index d00bed9..7e72dca 100644 --- a/crates/nera-runtime/src/ffi/string_ops.rs +++ b/crates/nera-runtime/src/ffi/string_ops.rs @@ -153,6 +153,37 @@ unsafe fn codepoint_list(ctx: *mut ProcessContext, text: impl Iterator, character: char) { + // OTP 29's checksum matches Unicode 17; Unicode 18 added lowercase mappings for these codepoints. + if matches!( + character as u32, + 0xA7DD + | 0xA7E2 + | 0xAB6C + | 0xAB6D + | 0x1DF40 + | 0x1DF48 + | 0x1DF4A + | 0x1DF4D + | 0x1DF51 + | 0x1DF68 + | 0x1DF6A + | 0x1DF6C + | 0x1DF6E + | 0x1DF72 + | 0x1DF74 + | 0x1DF76 + | 0x1DF78 + | 0x1DF7A + | 0x1DF7C + | 0x1DF7E + ) { + output.extend(std::iter::once(character)); + } else { + output.extend(character.to_lowercase()); + } +} + /// string:lowercase/1. Full Unicode lowercase mapping applied one codepoint /// at a time with no context rules (final sigma stays plain sigma), as OTP /// does. Unchanged binaries and flat codepoint lists are returned as given; @@ -168,18 +199,30 @@ pub unsafe extern "C" fn nera_rt_string_lowercase(ctx: *mut ProcessContext, inpu Ok(text) => text, Err(e) => return raise_badarg_rest(ctx, input, e.valid_up_to()), }; - let lowered: String = text.chars().flat_map(char::to_lowercase).collect(); - if lowered.as_bytes() == bytes { return input.0; } + let mut lowered = String::new(); + for character in text.chars() { + extend_otp29_lowercase(&mut lowered, character); + } + if lowered.as_bytes() == bytes { + return input.0; + } return with_ctx_heap(ctx, |heap| heap.alloc_binary_auto(lowered.as_bytes()).0); } - if !input.is_cons() { return raise_badarg_with(ctx, input); } + if !input.is_cons() { + return raise_badarg_with(ctx, input); + } let text = match decode_chardata(input) { Ok(text) => text, Err(error) => return raise_input_error(ctx, error), }; - let lowered: Vec = text.chars().flat_map(char::to_lowercase).collect(); - if is_flat_codepoint_list(input) && lowered.len() == text.chars().count() - && lowered.iter().copied().eq(text.chars()) { + let mut lowered = Vec::new(); + for character in text.chars() { + extend_otp29_lowercase(&mut lowered, character); + } + if is_flat_codepoint_list(input) + && lowered.len() == text.chars().count() + && lowered.iter().copied().eq(text.chars()) + { return input.0; } codepoint_list(ctx, lowered.into_iter()) diff --git a/crates/nera-runtime/tests/exit_signal_contract.rs b/crates/nera-runtime/tests/exit_signal_contract.rs index e9d91fc..4ad7124 100644 --- a/crates/nera-runtime/tests/exit_signal_contract.rs +++ b/crates/nera-runtime/tests/exit_signal_contract.rs @@ -18,8 +18,29 @@ fn raw_exit_scan_requires_an_unsafe_call() { .parent() .unwrap() .to_path_buf(); - let library = std::fs::read_dir(&dependencies) - .unwrap() + let mut dependency_dirs = vec![dependencies.clone()]; + if let Some(package_build_dir) = dependencies.parent().and_then(|dir| dir.parent()) { + if package_build_dir + .file_name() + .is_some_and(|name| name == "nera-runtime") + { + if let Some(build_dir) = package_build_dir.parent() { + for package in std::fs::read_dir(build_dir).unwrap().flatten() { + if let Ok(fingerprints) = std::fs::read_dir(package.path()) { + dependency_dirs.extend( + fingerprints + .flatten() + .map(|fingerprint| fingerprint.path().join("out")) + .filter(|output| output.is_dir()), + ); + } + } + } + } + } + let library = dependency_dirs + .iter() + .flat_map(|directory| std::fs::read_dir(directory).unwrap()) .map(|entry| entry.unwrap().path()) .find(|path| { path.extension() @@ -40,12 +61,17 @@ fn raw_exit_scan_requires_an_unsafe_call() { format!("use nera_runtime::{{process::Process, term::ErlTerm}};\n{adapter}\n{body}"), ) .unwrap(); - Command::new("rustc") + let mut command = Command::new("rustc"); + command .args(["--edition=2021", "--crate-type=lib", "--emit=metadata"]) .arg("--extern") - .arg(format!("nera_runtime={}", library.display())) - .arg("-L") - .arg(format!("dependency={}", dependencies.display())) + .arg(format!("nera_runtime={}", library.display())); + for directory in &dependency_dirs { + command + .arg("-L") + .arg(format!("dependency={}", directory.display())); + } + command .arg(&file) .arg("-o") .arg(directory.join("contract.rmeta")) diff --git a/crates/nera-syntax/src/token.rs b/crates/nera-syntax/src/token.rs index e8f1739..f2ec847 100644 --- a/crates/nera-syntax/src/token.rs +++ b/crates/nera-syntax/src/token.rs @@ -27,13 +27,11 @@ pub enum Token { // hexadecimal and control-prefix syntax out of this fallback. #[regex(r"\$\\[^0-7x^\r\n]", parse_char_escape)] #[regex(r"\$\\[0-7]{1,3}", |lex| i64::from_str_radix(&lex.slice()[2..], 8).ok())] - #[regex(r"\$[^\\\s]", parse_char_literal)] - #[regex(r"\$[ \t]", parse_char_literal)] + #[regex(r"\$(?:[^\\\s]|[ \t])", parse_char_literal)] Integer(i64), /// Intermediate numeric token, normalized by the lexer wrapper. - #[regex(r"[0-9][0-9_]*", parse_number)] - #[regex(r"[0-9][0-9_]*#[0-9a-zA-Z_]+", parse_number)] + #[regex(r"[0-9][0-9_]*(?:#[0-9a-zA-Z_]+)?", parse_number)] Number(IntegerValue), /// Canonical decimal representation of an integer outside i64. diff --git a/docs/PROJECT_STATUS.md b/docs/PROJECT_STATUS.md index f3419ec..661dd45 100644 --- a/docs/PROJECT_STATUS.md +++ b/docs/PROJECT_STATUS.md @@ -1,14 +1,15 @@ # Nera public-preview status -Updated **2026-11-12** (baseline text below dated 2026-10-10). This is the active restart and preview-readiness record. +Updated **2026-11-24** (baseline text below dated 2026-10-10). This is the active restart and preview-readiness record. The wider roadmaps are design/history documents, not release checklists. **Verdict: the three P0 fixes are implemented and verified on macOS arm64; public-preview readiness is still blocked by the remaining items below.** The repairs are recorded in separate commits. The original baseline is preserved; [repair evidence](baselines/2026-10-10-repairs/README.md) records the new results. -The subsequent [toolchain refresh](baselines/2026-10-10-toolchain/README.md) -pins Rust 1.99.0 and upgrades Cranelift to 0.129.2 with no new local regressions. +The earlier [toolchain refresh](baselines/2026-10-10-toolchain/README.md) +pinned Rust 1.99.0 and upgraded Cranelift to 0.129.2 with no new local regressions. +This update advances the active Rust pin to 1.100.0. The [deprecation follow-up](baselines/2026-10-10-deprecation/README.md) now passes all **1,686 Rust tests** locally, with 285 Erlang passes and two expected skips. The follow-up is recorded with its tests and baseline; remote CI results below @@ -214,10 +215,12 @@ is covered by the local baseline; remote validation must use its published head. ### P1-3 — Reproducibility and release gates -The Rust refresh pins 1.99.0 in the project and CI, makes the root `Cargo.lock` -eligible for version control, and requires locked builds in CI and packaging. -The local macOS baseline found no new regressions with dependencies unchanged. -These changes are recorded in separate Rust and Cranelift commits. +The original Rust refresh pinned 1.99.0 in the project and CI, made the root +`Cargo.lock` eligible for version control, and required locked builds in CI and +packaging. The current project and CI pin is 1.100.0. The recorded macOS +baseline for the original refresh found no new regressions with dependencies +unchanged. Those original changes are recorded in separate Rust and Cranelift +commits. See the [toolchain refresh](baselines/2026-10-10-toolchain/README.md) for separate Rust and Cranelift evidence. diff --git a/docs/USAGE.md b/docs/USAGE.md index eed25be..0722ace 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -50,7 +50,7 @@ release label. ### Build from source Install Git, the linker and [Rust through rustup](https://rustup.rs/). -The checkout selects Rust 1.99.0; `--locked` uses the committed dependency lock. +The checkout selects Rust 1.100.0; `--locked` uses the committed dependency lock. Run these commands from a POSIX shell: ```sh diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b432996..63202c6 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.99.0" +channel = "1.100.0" profile = "minimal" components = ["rustfmt", "clippy"]