Build Jemalloc successfully on musl
Builds on Alpine were failing with error:
/builds/jemalloc-test/target/debug/build/jemalloc-sys-1388223c068e2c9f/out/build/../jemalloc/src/jemalloc.c:700: undefined reference to `secure_getenv'
collect2: error: ld returned 1 exit status
This was due to all stable Rust versions bundling musl 1.1.22 or earlier, while Alpine 3.12 is on musl 1.1.24. The latter version includes the non-standard GNU secure_getenv function, but the bundled Rust version does not.
Jemalloc's configure script would find that the system libc contained the secure_getenv symbol and build with that function enabled, but linking with the Rust library would fail.
This commit changes the following:
- Enable Jemalloc for
musltargets - Switch to the nightly compiler to ensure matching
muslversions are used - Specify exact Rust and Alpine versions in Docker image, to ensure no breaking changes occur unexpectedly
Edited by Will Chandler (ex-GitLab)