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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ permissions:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: "1.99.0"
RUST_VERSION: "1.100.0"

jobs:
changes:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
55 changes: 49 additions & 6 deletions crates/nera-runtime/src/ffi/string_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,37 @@ unsafe fn codepoint_list(ctx: *mut ProcessContext, text: impl Iterator<Item = ch
with_ctx_heap(ctx, |heap| heap.alloc_list_from_slice(&points).0)
}

fn extend_otp29_lowercase(output: &mut impl Extend<char>, 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;
Expand All @@ -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<char> = 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())
Expand Down
38 changes: 32 additions & 6 deletions crates/nera-runtime/tests/exit_signal_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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"))
Expand Down
6 changes: 2 additions & 4 deletions crates/nera-syntax/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 10 additions & 7 deletions docs/PROJECT_STATUS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.99.0"
channel = "1.100.0"
profile = "minimal"
components = ["rustfmt", "clippy"]
Loading