Hi,

I was suggested to take this to the mailing list, so here I am.

Right now doing ./mach build, then cargo build, or vice versa, causes a
full rebuild, which is really painful[1].

The way to fix this is making mach build don't touch RUSTFLAGS, at least
by default[2].

This requires making opt-in instead of opt-out some build options by
default, like -W unused-extern-crates, or the bit to use the gold linker.

Josh pointed out that that last bit may not be a great trade-off. It
personally is for me, fwiw, but I of course can't speak for everyone.

In any case, I think long-term we should probably make cargo support
these build options properly, using Cargo.toml instead of using RUSTFLAGS.

This can be done using the rustflags key of the cargo config[3], IIUC,
but the tricky bit of the gold linker is that it's not available everywhere.

Any opinion? I'd personally land #20491 and use cargo config for future
default build configuration changes. Maybe the gold linker bits should
be mentioned as a potential opt-in build performance improvement in
CONTRIBUTING.md?

Thanks,

 -- Emilio

[1]: https://github.com/servo/servo/issues/20489
[2]: https://github.com/servo/servo/pull/20491
[3]: https://doc.rust-lang.org/cargo/reference/config.html
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to