maturin-action: Suggested fix for libatomic bug on i686 ?

edit - this issue will be fixed by #330 if you need a temporary fix, change the action source to

  • PyO3/maturin-action@refs/pull/330/head
    • or the commit ref PyO3/maturin-action@711bb9fcefaea0b45a7d625ee2c265fd9fe7f3e5
  • or fork it and use your own branch e.g. yourusername/maturin-action@main

Hi, I see there is a known bug upstream with libatomic on i686 (32 bit) Linux

It shows up in maturin-action if I am not mistaken, e.g. this run just broke after an identical run working (then broke when I merged it!)

Run PyO3/maturin-action@v1
Found maturin version requirement maturin>=1.8,<2.0 specified in pyproject.toml
Found maturin release from manifest: v1.8.2
Pull Docker image
Cleanup build scripts artifact directory
/usr/bin/docker run --rm --workdir /home/runner/work/comrak/comrak -e DEBIAN_FRONTEND=noninteractive -e ARCHFLAGS -e _PYTHON_SYSCONFIGDATA_NAME -e GITHUB_ACTIONS -e ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_REPOSITORY_OWNER_ID -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_REPOSITORY_ID -e GITHUB_ACTOR_ID -e GITHUB_ACTOR -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e GITHUB_STATE -e GITHUB_OUTPUT -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e ACTIONS_RESULTS_URL -e ACTIONS_CACHE_SERVICE_V2 -e CARGO_INCREMENTAL -e CARGO_TERM_COLOR -e SCCACHE_GHA_ENABLED -e RUSTC_WRAPPER -v /home/runner/work/_temp/run-maturin-action.sh:/home/runner/work/_temp/run-maturin-action.sh -v /home/runner/work/comrak/comrak:/home/runner/work/comrak/comrak quay.io/pypa/manylinux2014_i686:latest /home/runner/work/_temp/run-maturin-action.sh
Install Rust
  info: downloading installer
  warn: Not enforcing strong cipher suites for TLS, this is potentially less secure
  /tmp/tmp.Q2ofH994Lw/rustup-init: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
  Error: The process '/usr/bin/docker' failed with exit code 1
      at ExecState._setResult (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1702:25)
  Error: The process '/usr/bin/docker' failed with exit code 1
      at ExecState.CheckComplete (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1685:18)
      at ChildProcess.<anonymous> (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1579:27)
      at ChildProcess.emit (node:events:519:28)
      at maybeClose (node:internal/child_process:1105:16)
      at ChildProcess._handle.onexit (node:internal/child_process:305:5)

I tried fixing via the before-script-linux param of the maturin-action config but of course that occurs after the maturin-action setup so is too late to heal the build.

Is there a recommended fix for this? I will try to fix it myself but opening this issue in case others experiencing the same problem

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15

Commits related to this issue

Most upvoted comments

  • This issue will be fixed by #330

Glad to hear it ! šŸ‘ šŸŽ‰ Mission accomplished āœ…

I just edited the JS manually haha, never looked in the internals of Actions before! šŸ˜…

Build healed for me by cutting out the libatomic group (from the block it’s in with the ā€œInstall Rust targetā€ group) and putting it ahead of the ā€œInstall Rustā€ group like this:

    const commands = [
        '#!/bin/bash',
        'set -euo pipefail',
    ];
    if (target.length > 0) {
        if (target.includes('linux') && target.includes('i686')) {
            commands.push('echo "::group::Install libatomic"', 'if command -v yum &> /dev/null; then yum install -y libatomic libatomic.i686; else apt-get update && apt-get install -y libatomic1; fi', 'echo "::endgroup::"');
        }
    }
    commands.push(
        'echo "::group::Install Rust"',
...

I put both the libatomic and libatomic.i686 libs in, did not experiment with either or

I think that’s the cause, from my logs the last group to run is ā€œInstall Rustā€ which is on line 637

https://github.com/PyO3/maturin-action/blob/49453e0a6599125b2698abe070e181399fbcc9ab/src/index.ts#L637-L644

whereas the fix was put in on line 671, hence the fix comes too late, and the crash occurs

Install Rust
  info: downloading installer
  warn: Not enforcing strong cipher suites for TLS, this is potentially less secure
  /tmp/tmp.ytqEUvlNds/rustup-init: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
  Error: The process '/usr/bin/docker' failed with exit code 1
      at ExecState._setResult (/home/runner/work/_actions/PyO3/maturin-action/v1.47.1/dist/index.js:1702:25)
      at ExecState.CheckComplete (/home/runner/work/_actions/PyO3/maturin-action/v1.47.1/dist/index.js:1685:18)
      at ChildProcess.<anonymous> (/home/runner/work/_actions/PyO3/maturin-action/v1.47.1/dist/index.js:1579:27)
      at ChildProcess.emit (node:events:519:28)
      at maybeClose (node:internal/child_process:1105:16)
      at ChildProcess._handle.onexit (node:internal/child_process:305:5)
  Error: The process '/usr/bin/docker' failed with exit code 1

Also I suspect my debugging wasn’t working because there is src and dist both with a copy of index.ts and I expect only the dist is used for actions lol… so not a caching bug just my mistake 🤦

Looks like here’s a potential fix: https://github.com/DataDog/dd-trace-py/pull/12599 yum install -y libatomic.i686

Ah, I see it has been patched but it is not capturing the failure point in my CI

    if (target.includes('linux') && target.includes('i686')) {
      commands.push(
        'echo "::group::Install libatomic"',
        'if command -v yum &> /dev/null; then yum install -y libatomic; else apt-get update && apt-get install -y libatomic1; fi',
        'echo "::endgroup::"'
      )
    }

https://github.com/PyO3/maturin-action/blame/49453e0a6599125b2698abe070e181399fbcc9ab/src/index.ts#L668-L674

My i686 is labelled x86 (I believe this was generated by cibuildwheel not my own choice?)

Edit: I tried renaming to i686 and of course the condition is that it must contain both ā€œlinuxā€ and ā€œi686ā€ i.e. the target must be given as i686-unknown-linux-gnu and then that seems to fix it (but this is a bug I think, as x86 resolves to that string, so the check should be against the resolved target value to continue to allow shortnames)

Edit: nope that still didn’t work, I am at a loss how to fix this now