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

Add build installation option #3217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nirvdrum
Copy link
Collaborator

I'm looking to add the ability to build TruffleRuby from source with a custom ruby-build definition. To make that simpler, I've added a new --install option to jt build. Normally, if jt build detects a standard rbenv or chruby installation directory it establishes a symlink to the latest build there. The symlink approach doesn't work well for ruby-build since it does all of its compilation in a temporary directory. The newly added --install directs jt build to install the final artifact at the specified directory rather than establish a symlink.

It is possible to achieve what I'm looking for without adding the new option. E.g., the truffleruby-dev-builder builds releases without jt build. But, this --install option makes things a lot simpler in my opinion.

I chose the name --install to match the convention of having a make task named install. I could rename it to --prefix if preferred since that's the term often used to specify the make install target. As an another option, we could use the existing --name option and if the name looks like a path use that to trigger a move rather than symlink. If we want to do something like that to reduce the number of options that's fine.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 16, 2023
@nirvdrum nirvdrum added shopify tooling and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Aug 16, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 17, 2023
@eregon
Copy link
Member

eregon commented Aug 18, 2023

I think that should be done manually, like:

jt --env ENV build
graalvm=$(jt mx --env ENV graalvm-home)
mv "$graalvm" DEST

Mostly because the graalvm layout is soon to be deprecated with unchained, and so using mx standalone-home --type=jvm|native ruby will be preferred. It's also a much smaller build for both native and jvm than the whole GraalVM.
With #3218 the JVM standalones are also built for all jvm* env files by default.
So basically from the upcoming release the graalvm layout will be deprecated and we'll use jvm/native standalones for everything (gates are not migrated yet though).

I was thinking the mv of the graalvm-home/standalone-home might cause issues with mx, but that seems to work fine, i.e. jt build after the mv does recreate the graalvm/standalone.

It's fine to add an option or env var to disable the symlinking behavior into Ruby switcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement. shopify tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants