Skip to content
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

Rakudo loading incorrect shared library file on Linux. #2769

Garland-g opened this issue Mar 17, 2019 · 1 comment


None yet
2 participants
Copy link

commented Mar 17, 2019

The Problem

I'm attempting to load my Libui module from a local folder for testing the next version on a Linux machine.

Expected Behavior

I expect perl6 to load .so files on Linux.
On Rakudo 2018.12, this works fine.

Actual Behavior

perl6 is attempting to load a .dylib file as a .so file on Linux on one computer and a .dll on another.
On Rakudo 2019.03 and master (2019.03-40-g4ffb4082b), I get
Cannot locate native library '~/Libui/resources/libraries/libui.dylib': ~/Libui/resources/libraries/libui.dylib: invalid ELF header

Steps to Reproduce

zef install Libui
cd ~/.zef/store/Libui-0.0.1.tar.gz/Libui-0.0.1/
perl6 -Ilib t/00-basics.t

I tested this on an arch linux install that had never had rakudo installed on it, installed latest zef, and got the same error, but with the dll file instead.


Arch Linux, kernel 5.0.2
perl6 2019.03
Resources folder:

└── libraries
    ├── libui.dylib
    └── ui.dll

This comment has been minimized.

Copy link

commented Mar 17, 2019

If you are using resources/libraries/ then you cannot include two files that would break down to the same pre-platform-name. For example:

# osx
$ perl6 -e 'say $*VM.platform-library-name("ui".IO)'
# linux
$ perl6 -e 'say $*VM.platform-library-name("ui".IO)'
# windows
$ perl6 -e 'say $*VM.platform-library-name("ui".IO)'

The purpose of libraries/ is that you would include JUST libraries/ui and then build ONLY the library for the appropriate system. Then %?RESOURCES<libraries/ui> will be pointing to whatever system name. If you otherwise wish to install the useless files then you'll have to move the files out of the libraries folder since their pre-platform-names all clash (ui).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.