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

Relocatable Rakudo + C based perl6 runner #2693

Merged
merged 36 commits into from Mar 20, 2019

Conversation

Projects
None yet
5 participants
@patzim
Copy link
Contributor

patzim commented Feb 13, 2019

This PR makes rakudo relocatable by default. The old behavior can be reactivated with the --no-relocatable Configure flag.
I also replaced the perl6 and perl6-debug shell runners with a C based runner that links libmoar directly.
I introduced two environment variables PERL6_HOME and NQP_HOME that can be used to set the path perl6 searches for its NQP/Perl6 files. There was some discussion of whether these variables are a good idea the way they are. See here.
I tested this manually on Linux/Moar, Linux/JVM and Windows10.
I still have to do a full spectest (I didn't manage to get it to run yet) and and some performance tests.
This PR is mostly about getting feedback from other devs. I do not expect this PR (and the respective PRs in NQP and Rakudo) to be merged right away.

@ugexe

This comment has been minimized.

Copy link
Member

ugexe commented Feb 13, 2019

Does PERL6_HOME make more sense than RAKUDO_HOME? i.e. does it make sense for anything calling itself perl6 to implement this, or is it specific to rakudo?

@AlexDaniel

This comment has been minimized.

Copy link
Member

AlexDaniel commented Feb 13, 2019

Holy butterflies. This is amazing.

@patzim

This comment has been minimized.

Copy link
Contributor Author

patzim commented Feb 13, 2019

Does PERL6_HOME make more sense than RAKUDO_HOME? i.e. does it make sense for anything calling itself perl6 to implement this, or is it specific to rakudo?

My reasoning for the PERL6_HOME variable name was, that the folder itself is called perl6 and is located in a most obvious place (/usr/share/perl6) and thus already looks like the one place all perl6es install to. Also it might (I'm not sure) make sense for different perl6 implementations to share their CompRepos.
On the other hand this might just end up being a mess once another implementation arises and the two step on their toes in that folder.
Also see this gist for some more ramblings on those environment variables.

@ugexe

This comment has been minimized.

Copy link
Member

ugexe commented Feb 13, 2019

Ah I see. I was thinking it was being used as a prefix for the executable — not as a type of user definable default @INC

@MasterDuke17

This comment has been minimized.

Copy link
Contributor

MasterDuke17 commented Feb 13, 2019

# TODO: Get this from Moar somehow
could this TODO be implemented now?

patzim added some commits Jan 6, 2019

Make the BOOTSTRAP load logic independent of install location.
This makes the --nqp-lib fix in the relocatable runner superfluous.
Replace all remaining references to absolute install paths.
Make them dynamic relative to the executable.
Create working runners in build directory. Generate perl6-debug execu…
…table.

The debug runner fails when starting at the moment though. Not sure what
it is yet.
The previous commit did not manage to fix the executables during build,
because it relied on the binary perl6. That one sadly can't work in a build
environment because the folder structure of PERL6_HOME doesn't match. Thus
we rely on the old .bat runnersin the build dir again.

@patzim patzim force-pushed the patzim:reloc branch from bbef8f3 to 1d53897 Mar 20, 2019

@AlexDaniel AlexDaniel merged commit 7a3f468 into rakudo:master Mar 20, 2019

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@lizmat

This comment has been minimized.

Copy link
Contributor

lizmat commented Mar 20, 2019

After this, MacOS fails to build:

 clang  -install_name @rpath/libmoar.dylib   -fno-omit-frame-pointer -fno-optimize-sibling-calls -O3 -DNDEBUG -Wno-logical-op-parentheses -D_DARWIN_USE_64_BIT_INODE=1  -fno-omit-frame-pointer -fno-optimize-sibling-calls -O3 -DNDEBUG -Wno-logical-op-parentheses -O3 -DNDEBUG  -O3 -DNDEBUG  -lpthread -Wl,-rpath,@executable_path/../lib -I/Users/liz/Github/rakudo.moar/install/include -I/Users/liz/Github/rakudo.moar/install/include/moar \
    -I/Users/liz/Github/rakudo.moar/install/include/libatomic_ops -I/Users/liz/Github/rakudo.moar/install/include/dyncall -I/Users/liz/Github/rakudo.moar/install/include/sha1 -I/Users/liz/Github/rakudo.moar/install/include/tinymt -I/Users/liz/Github/rakudo.moar/install/include/libtommath -I/Users/liz/Github/rakudo.moar/install/include/libuv \
    -L/Users/liz/Github/rakudo.moar/install/lib  -o perl6-mc src/vm/moar/runner/main.c -lmoar 

clang: error: invalid argument '-install_name @rpath/libmoar.dylib' only allowed with '-dynamiclib'

@lizmat

This comment has been minimized.

Copy link
Contributor

lizmat commented Mar 20, 2019

Adding -dynamiclib seems to fix the build, but still anything that uses "make" completely fails, such as "make test" and "make spectest"

@patzim

This comment has been minimized.

Copy link
Contributor Author

patzim commented Mar 20, 2019

I suspect the -dynamiclib thing is a version incompatibility in clang. Hopefully adding it won't break the build on other clang versions. Can you post the error you receive when running make test or so? Also did moar actually build successfully? The compilation of the moar executable and perl6-mc executable should be basically identical.

@lizmat

This comment has been minimized.

Copy link
Contributor

lizmat commented Mar 20, 2019

The "make" failures disappeared after having run "make install" with the -dynamiclib added.

@patzim patzim deleted the patzim:reloc branch Mar 27, 2019

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.