Closed Sgoettschkes closed 2 years ago
The test project with only meeseeks as a dependency works on my old macbook, but not on the new one with an m1 processor, so this might be the issue. Again, without Rust/NIF knowledge, I'm not sure how to solve this.
Thanks for the report.
I don't have access to an M1 so testing is going to be a little tricky for me, but let's see what we can figure out.
There are a number of issues around that document linker issues when compiling Rust related things for both Mac in general and M1 in particular.
The Rustler library has issues/PRs (https://github.com/rusterlium/rustler/issues/151, https://github.com/rusterlium/rustler/pull/174, https://github.com/rusterlium/rustler/pull/191) relating to a similar set of linker errors, but for the x86_64-apple-darwin
target.
Meeseeks_Html5ever has a .cargo/config
file discussed in the issues above, but it only applies to the x86 target.
A different issue (https://github.com/PyO3/pyo3/issues/1330#issuecomment-748621681) suggests that a problem similar to yours can be resolved by adding an additional target to our .cargo/config
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
Do you think you would be able to clone MeeseeksHtml5ever locally, attempt to run tests (mix test
) to confirm the compilation error exists, attempt that fix, and run tests again to see if the problem is resolved?
Thanks @mischov for the detailed explanation and attempt at solving my problem.
I'll try the steps you suggested (running the MeeseeksHtml5ever tests locally before and after the fix suggested around the cargo config) and report back!
@mischov Running mix.test
without any changes in the MeeseeksHtml5ever project produced the same error as above.
Applying the fix suggested in https://github.com/PyO3/pyo3/issues/1330#issuecomment-748621681 and running mix test
again solved the issue!
Changing the .cargo/config
to the following should do the trick (with the correct config for x86_64 as well as aarch64):
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
With this config I was able to run mix test
again after deleting the _build
folder. I'm not a rust developer, so I'm not sure if there are any side effects to this change. I can test with an x86_64 apple and this patch applied if you like!
I'm happy to do a PR if you think it's ready and I'm also ok with you committing this yourself.
Yes, please test on x86 as well, but I don't believe there should be any side effects.
And yes, please do make a PR.
Issue is resolved with PR #47
Fix is released as of meeseeks_html5ever v0.13.1
and meeseeks v0.16.1
.
Thank you again, @Sgoettschkes.
I'm trying to get meeseeks to run within my project, but meeseeks_html5ever does not compile. I'm seeing the following output to
deps.compile
(trimmed for readability):I have installed rust using
brew install rust
and rust is available:I'm pretty sure I'm missing something, but I've never worked with Rust or NIFs so I can't really debug the issue.