Closed thombles closed 4 years ago
I think the default MAX_THREADS value is way too high on 32-bit platforms — it is currently half of the 64-bit MAX_THREADS. On 64-bit targets, MAX_THREADS is 4096 (12 bits), and on 32-bit, it's 2048 (11 bits). It should be half as many bits, not half as high a number
Also both of those values should be one less, since 0 is a valid thread ID.
@thombles I think the reason that this crate builds for you but tracing-subscriber
(which depends on it) does not is that building the lib never actually evaluated the default config. I think that trying to build this crate's tests for a 32-bit target should fail?
Can I get you to do the following:
cargo build --test
for a 32-bit target, and confirm that it failsThanks! I don't currently have a 32-bit toolchain installed, so I figured I'd ask you to check it out.
Using the eliza/fix-max-threads-bits
branch of sharded-slab
I can successfully build both this crate, and tracing-subscriber
, using the i686-linux-android
target. 🎉
In terms of your specific instructions it's a bit more complicated.
Can I get you to do the following:
- try to
cargo build --test
for a 32-bit target, and confirm that it fails
It does fail, but not for the same reason - the loom
dev dependency pulls in generator
which currently only supports a handful of 64-bit architectures with its assembly.
- check out this branch
- try building the tests for a 32-bit target again and let me know if that branch fixes it?
It doesn't help with the generator issue of course. But it has solved my actual problem!
tracing: 6d8b995c99f1d7b8758da687e5b7df25456f9559 This commit has
tracing-subscriber
depending onsharded-slab
0.0.6When building
tracing-subscriber
for a 32 bit target, e.g.cargo build --target i686-linux-android
, this results in build errors insharded-slab
code.