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

fix: properly locate OS-installed system Ruby #128

Merged
merged 1 commit into from
May 31, 2024
Merged

Conversation

p0deje
Copy link
Member

@p0deje p0deje commented May 30, 2024

Related to #125

Updates the method for determining the system Ruby path in ruby/private/download.bzl.

  • Replaces the use of repository_ctx.which("ruby") with repository_ctx.execute(["ruby", "-e", "puts RbConfig.ruby"]) to accurately determine the Ruby binary path when using the system Ruby.
  • Implements error handling for the command execution, failing the build with a clear message if the system Ruby path cannot be determined.
  • Maintains the symlink creation logic to link the determined Ruby directory to dist/bin, ensuring compatibility with existing setups.

For more details, open the Copilot Workspace session.

Related to #125

Updates the method for determining the system Ruby path in `ruby/private/download.bzl`.

- Replaces the use of `repository_ctx.which("ruby")` with `repository_ctx.execute(["ruby", "-e", "puts RbConfig.ruby"])` to accurately determine the Ruby binary path when using the system Ruby.
- Implements error handling for the command execution, failing the build with a clear message if the system Ruby path cannot be determined.
- Maintains the symlink creation logic to link the determined Ruby directory to `dist/bin`, ensuring compatibility with existing setups.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/bazel-contrib/rules_ruby/issues/125?shareId=82c03088-9c65-4564-af8b-4c7aec83de72).
@p0deje p0deje changed the title Fix system Ruby symlink to only include Ruby binary fix: allow using OS-installed system Ruby May 30, 2024
@p0deje p0deje changed the title fix: allow using OS-installed system Ruby fix: properly locate OS-installed system Ruby May 30, 2024
@p0deje p0deje requested a review from sushain97 May 30, 2024 18:32
@p0deje p0deje enabled auto-merge (squash) May 30, 2024 18:32
@p0deje p0deje merged commit 51f5051 into main May 31, 2024
37 checks passed
@p0deje p0deje deleted the fix-system-ruby branch May 31, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants