mozilla / rust-android-gradle

Apache License 2.0
1.08k stars 70 forks source link

Stop using Python for the linker wrapper #49

Open ncalexan opened 3 years ago

ncalexan commented 3 years ago

While poking around this project for the first time in a long time, I noticed that we require Python. I couldn't remember why, and it turns out we're only invoking Python in the linker wrapper. It seems silly to route through Python for this.

I think that when this was implemented we needed Python to invoke some Android NDK standalone packaging script, so it made some sense to use Python and not fuss with Windows batch files any more than needed. But now, it would be grand to have one fewer major dependency.

ncalexan commented 3 years ago

I see that we actually do use Python to invoke make_standalone_toolchain.py, but only when using old NDKs (by default). Newer NDKs (19+) use prebuilt toolchains. At this point, I doubt anybody is using non-prebuilt toolchains; we should probably deprecate that functionality and simplify our lives.

But this ticket still remains: for folks using prebuilt toolchains, we could avoid requiring Python, which would be pleasant.

dcsommer commented 3 years ago

FWIW, my team is still using older toolchains to support 32-bit devices.

ncalexan commented 3 years ago

FWIW, my team is still using older toolchains to support 32-bit devices.

A useful data point. It's possible Mozilla is -- I've moved on to other projects -- but in any case, there's no rush to remove the standalone toolchain support.

ncalexan commented 2 years ago

Worth noting that we leveraged the existing linker script for #75. Luckily that shouldn't be required for ever -- newer Rust std library versions don't link against -lgcc -- but it does put a floor on supported Rust versions. That is, if we remove the linker script, we can't support NDK 23 for Rust earlier than Rust from June 2021, which looks like Rust 1.53 or 1.54.