Skip to content

fix: prepare build system for Nix - #2644

Open
mkroening wants to merge 7 commits into
mainfrom
nix
Open

fix: prepare build system for Nix#2644
mkroening wants to merge 7 commits into
mainfrom
nix

Conversation

@mkroening

Copy link
Copy Markdown
Member

This PR applies most of @alyssais's patches to make Hermit build with Nix: https://gist.github.com/alyssais/cf9362e46da004cde1cec85e857e01fa

The only thing that I did not apply is disabling build-std for hermit-builtins. RUSTC_BOOTSTRAP should be sufficient to enable build-std.

@mkroening mkroening self-assigned this Aug 16, 2026
alyssais and others added 7 commits August 16, 2026 11:40
cargo-vendor puts the dependencies next to the `Cargo.lock` file. They
are not used when not calling cargo-build from the same directory.

Co-authored-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
This environment enables nightly Rust features on stable. This is used
on Nix, for example.

Co-authored-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
Co-authored-by: Alyssa Ross <hi@alyssa.is>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 4cee2bc Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 93.78 s 80.34 s 1.17
startup_benchmark File Size 0.78 MB 0.80 MB 0.98
Startup Time - 1 core 0.79 s (±0.01 s) 0.75 s (±0.02 s) 1.06
Startup Time - 2 cores 0.80 s (±0.03 s) 0.74 s (±0.02 s) 1.09
Startup Time - 4 cores 0.80 s (±0.01 s) 0.74 s (±0.02 s) 1.08
multithreaded_benchmark Build Time 92.13 s 82.11 s 1.12
multithreaded_benchmark File Size 0.88 MB 0.86 MB 1.03
Multithreaded Pi Efficiency - 2 Threads 67.98 % (±5.30 %) 85.89 % (±6.61 %) 0.79
Multithreaded Pi Efficiency - 4 Threads 41.44 % (±2.84 %) 43.43 % (±2.56 %) 0.95
Multithreaded Pi Efficiency - 8 Threads 20.53 % (±1.63 %) 25.76 % (±1.53 %) 0.80
micro_benchmarks Build Time 216.04 s 80.40 s 2.69
micro_benchmarks File Size 0.89 MB 0.86 MB 1.03
Scheduling time - 1 thread 189.89 ticks (±45.15 ticks) 62.65 ticks (±4.06 ticks) 3.03
Scheduling time - 2 threads 114.72 ticks (±19.81 ticks) 34.08 ticks (±4.10 ticks) 3.37
Micro - Time for syscall (getpid) 8.83 ticks (±5.86 ticks) 3.45 ticks (±0.58 ticks) 2.56
Memcpy speed - (built_in) block size 4096 55628.31 MByte/s (±40853.03 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.67
Memcpy speed - (built_in) block size 1048576 14984.09 MByte/s (±12646.85 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 0.49
Memcpy speed - (built_in) block size 16777216 12363.32 MByte/s (±10297.45 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 0.47
Memset speed - (built_in) block size 4096 55941.85 MByte/s (±41082.58 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.68
Memset speed - (built_in) block size 1048576 15248.20 MByte/s (±12769.34 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 0.49
Memset speed - (built_in) block size 16777216 12662.03 MByte/s (±10455.49 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 0.47
Memcpy speed - (rust) block size 4096 51112.86 MByte/s (±38042.90 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 0.69
Memcpy speed - (rust) block size 1048576 14021.92 MByte/s (±11382.93 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 0.46
Memcpy speed - (rust) block size 16777216 12005.40 MByte/s (±9898.05 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 0.43
Memset speed - (rust) block size 4096 52503.60 MByte/s (±38617.54 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 0.71
Memset speed - (rust) block size 1048576 14342.34 MByte/s (±11607.88 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 0.46
Memset speed - (rust) block size 16777216 12380.30 MByte/s (±10139.81 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 0.44
alloc_benchmarks Build Time 222.57 s 74.76 s 2.98
alloc_benchmarks File Size 0.86 MB 0.87 MB 0.98
Allocations - Allocation success 91.35 % 91.31 % 1.00
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.55 % 61.44 % 1.00
Allocations - Average Allocation time 17407.91 Ticks (±1305.63 Ticks) 5860.58 Ticks (±98.43 Ticks) 2.97
Allocations - Average Allocation time (no fail) 18344.19 Ticks (±1619.60 Ticks) 6554.81 Ticks (±92.86 Ticks) 2.80
Allocations - Average Deallocation time 3375.91 Ticks (±1049.09 Ticks) 1805.01 Ticks (±250.35 Ticks) 1.87
mutex_benchmark Build Time 212.48 s 79.82 s 2.66
mutex_benchmark File Size 0.89 MB 0.86 MB 1.03
Mutex Stress Test Average Time per Iteration - 1 Threads 33.98 ns (±7.20 ns) 12.10 ns (±0.41 ns) 2.81
Mutex Stress Test Average Time per Iteration - 2 Threads 32.30 ns (±9.85 ns) 40.26 ns (±1.68 ns) 0.80

This comment was automatically generated by workflow using github-action-benchmark.

@mkroening
mkroening marked this pull request as ready for review August 16, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants