Open mexlez12345 opened 4 weeks ago
This is essentially the "inverse" of the test case here https://github.com/apple/rules_pkl/blob/main/tests/pkl_eval/BUILD.bazel#L166
where instead of using a generated .pkl
in a library that's imported by a hand-written entrypoint
, I'm trying to use the generated file as the entrypoint
Same behavior if I use an intermediate pkl_library
genrule(
name = "gen_entrypoint",
outs = ["entrypoint.pkl"],
cmd = """
cat << EOF >> $(location entrypoint.pkl)
x = throw("entrypoint ran!")
EOF
"""
)
pkl_library(
name = "generated_entrypoint_lib",
srcs = ["entrypoint.pkl"],
)
pkl_eval(
name = "eval_entrypoint",
entrypoints = ["generated_entrypoint_lib"],
deps = [
":generated_entrypoint_lib"
],
)
version
abab6964bacfbadd20ac3239f13fb9f99a385f4d
I believe I've found a bug in how
pkl_eval
sets up itswork
subdirectory that breaks when trying to evaluate a generated file .To reproduce, use this
BUILD
file and try tobazel build //:eval_entrypoint
Error output:
Poking around in the sandbox, it looks like the file is actually there, but because bazel's expansion the path of the generated
entrypoint.pkl
includes thebazel-out
prefix,pkl
can't find it when its working dir is set to thework/
subdirectory.Sandbox contents