Skip to content

The Linux desktop build does not compile on main #550

Description

@thcp

What goes wrong

cargo check fails on Linux, on main, today:

error[E0425]: cannot find function `verify_pinned_sha256` in this scope
    --> src/main.rs:3838:9
note: found an item that was configured out
    --> src/main.rs:3914:4
     | #[cfg(target_os = "macos")]

download_linux_ffmpeg verifies the downloaded archive against a pinned SHA256, which is the whole point of #518. The function it calls is gated #[cfg(target_os = "macos")], so on Linux the call refers to something that does not exist.

The Linux release build will fail. It fails after the tag exists, and after the macOS and Windows jobs may already have uploaded their assets, because linux-release.yml is the only thing that compiles this code.

Why nobody saw it

This is #531 happening rather than being predicted. ci.yml runs on every PR and is entirely ubuntu-latest, which makes Linux look covered. It is not: ci.yml never invokes cargo. macos-check.yml and windows-check.yml cover their platforms; nothing covers this one.

#518 was reviewed and merged with the change never having met a compiler. The PR body for #541 said as much and asked reviewers to look here first if the release build failed.

The tests were dark too

The three verify_pinned_sha256 tests are also #[cfg(target_os = "macos")]. Linux depends on that function and never ran a single test against it. On Linux the suite is 63 tests with the gate corrected and 57 with it as it was on Windows, and three of that difference are these.

What a fix has to handle

  • The gate belongs on unix, not macos: both callers are Unix and Windows uses a different path, so widening further would introduce a dead-code warning there
  • The tests should follow the function, or Linux keeps depending on untested code
  • Fixing the gate alone leaves the hole open. Whatever lands next inside a Linux cfg block has the same nothing waiting to catch it, which is ci: nothing compiles the Linux Rust shell until release time #531

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions