Open robertgates55 opened 2 years ago
Have simplified the rules to:
ruby_binary(
name = "assets_precompile_bin",
srcs = glob(
include = [
"app/**/*",
"config/**/*",
"lib/**/*",
"vendor/assets/**/*",
],
) + [
"Rakefile",
],
args = [
"-- assets:precompile",
],
main = "@bundle//:bin/rake",
deps = [
"@bundle//:bin",
"@bundle//:gems",
],
)
genrule(
name = "precompile",
outs = ["assets.tar.gz"],
cmd = """
$(location :assets_precompile_bin)
echo "test" > $@
""",
tools = [
":assets_precompile_bin",
],
visibility = ["//visibility:public"],
)
(is that better?)
but get the same error.
I'm really interested in getting rake
to work as well. Subscribing to this ticket.
Could you try including Rakefile in the include
hash instead of appending it afterwards?
Could you create a branch and add a new folder under examples wjth this test case?
Looking for additional core maintainers: https://github.com/bazelruby/rules_ruby/discussions/146
I'm trying to precompile my assets by creating a ruby_binary that runs
rake assets:precompile
.I intend to then tar up the compiled assets and have the genrule output these (rather than test.txt!)
My
BUILD
goes like this:But when I run the genrule I get:
Could anyone help me understand what's wrong here? I've included the
Rakefile
in thelib
, and also tried getting it onto the LOAD_PATH withincludes =
but no luck. Any advice really appreciated!