Skip to content

AUR: makepkg !lto does not disable Rust ThinLTO inherited from Cargo.toml #2813

Open

Description

@rwarmstr

Split from #2811 at the triage bot's request. This ticket covers only the downstream AUR packaging behavior; #2811 tracks documentation of the rustc/LLVM SIGILL configuration.

Problem

In AUR lightcraft 0.13.0-1 (packaging commit 71da1d7), _srcenv() contains:

if check_option lto y; then
    export CARGO_PROFILE_RELEASE_LTO=thin
    export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
fi

Upstream Cargo.toml already sets lto = "thin" in [profile.release]. With makepkg's !lto option, the conditional is skipped, but Cargo falls back to the upstream ThinLTO setting. The intended opt-out therefore does not disable Rust LTO. This follows the AUR change faed654 (0.11.0-2), whose stated intent was to follow makepkg options.

Expected behavior / proposed downstream fix

When makepkg selects !lto, explicitly disable Rust LTO:

if check_option lto y; then
    export CARGO_PROFILE_RELEASE_LTO=thin
    export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
else
    export CARGO_PROFILE_RELEASE_LTO=off
fi

Setting off is deliberate: Cargo's false value may still allow local ThinLTO across codegen units, whereas off disables LTO entirely. Validation should check that the effective rustc invocation has LTO disabled when !lto is selected and still uses ThinLTO when lto is selected.

Evidence / scope

Explicitly setting CARGO_PROFILE_RELEASE_LTO=off inside _srcenv() allowed both 0.7.1-1 and 0.13.0-1 to build successfully on the affected system, and both rebuilt CLIs ran. This is a workaround verification, not a test of the exact conditional patch above.

Related #1196 concerns OOM on low-memory builders and was closed after README documentation landed in #1667; the maintainer comment there explicitly leaves PKGBUILD changes to the AUR package. The same need for an effective LTO opt-out applies here, but the SIGILL in #2811 is a different observed failure mode. This ticket is for downstream AUR coordination; no change to the upstream default release profile is requested.

Activity

  1. ticket-craft commented on Oct 24, 2026

    @ticket-craft

    Possibly related: #2811 and #1196.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions