svix-webhooks icon indicating copy to clipboard operation
svix-webhooks copied to clipboard

svix-bridge: jemalloc cannot be enabled on msvc

Open davehorner opened this issue 2 years ago • 5 comments

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 avatar Sep 27 '23 02:09 davehorner

@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.

svix-onelson avatar Sep 27 '23 02:09 svix-onelson

That does indeed produce a binary, thank you very much for the quick response @svix-onelson!

davehorner avatar Sep 27 '23 02:09 davehorner

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.

svix-onelson avatar Sep 27 '23 18:09 svix-onelson

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. cfg can 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.

svix-onelson avatar Oct 10 '23 16:10 svix-onelson

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.

davehorner avatar Feb 17 '24 14:02 davehorner