tgstation / rust-g

Rust based libraries for tgstation
MIT License
28 stars 100 forks source link

Compiling error reworks. allow 64 with feature, block newer rustc without a feature. #182

Closed MrStonedOne closed 3 months ago

MrStonedOne commented 4 months ago

Adds features that to allow compiling under 64 bit or a rustc version that is too new for windows 7 and 8 (note, the game servers are still windows server 2012, so rustc dropping windows 8 support under 1.76 will also fuck prod.)

Compiling under 64bit is required for OD support and this has turned from an error that was suppose to prevent footguns into an error that is itself a footgun.

ZeWaka commented 4 months ago

While this is good/necessary, we should probably bold / emphasize the bit in the readme even more so less people fall for the issue. The real problem is that it's a silent fail until you use it with DM code.

I don't see an easy way to emit compiler info statements unfortunately. See, this issue which is maybe familiar: https://internals.rust-lang.org/t/pre-rfc-add-compile-warning-macro/9370/8 and https://github.com/rust-lang/rust/issues/54140

Cyberboss commented 4 months ago

Is it possible to feature flag gate the error?

ZeWaka commented 4 months ago

Is it possible to feature flag gate the error?

[features]
allow_non_32bit = []
#[cfg(all(not(target_pointer_width = "32"), not(feature = "allow_non_32bit")))]
compile_error!("Compiling for non-32bit is not allowed without enabling the `allow_non_32bit` feature.");
MrStonedOne commented 3 months ago

Added features that block compiling under 64 bit or a rustc version that is too new for windows 7 and 8 (note, the game servers are still windows server 2012, so rustc dropping windows 8 support under 1.76 will also fuck us.

MrStonedOne commented 3 months ago

This will be easier to copy and paste the windows 7 bits into a new webedit then to deal with conflicts, half of which are for lines that will no longer be changed.