Closed BrianHicks closed 1 year ago
ok, cool cool, it fails in the same way as before still:
/home/runner/work/rbt/rbt/target/debug/deps/host-181c6daa729e8b6f: error while loading shared libraries: ./libapp.so: ELF file's phentsize not the expected size
Let me try and take a look at this later today. Hopefully I can repro locally and debug.
thank you!
Ok, So I think I have an idea about what is happening. We generate the dummy shared library. It is not a fully valid shared library, but is defined enough to enable platforms to link against it. That is working as expected. That is why roc build examples/hello/rbt.roc
works. When running cargo test
, the test executable tries to open the shared library. That doesn't work because the shared library isn't defined enoguh to be open-able. So even though cargo test
will never call a function in the shared library, it still is opening it and causing the error above. I guess we need to expanded our minimal shared library to be able to load even if it just contains functions stubs that won't work if called.
ah, that makes sense! I wonder if there's any way around it for now… especially since it's only happening on Linux. It seems like doing roc run
would make a libapp.so
that would still work, right?
That would generate the same broken libapp.so
. Theoretically roc build --lib
generates a fully working shared library, so may that could be used.
hmm, looks like roc build --lib examples/hello/rbt.roc
makes examples/hello/build.dylib
. If I rename that to libapp.so
(because why not, I'm throwing Hail Marys over here) it fails and has some… interesting complaints. Any ideas for getting to the .so
file form the .dylib
file?
Assuming this works correctly: https://github.com/roc-lang/roc/pull/4628
I believe it should fix your issue once it is submitted.
fantastic!
This re-enables Linux in CI, which may reproduce the "phentsize is too big" bug.
@bhansconnect I'm actually really not sure how to minimize this example. Do you have any ideas how we could do that to narrow down what's causing this bug? (Assuming this PR fails, of course.)