roc-lang / rbt

Roc Build Tool
Universal Permissive License v1.0
49 stars 5 forks source link

re-enable linux in CI #88

Closed BrianHicks closed 1 year ago

BrianHicks commented 1 year ago

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.)

BrianHicks commented 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
bhansconnect commented 1 year ago

Let me try and take a look at this later today. Hopefully I can repro locally and debug.

BrianHicks commented 1 year ago

thank you!

bhansconnect commented 1 year ago

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.

BrianHicks commented 1 year ago

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?

bhansconnect commented 1 year ago

That would generate the same broken libapp.so. Theoretically roc build --lib generates a fully working shared library, so may that could be used.

BrianHicks commented 1 year ago

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?

bhansconnect commented 1 year ago

Assuming this works correctly: https://github.com/roc-lang/roc/pull/4628

I believe it should fix your issue once it is submitted.

BrianHicks commented 1 year ago

fantastic!