-
I have a PyO3/maturin project that compiles, installs, and runs great on my Mac. I'm having trouble getting CI for it working with GitHub Actions. The
I include the I'm hoping someone can tell more from this message than I can and can point me in a fruitful direction. Unfortunately the repo is private so I can't share it here. I've minimized the GitHub workflow down to this. If I can get it to build in the CI environment I can attack other formats after. But essentially the target production environment is the same as this CI environment: name: ci
on:
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
# -- checkout the repository --
- name: Checkout code
uses: actions/checkout@v4
# - set up Python environment --
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
# -- Create virtual environment --
- name: Create virtual environment
run: python -m venv .venv
# -- Install Python dependencies (maturin and pytest) --
- name: Install Python dependencies
run: |
source .venv/bin/activate
pip install maturin pytest
# -- Build and install python-ppt --
- name: Build and install Python extension
run: |
source .venv/bin/activate
maturin build -vv --release -m abc_py/Cargo.toml I've tried quite a few things, including using the I've tried the auto-generated CI script and some platforms hit this error (in particular linux x86_64 which is the one I need), and others don't. I've tried From my research it appears that Please ask if you need any further information and I'll be happy to provide it. I'm very grateful for any direction you can provide as to how to understand what's happening and what direction to pursue to resolve it :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Okay, I appear to have figured this out. Here are the high-points:
export LD_LIBRARY_PATH+=":$(rustc --print=sysroot)/lib" I'm not sure why this is required and whether it is a bug or not, I assume it is not intended to be necessary because it is not part of the generated CI script and that script fails without this. Nor is it mentioned in any of the materials I've come across (and I've come across quite a few over the last day or so :). I'll mention it in an issue in case it's something that needs fixing. |
Beta Was this translation helpful? Give feedback.
-
@messense that was a very helpful pointer! I had this in # enable x86 optimizations V3
[target.x86_64-unknown-linux-gnu]
rustflags = "-C target-cpu=x86-64-v3 -C prefer-dynamic" I got it from this repository that I had taken as something of an example: https://github.com/insight-platform/savant-rs/blob/main/.cargo/config.toml. I'm not sure why they would have that setting but I'm glad to know a little more about the difference now as I collect the puzzle pieces for my own mental model :) In any case, when I comment that out I don't need the Thanks for your help with this! I hope this discussion helps someone else who comes across the same problem later :) |
Beta Was this translation helpful? Give feedback.
@messense that was a very helpful pointer! I had this in
.cargo/config.toml
that I had copied fairly blindly somewhere along the (long) try-this/try-that journey:I got it from this repository that I had taken as something of an example: https://github.com/insight-platform/savant-rs/blob/main/.cargo/config.toml. I'm not sure why they would have that setting but I'm glad to know a little more about the difference now as I collect the puzzle pieces for my own mental model :)
In any case, when I comment that out I don't need the
LD_LIBRARY_PATH
line, so I expect that was at…