Skip to content

Commit 85ba963

Browse files
authored
Make the ruby_runtime() rule re-load if PATH changes. (#22)
This will make `rvm use` commands take effect immediately, rather than requiring a `blaze clean --expunge` first. This has an unfortunate side-effect of also forcing a re-download of hermetic Ruby versions when PATH changes. To fix this, we should make `system_ruby()` its own repository rule, so that hermetic Ruby versions are not affected by PATH.
1 parent 29ed0a8 commit 85ba963

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ruby/private/toolchains/ruby_runtime.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,4 +331,9 @@ ruby_runtime = repository_rule(
331331
allow_single_file = True,
332332
),
333333
},
334+
# Force a re-fetch when the Ruby version is changed through RVM.
335+
# This will also force a re-download when PATH changes, which is
336+
# unnecessary. To fix this, we may want to make system_ruby()
337+
# a different repository rule from ruby_runtime().
338+
environ = ["PATH"],
334339
)

0 commit comments

Comments
 (0)