| 17 Jan 2026 |
asa | i was looking through rust build infra in nixpkgs and found that lto is entirely opt in, which struct me as strange because lto=thin is the default for cargo and the rest of the rust ecosystem. is there a reason for this? | 22:15:04 |
asa | i understand -O2 and no LTO by default for c/c++ packages since they could rely on UB that's broken by further optimization, but since the entire rust ecosystem defaults to -03 and thin lto (and rust programs usually don't violate the language's vm), it seems reasonable for that to be the default in nixpkgs as well | 22:18:17 |
K900 | Rust ecosystem does not default to -O3 | 22:21:14 |
K900 | Rust's optimization levels don't really map to C++ conventions | 22:21:23 |
K900 | And even -C opt-level=3 is different from -O3 | 22:21:39 |
K900 | And no, Cargo does not default to thinlto | 22:22:24 |
K900 | https://doc.rust-lang.org/cargo/reference/profiles.html#release | 22:22:24 |
K900 | [profile.release]
opt-level = 3
debug = false
split-debuginfo = '...' # Platform-specific.
strip = "none"
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false
| 22:22:39 |
asa | oh I see | 22:28:03 |
asa | sorry for the misunderstanding, I'm not sure where I read the thin lto by default thing | 22:28:31 |
asa | the profiles page you linked to does say that lto=false is different from lto=off though, and that lto=false enables "thin local lto" | 22:29:54 |
K900 | That should be our default as well, as I don't think we explicitly pass lto=false? | 22:39:17 |
whispers (it/fae) | i think we just inherit whatever upstream has profile.release set to? | 22:42:20 |
asa | probably is? idk how rustc deals with default options | 22:42:21 |
whispers (it/fae) | * | 22:42:42 |
whispers (it/fae) | * | 22:43:12 |
asa | In reply to @k900:0upti.me And even -C opt-level=3 is different from -O3 never thought about this but I guess it's a good thing rust release builds don't use fast-math by default... | 22:44:11 |
asa | i looked into this more and it seems thin local lto is redundant with codegen-units=1 anyway (and rustc disables thin local lto if codegen-units=1 and the lto level is unspecified)
buildRustCrate has defaultCodegenUnits ? 1 since the derivation doesn't allow for rebuilds on a higher granularity than per-crate anyway
| 23:28:51 |
| 18 Jan 2026 |
debtquity | dynamic derivations | 00:21:58 |
debtquity | ? | 00:21:59 |
| isabel changed their profile picture. | 20:43:40 |
debtquity | i get flashbacks to random segfaults in c/c++ when this happens:
> thread 'main' (13304) panicked at cargo-auditable/src/rustc_wrapper.rs:35:10:
> rustc was terminated by a deadly signal
> stack backtrace:
> 0: __rustc::rust_begin_unwind
> 1: core::panicking::panic_fmt
> 2: core::option::expect_failed
> 3: cargo_auditable::rustc_wrapper::main
> 4: cargo_auditable::main
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
💀
| 23:43:35 |
debtquity | beginning to understand why the maintainer abandoned trying to update this package. somehow it compiles fine on darwin, but trying with aarch64 it throws this junk | 23:44:43 |
Winter | what are you trying to compile | 23:46:03 |
debtquity | this one: https://github.com/NixOS/nixpkgs/blob/49213403e38ca893cafc83571d05bebbb782ff89/pkgs/by-name/st/stalwart-mail/package.nix | 23:48:12 |
debtquity | think it might just be a local issue with vm, probably wont see this issue on hydra | 23:56:07 |
Winter | what signal was rustc terminated by | 23:56:56 |
debtquity | not sure, only got this in the output:
Caused by:
Caused by:
process didn't exit successfully: `/nix/store/y7xffr129r4iqjwnrzsylp59837lkfbq-cargo-auditable-0.7.2/bin/cargo-auditable rustc ... (exit status: 101)
| 23:58:51 |
| 19 Jan 2026 |
rosssmyth | It does default to thin local LTO between codegen units within a single crate aka between modules | 01:31:31 |
| 29 Oct 2021 |
| @grahamc:nixos.org set the history visibility to "world_readable". | 19:57:43 |