Skip to content

Revisit LTO for ppc64le binaries #5986

Open
@zanieb

Description

@zanieb

In #5904, LTO was added to our release profile. However, in #5984, this failed for just the ppc64le musl cross build (which uses the nightly toolchain):

error: failed to get bitcode from object file for LTO (could not find requested section)

error: could not compile `uv` (bin "uv") due to 1 previous error
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit status: 101": `env -u CARGO "cargo" "rustc" "--features" "self-update" "--target" "powerpc64le-unknown-linux-musl" "--message-format" "json-render-diagnostics" "--locked" "--manifest-path" "/home/runner/work/uv/uv/crates/uv/Cargo.toml" "--release" "--bin" "uv" "--" "-C" "link-arg=-s"`

I unsuccessfully tried using -Cembed-bitcode=yes (rust-osdev/cargo-xbuild#73) to workaround this, before creating a separate release profile (release-no-lto) with LTO disabled and using it for just this build (f0ffda4).

I'm not anywhere near an expert at Rust compilation options. Someone else should validate this approach and explore alternatives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasesRelated to building and distributing release artifacts of uv

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions