From 3c8f60e21a0640c4b90cfb3a229ce37ff000bd2d Mon Sep 17 00:00:00 2001 From: etienne-k <2804556+etienne-k@users.noreply.github.com> Date: Sat, 19 Nov 2022 15:07:55 +0100 Subject: [PATCH] fix(build): never statically link against the C standard library --- .cargo/config.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index b016eca31aec5..4a9d4bd8b37bc 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,9 @@ [alias] xtask = "run --package xtask --" integration-test = "test --features integration --profile integration --workspace --test integration" + +[build] +# By default, on musl linux, statically linked binaries are produced. +# But such binaries do not support loading libraries using `dlopen()` ("libloading" crate), +# which is required for loading treesitter grammars. +rustflags = ["-C", "target-feature=-crt-static"]