diff --git a/.cargo/ci-config.toml b/.cargo/ci-config.toml index b31b79a59b2..6a5feece648 100644 --- a/.cargo/ci-config.toml +++ b/.cargo/ci-config.toml @@ -15,14 +15,4 @@ rustflags = ["-D", "warnings"] [profile.dev] debug = "limited" -# Use Mold on Linux, because it's faster than GNU ld and LLD. -# -# We no longer set this in the default `config.toml` so that developers can opt in to Wild, which -# is faster than Mold, in their own ~/.cargo/config.toml. -[target.x86_64-unknown-linux-gnu] -linker = "clang" -rustflags = ["-C", "link-arg=-fuse-ld=mold"] -[target.aarch64-unknown-linux-gnu] -linker = "clang" -rustflags = ["-C", "link-arg=-fuse-ld=mold"] diff --git a/.cargo/config.toml b/.cargo/config.toml index 9b2e6f51c96..a9bf1f9cc97 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -16,5 +16,9 @@ rustflags = [ "target-feature=+crt-static", # This fixes the linking issue when compiling livekit on Windows ] +# We need lld to link libwebrtc.a successfully on aarch64-linux +[target.aarch64-unknown-linux-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + [env] MACOSX_DEPLOYMENT_TARGET = "10.15.7" diff --git a/.github/workflows/autofix_pr.yml b/.github/workflows/autofix_pr.yml index 1fa271d168a..1f9e6320700 100644 --- a/.github/workflows/autofix_pr.yml +++ b/.github/workflows/autofix_pr.yml @@ -37,8 +37,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_pnpm diff --git a/.github/workflows/compare_perf.yml b/.github/workflows/compare_perf.yml index f7d78dbbf6a..03113f2aa0b 100644 --- a/.github/workflows/compare_perf.yml +++ b/.github/workflows/compare_perf.yml @@ -30,8 +30,6 @@ jobs: cp ./.cargo/ci-config.toml ./../.cargo/config.toml - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: compare_perf::run_perf::install_hyperfine diff --git a/.github/workflows/deploy_collab.yml b/.github/workflows/deploy_collab.yml index 0d98438c9e3..7fe06460f75 100644 --- a/.github/workflows/deploy_collab.yml +++ b/.github/workflows/deploy_collab.yml @@ -32,8 +32,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::cargo_fmt @@ -65,8 +63,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::cargo_install_nextest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8adad5cfba2..07a0a6d672a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,8 +72,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_node @@ -199,8 +197,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_sccache @@ -318,8 +314,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux @@ -360,8 +354,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 46d8732b08e..093a17e8760 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -122,8 +122,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux @@ -170,8 +168,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux diff --git a/.github/workflows/run_agent_evals.yml b/.github/workflows/run_agent_evals.yml index c506039ce7c..56cbd17a197 100644 --- a/.github/workflows/run_agent_evals.yml +++ b/.github/workflows/run_agent_evals.yml @@ -34,8 +34,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_cargo_config diff --git a/.github/workflows/run_bundling.yml b/.github/workflows/run_bundling.yml index 7cb1665f9d0..5a93cf074e2 100644 --- a/.github/workflows/run_bundling.yml +++ b/.github/workflows/run_bundling.yml @@ -32,8 +32,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux @@ -73,8 +71,6 @@ jobs: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/bundle-linux diff --git a/.github/workflows/run_cron_unit_evals.yml b/.github/workflows/run_cron_unit_evals.yml index 2a204a9d40d..6af46e678d3 100644 --- a/.github/workflows/run_cron_unit_evals.yml +++ b/.github/workflows/run_cron_unit_evals.yml @@ -35,8 +35,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::cargo_install_nextest diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index fed05e00459..fd7fecb4eb0 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -218,8 +218,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_sccache @@ -331,8 +329,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_node @@ -430,8 +426,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_cargo_config @@ -480,8 +474,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::setup_sccache @@ -606,8 +598,6 @@ jobs: jobSummary: false - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: ./script/generate-action-metadata diff --git a/.github/workflows/run_unit_evals.yml b/.github/workflows/run_unit_evals.yml index 2259d2498b7..44f12a1886b 100644 --- a/.github/workflows/run_unit_evals.yml +++ b/.github/workflows/run_unit_evals.yml @@ -38,8 +38,6 @@ jobs: path: ~/.rustup - name: steps::setup_linux run: ./script/linux - - name: steps::install_mold - run: ./script/install-mold - name: steps::download_wasi_sdk run: ./script/download-wasi-sdk - name: steps::cargo_install_nextest diff --git a/Cargo.lock b/Cargo.lock index 83606c7414b..36f5d5d5ab4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9758,7 +9758,7 @@ dependencies = [ [[package]] name = "libwebrtc" version = "0.3.26" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "cxx", "glib", @@ -9856,7 +9856,7 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" [[package]] name = "livekit" version = "0.7.32" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "base64 0.22.1", "bmrng", @@ -9882,7 +9882,7 @@ dependencies = [ [[package]] name = "livekit-api" version = "0.4.14" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "base64 0.21.7", "futures-util", @@ -9909,7 +9909,7 @@ dependencies = [ [[package]] name = "livekit-protocol" version = "0.7.1" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "futures-util", "livekit-runtime", @@ -9925,7 +9925,7 @@ dependencies = [ [[package]] name = "livekit-runtime" version = "0.4.0" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "tokio", "tokio-stream", @@ -19953,7 +19953,7 @@ dependencies = [ [[package]] name = "webrtc-sys" version = "0.3.23" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "cc", "cxx", @@ -19967,7 +19967,7 @@ dependencies = [ [[package]] name = "webrtc-sys-build" version = "0.3.13" -source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=37835f840d0070d45ac8b31cce6a6ae7aca3f459#37835f840d0070d45ac8b31cce6a6ae7aca3f459" +source = "git+https://github.com/zed-industries/livekit-rust-sdks?rev=cf4375b244ebb51702968df7fc36e192d0f45ad5#cf4375b244ebb51702968df7fc36e192d0f45ad5" dependencies = [ "anyhow", "fs2", diff --git a/Cargo.toml b/Cargo.toml index e1f5b4ffeb9..4ce16aa36a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -845,8 +845,8 @@ notify = { git = "https://github.com/zed-industries/notify.git", rev = "ce58c24c notify-types = { git = "https://github.com/zed-industries/notify.git", rev = "ce58c24cad542c28e04ced02e20325a4ec28a31d" } windows-capture = { git = "https://github.com/zed-industries/windows-capture.git", rev = "f0d6c1b6691db75461b732f6d5ff56eed002eeb9" } calloop = { git = "https://github.com/zed-industries/calloop" } -livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "37835f840d0070d45ac8b31cce6a6ae7aca3f459" } -libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "37835f840d0070d45ac8b31cce6a6ae7aca3f459" } +livekit = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "cf4375b244ebb51702968df7fc36e192d0f45ad5" } +libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "cf4375b244ebb51702968df7fc36e192d0f45ad5" } [profile.dev] split-debuginfo = "unpacked" diff --git a/script/bundle-linux b/script/bundle-linux index c89d21082dd..3487feaf32b 100755 --- a/script/bundle-linux +++ b/script/bundle-linux @@ -74,7 +74,15 @@ fi export CC=${CC:-$(which clang)} # Build binary in release mode -export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib" +# We need lld to link libwebrtc.a successfully on aarch64-linux. +# NOTE: Since RUSTFLAGS env var overrides all .cargo/config.toml rustflags +# (see https://github.com/rust-lang/cargo/issues/5376), the +# [target.aarch64-unknown-linux-gnu] section in config.toml has no effect here. +if [[ "$(uname -m)" == "aarch64" ]]; then + export RUSTFLAGS="${RUSTFLAGS:-} -C link-arg=-fuse-ld=lld -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib" +else + export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib" +fi cargo build --release --target "${target_triple}" --package zed --package cli # Build remote_server in separate invocation to prevent feature unification from other crates # from influencing dynamic libraries required by it. @@ -111,10 +119,12 @@ else fi fi -# Strip debug symbols and save them for upload to DigitalOcean -objcopy --strip-debug "${target_dir}/${target_triple}/release/zed" -objcopy --strip-debug "${target_dir}/${target_triple}/release/cli" -objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server" +# Strip debug symbols and save them for upload to DigitalOcean. +# We use llvm-objcopy because GNU objcopy on older distros (e.g. Ubuntu 20.04) +# doesn't understand CREL sections produced by newer LLVM. +llvm-objcopy --strip-debug "${target_dir}/${target_triple}/release/zed" +llvm-objcopy --strip-debug "${target_dir}/${target_triple}/release/cli" +llvm-objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server" # Ensure that remote_server does not depend on libssl nor libcrypto, as we got rid of these deps. if ldd "${target_dir}/${remote_server_triple}/release/remote_server" | grep -q 'libcrypto\|libssl'; then diff --git a/script/linux b/script/linux index c7922355342..808841aeb39 100755 --- a/script/linux +++ b/script/linux @@ -39,6 +39,8 @@ if [[ -n $apt ]]; then make cmake clang + lld + llvm jq git curl diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index fbe7ef66a33..27d3819ec72 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -262,18 +262,12 @@ pub fn setup_linux() -> Step { named::bash("./script/linux") } -fn install_mold() -> Step { - named::bash("./script/install-mold") -} - fn download_wasi_sdk() -> Step { named::bash("./script/download-wasi-sdk") } pub(crate) fn install_linux_dependencies(job: Job) -> Job { - job.add_step(setup_linux()) - .add_step(install_mold()) - .add_step(download_wasi_sdk()) + job.add_step(setup_linux()).add_step(download_wasi_sdk()) } pub fn script(name: &str) -> Step {