Attempting to compile a rust program for usage on Mac. Configured Github Action as follows:
build_macos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install required tools
run: sudo apt install libdbus-1-dev pkg-config libudev-dev libglfw3-dev libglew-dev
- name: Install required target
run: rustup target add aarch64-apple-darwin
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Build Release
run: cargo build --verbose --release --target=aarch64-apple-darwin
- name: Artifact MacOS
uses: actions/upload-artifact@v3
with:
name: Build MacOS
path: ./target/aarch64-apple-darwin/release/control_harts
retention-days: 5
which fails on Build Release
Image
Investigating the log further points me to the following (full log):
= note: cc: error: unrecognized command-line option '-arch'
cc: error: unrecognized command-line option '-framework'
cc: error: unrecognized command-line option '-framework'
What would be the best way to solve this? If any further information is required, please let me know.
P.S. the program uses quite some libraries, but it does not appear to fail when compiling those, but only on the project itself. This makes me believe it maybe a configuration error on my end, but I cannot seem to figure that out.
P.P.S. the windows and linux tasks pass and produce a functioning executable, with all tests passing.
P.P.P.S. If it is preferable that I make a minimal piece of code or a repo that runs into this issue I could, but I am hoping the issue is just a simple oversight.
I was expecting a MacOS executable to pop out like the files for windows and linux do, but unfortunately the task runs into this error.
I tried looking for existing solutions for this problem, and I found:
(1, 2, 3 found after searching for the first line (-arch
), 4 and 5 for the second line (-framework
))
- 1. -> I cannot seem to configure these flags myself, as (from my very limited understanding) they are either part of the packages' build scripts or generated by rustc.
- 2. -> Unsolved github issue
- 3. -> Potentially solved github issue but it seems this is just part of the build script of that lib
- 4. -> Requires access to the MakeFile, which I may have but I cannot seem to figure out where it is.
- 5. -> for GoLang, and also without solution.