svix-bridge: jemalloc cannot be enabled on msvc
Description
git clone https://github.com/svix/svix-webhooks
cd svix-webhooks\bridge
cargo run
produces
Compiling svix-bridge v1.12.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge)
error: jemalloc cannot be enabled on msvc
--> svix-bridge\src\main.rs:33:1
|
33 | compile_error!("jemalloc cannot be enabled on msvc");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `svix-bridge` (bin "svix-bridge") due to previous error
versions
svix-bridge v1.12.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge)
├── svix-bridge-plugin-queue v0.1.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge-plugin-queue)
│ ├── omniqueue v0.1.0 (https://github.com/svix/omniqueue-rs?rev=247904053bcf90cf693df4429092923bf97770eb#24790405)
│ ├── svix-bridge-types v0.1.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge-types)
│ │ ├── svix v0.85.1
├── svix-bridge-types v0.1.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge-types) (*)
├── svix-ksuid v0.7.0
svix-bridge-plugin-queue v0.1.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge-plugin-queue) (*)
svix-bridge-types v0.1.0 (C:\working\rust\svix-webhooks\bridge\svix-bridge-types) (*)
Platform
windows 10 64bit
@davehorner Thanks for this report.
It's true that jemalloc is on by default, and won't work with the standard Windows toolchain.
I think we can make it more automatic, but for a workaround you should be able to build/run by passing --no-default-features --features gcp-pubsub,rabbitmq,redis,sqs to cargo.
That does indeed produce a binary, thank you very much for the quick response @svix-onelson!
To refine the definition of done beyond the initial report, we'll have the same exact issue in svix-server since both of these binaries use the same tactic to configure jemalloc by default.
There are a couple of approaches I can think of off the top of my head to smooth this out so Windows builds "just work" by default, so I'll plan to try them out and pick whichever feels best -- likely next week.
Some notes for @svix-aaron1011 from our planning today:
- might be necessary to have a crate that bundles up the jemalloc deps, which can always safely be added to the default features list.
- the crate can simply re-export the 2 deps entirely since this only serves to fix the "default features" problem.
cfgcan be used in dependents to avoid using/accessing modules and types only exported for non-mvsc. - extra detail this crate will need to be used in bridge and server (both) so it makes sense to add it at the top-level of the repo, or in a separate repo.
This ticket is still open; let me know if I can help move it forward, I'm still using feature flags to get around this.