diff --git a/.cargo/config.toml b/.cargo/config.toml index 32f830df0..4c1d72421 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -11,7 +11,38 @@ rustflags = ["-Ctarget-cpu=apple-m1"] [target.x86_64-pc-windows-msvc] # FORCE:MULTIPLE is a bit sketchy. v8 and rocksdb both export the same symbol. # This seems to work around it to build on windows, but it's not ideal. -rustflags = ["-Clink-arg=/FORCE:MULTIPLE", "-Clink-arg=/STACK:4194304"] +rustflags = [ + "-Clink-arg=/FORCE:MULTIPLE", + "-Clink-arg=/STACK:4194304", + "-Ctarget-feature=+crt-static", + "-Clink-arg=/DEFAULTLIB:libcmt", + "-Clink-arg=/DEFAULTLIB:libvcruntime", + "-Clink-arg=/DEFAULTLIB:libucrt", + "-Clink-arg=/NODEFAULTLIB:msvcrt", # dynamic C runtime + "-Clink-arg=/NODEFAULTLIB:msvcprt", # dynamic C++ runtime + "-Clink-arg=/NODEFAULTLIB:msvcrtd", # dynamic debug C runtime + "-Clink-arg=/NODEFAULTLIB:msvcprtd", # dynamic debug C++ runtime + "-Zpanic-abort-tests" +] + +[target.x86_64-pc-windows-msvc.env] +ROCKSDB_STATIC_LIB = "1" +VCPKG_ALL_STATIC = "1" +VCPKGRS_DYNAMIC = "0" +RUSTFLAGS = "-Ctarget-feature=+crt-static" +# For native-tls +OPENSSL_STATIC = "1" +OPENSSL_NO_VENDOR = "0" +# For any dependencies using cmake +CMAKE_STATIC_VCRT = "True" +# For any dependencies using pkg-config +PKG_CONFIG_ALL_STATIC = "1" +LIBROCKSDB_STATIC = "1" +ROCKSDB_LIB_DIR = "" +SODIUM_STATIC = "1" +SODIUM_LIB_DIR = "" +RUSTY_V8_MIRROR = "https://github.com/denoland/rusty_v8/releases/download" +V8_STATIC = "1" [target.'cfg(all())'] rustflags = ["--cfg", "tokio_unstable"] diff --git a/.github/workflows/precompile.yml b/.github/workflows/precompile.yml index a7f2958de..4e9abdf4c 100644 --- a/.github/workflows/precompile.yml +++ b/.github/workflows/precompile.yml @@ -60,7 +60,6 @@ jobs: - name: Install JS run: | just rush install - just rush build - name: Precompute release name id: release_name @@ -79,7 +78,7 @@ jobs: unset ROCKSDB_LIB_DIR unset SODIUM_USE_PKG_CONFIG unset SNAPPY_LIB_DIR - cargo build --release -p local_backend --bin convex-local-backend + RUSTFLAGS="-Clink-arg=/VERBOSE" cargo build -vv --release -p local_backend --bin convex-local-backend mv target/release/${{ steps.release_name.outputs.BINARY_NAME }} . - name: Zip backend into arch