Skip to content

ci: Add macos runner #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2022
Merged

ci: Add macos runner #401

merged 1 commit into from
Mar 18, 2022

Conversation

evnu
Copy link
Member

@evnu evnu commented Nov 3, 2021

Add a CI runner for macOS. On macos, we need to run rustc separately for each target in the Cargo.toml. The reason is that we currently pass extra linker arguments to rustc. This is not possible if multiple targets need to be build.

@evnu
Copy link
Member Author

evnu commented Nov 3, 2021

Compilation on macOS currently fails for the tests, as we pass extra arguments:

error: extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing, e.g., `--lib` or `--bin NAME` to specify a single target

== Compilation error in file lib/rustler_test.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.22.2) lib/rustler/compiler.ex:36: Rustler.Compiler.compile_crate/2
    lib/rustler_test.ex:6: (module)
    (stdlib 3.16.1) erl_eval.erl:685: :erl_eval.do_apply/6

For this to work, we need to call cargo build/cargo rustc separately for each target.

@evnu
Copy link
Member Author

evnu commented Nov 4, 2021

Compilation on macOS currently fails for the tests, as we pass extra arguments:

I work around that with 65d4171. For macOS, each target (bin or lib) is compiled separately. This feels kind-of hacky.

@evnu evnu requested a review from a team November 4, 2021 07:40
@evnu
Copy link
Member Author

evnu commented Nov 4, 2021

Maybe someone from @rusterlium/core can give some early feedback here.

@evnu evnu force-pushed the macos-add-runner branch 2 times, most recently from aee3eb7 to ac39ae8 Compare March 15, 2022 16:51
@evnu
Copy link
Member Author

evnu commented Mar 15, 2022

Maybe we can simplify this PR by picking up #235 again: If we do not set the extra linker arguments on macos anymore, we can run cargo build directly and don't need to shell out for each lib/bin.

@evnu evnu force-pushed the macos-add-runner branch from ac39ae8 to 0f32a5d Compare March 16, 2022 07:43
@evnu
Copy link
Member Author

evnu commented Mar 16, 2022

I rebased on #439 to check if the runner works on that branch.

@evnu evnu marked this pull request as ready for review March 16, 2022 07:53
@evnu evnu force-pushed the macos-add-runner branch 5 times, most recently from 2a51b35 to 70c6e62 Compare March 17, 2022 18:15
@evnu evnu force-pushed the macos-add-runner branch from 70c6e62 to b54e77f Compare March 18, 2022 06:42
@evnu evnu removed the request for review from a team March 18, 2022 06:49
@evnu
Copy link
Member Author

evnu commented Mar 18, 2022

As this no longer requires changes to Rustler.Compiler and simply adds a runner, I will merge this.

@evnu evnu merged commit 3cf3620 into rusterlium:master Mar 18, 2022
@evnu evnu deleted the macos-add-runner branch March 18, 2022 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant