Skip to content

STATUS_ENTRYPOINT_NOT_FOUND error with x86_64-pc-windows-gnu on Windows Server 2019 in GitHub action #123999

Closed
@patowen

Description

@patowen

The following GitHub action fails with nightly-2024-02-27 but passes with nightly-2024-02-26 for (I believe) any project with a build.rs file:

name: ci
on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
    - main
  schedule:
  - cron: '00 01 * * *'
jobs:
  build:
    name: build

    env:
      # Emit backtraces on panics.
      RUST_BACKTRACE: 1
      CARGO_INCREMENTAL: 0

    runs-on: windows-2019
    strategy:
      fail-fast: false
      matrix:
        rust_version:
          - nightly-2024-02-26
          - nightly-2024-02-27
          - nightly-2024-02-28

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Install Rust
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.rust_version }}-x86_64-pc-windows-gnu
        target: x86_64-pc-windows-gnu
        profile: minimal
        override: true

    - name: Build
      shell: bash
      run: cargo build --verbose --target x86_64-pc-windows-gnu

The error I got is the following:

Run cargo build --verbose --target x86_64-pc-windows-gnu
   Compiling proc-macro2-testing-for-lavagna v0.1.0 (D:\a\lavagna\lavagna)
     Running `rustc --crate-name build_script_build --edition=2021 build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=b191affa0bd3624f -C extra-filename=-b191affa0bd3624f --out-dir 'D:\a\lavagna\lavagna\target\debug\build\proc-macro2-testing-for-lavagna-b191affa0bd3624f' -L 'dependency=D:\a\lavagna\lavagna\target\debug\deps'`
     Running `D:\a\lavagna\lavagna\target\debug\build\proc-macro2-testing-for-lavagna-b191affa0bd3624f\build-script-build`
error: failed to run custom build command for `proc-macro2-testing-for-lavagna v0.1.0 (D:\a\lavagna\lavagna)`

Caused by:
  process didn't exit successfully: `D:\a\lavagna\lavagna\target\debug\build\proc-macro2-testing-for-lavagna-b191affa0bd3624f\build-script-build` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)
Error: Process completed with exit code 101.

This only affects x86_64-pc-windows-gnu (not MVSC), and switching from windows-2019 to windows-2022 fixes the issue.

I have reproduced the issue in patowen/lavagna#1. I may end up deleting that repo in the future, so for posterity, I've included all the code below:

Example project to reproduce the issue: .github\workflows\ci.yml:

(See above)

src\main.rs:

fn main() {
    println!("Hello world");
}

build.rs:

fn main() {
    println!("I am in a build script.");
}

Cargo.toml:

[package]
name = "github-action-testing-for-lavagna"
version = "0.1.0"
edition = "2021"

The original discovery of this issue is reported in alepez/lavagna#29.

Meta

Running rustc --version --verbose yielded the following for the latest nightly version without the issue:

rustc 1.78.0-nightly (0ecbd0605 2024-02-25)
binary: rustc
commit-hash: 0ecbd0605770f45c9151715e66ba2b3cae367fcb
commit-date: 2024-02-25
host: x86_64-pc-windows-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Running rustc --version --verbose on three versions with the issue (the next nightly version, the latest nightly version, and the current beta) yielded the following:

rustc 1.78.0-nightly (fc3800f65 2024-02-26)
binary: rustc
commit-hash: fc3800f65777a365b5125706d60f97e4d0675efe
commit-date: 2024-02-26
host: x86_64-pc-windows-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
rustc 1.79.0-nightly (ccfcd950b 2024-04-15)
binary: rustc
commit-hash: ccfcd950b333fed046275dd8d54fe736ca498aa7
commit-date: 2024-04-15
host: x86_64-pc-windows-gnu
release: 1.79.0-nightly
LLVM version: 18.1.3
rustc 1.78.0-beta.7 (6fd191292 2024-04-12)
binary: rustc
commit-hash: 6fd1912922a7b468b1875d16571bb7a00d5df93f
commit-date: 2024-04-12
host: x86_64-pc-windows-gnu
release: 1.78.0-beta.7
LLVM version: 18.1.2

This issue is not present in rustc 1.77.2 (the latest stable version).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-windowsOperating system: WindowsO-windows-gnuToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions