Title: `ruby_library` not using specified SDK version · Issue #148 · bazelruby/rules_ruby · GitHub
Open Graph Title: `ruby_library` not using specified SDK version · Issue #148 · bazelruby/rules_ruby
X Title: `ruby_library` not using specified SDK version · Issue #148 · bazelruby/rules_ruby
Description: We are testing out the flow where the desired version of ruby is not installed on the host. I expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the ruby-build version, which I created a PR here...
Open Graph Description: We are testing out the flow where the desired version of ruby is not installed on the host. I expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the ruby-...
X Description: We are testing out the flow where the desired version of ruby is not installed on the host. I expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the ruby-...
Opengraph URL: https://github.com/bazelruby/rules_ruby/issues/148
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ruby_library` not using specified SDK version","articleBody":"We are testing out the flow where the desired version of ruby is not installed on the host.\r\n\r\nI expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the `ruby-build` version, which I created a [PR](https://github.com/bazelruby/rules_ruby/pull/147) here).\r\n\r\nWith the version specified in WORKSPACE:\r\n```\r\nload(\"@bazelruby_rules_ruby//ruby:deps.bzl\", \"rules_ruby_select_sdk\")\r\nrules_ruby_select_sdk(version = \"2.7.6\")\r\n```\r\n\r\nI can confirm that ruby interpreter that's installed to the `@org_ruby_lang_ruby_toolchain` external repository is the right version:\r\n```\r\n➜ org_ruby_lang_ruby_toolchain build/bin/ruby -v\r\nruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin21]\r\n```\r\n\r\nHowever, running any `ruby_library` target i get this error on my macos:\r\n\r\n`/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': incompatible library version...`\r\n\r\nI think this requires updating the way [the binary wrapper](https://github.com/bazelruby/rules_ruby/blob/master/ruby/private/binary_wrapper.tpl) is implemented, which defaults to the first ruby found in PATH today rather than the version that's specified in the SDK:\r\n\r\n```\r\n#!/usr/bin/env ruby\r\n\r\n...\r\n\r\ndef find_ruby_binary\r\n File.join(\r\n RbConfig::CONFIG['bindir'],\r\n RbConfig::CONFIG['ruby_install_name'],\r\n )\r\nend\r\n```\r\n\r\nIn fact, it looks like there was an intention to substitute `{interpreter}` [here](https://github.com/bazelruby/rules_ruby/blob/cc2f5ce961f7fa34557264dd05c7597e634f31e1/ruby/private/binary.bzl#L68) but the wrapper script template itself does not have a `{interpreter}` placeholder anywhere, which looks like a bug.","author":{"url":"https://github.com/jgao54","@type":"Person","name":"jgao54"},"datePublished":"2023-06-27T01:51:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/148/rules_ruby/issues/148"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1bf0c9e3-cb09-c341-a86b-8bbdf8aea140 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B7C:F5443:5E0C3F7:800B838:6973405F |
| html-safe-nonce | 956d4d460cc4c4ece33feb6bdfb1aed18c2f7ee8ecf8f3634450b7138a15679f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjdDOkY1NDQzOjVFMEMzRjc6ODAwQjgzODo2OTczNDA1RiIsInZpc2l0b3JfaWQiOiI1Njk1Nzg2MTExMzEzNTkyNDE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fd601e5c7411126eca52d491118532ee825a120cf647c5d405356f0441f2e345 |
| hovercard-subject-tag | issue:1775948351 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bazelruby/rules_ruby/148/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7ca56fb7070d85cffacb6a726317eb7fdb1db9a5930eaa935c3bdc4fc70cafb7/bazelruby/rules_ruby/issues/148 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ca56fb7070d85cffacb6a726317eb7fdb1db9a5930eaa935c3bdc4fc70cafb7/bazelruby/rules_ruby/issues/148 |
| og:image:alt | We are testing out the flow where the desired version of ruby is not installed on the host. I expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the ruby-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jgao54 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 574266c5e0389fb19fcea86ddb6d5b0008f148ada57d7a37ec4c90a19caee8f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/bazelruby/rules_ruby git https://github.com/bazelruby/rules_ruby.git |
| octolytics-dimension-user_id | 57414752 |
| octolytics-dimension-user_login | bazelruby |
| octolytics-dimension-repository_id | 220572018 |
| octolytics-dimension-repository_nwo | bazelruby/rules_ruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 220572018 |
| octolytics-dimension-repository_network_root_nwo | bazelruby/rules_ruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3c64ddf9c1ec6ebf99c7b6faf0c61676d36f64c0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width