Fixes to get rules_pkl
to pass for larger projects
#31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pkl_test
andpkl_test_suite
targetsThese two targets appear to receive an incorrect (relative) path for the cache directory.
They're prefixed with the
ctx.genfiles_dir.path
and this leads to an error when providing apkl_project
repository alongside any number ofpkl_library
targets as dependencoes.We have lots of symlinks within the
--working-dir
that we pass to Pkl. This means that any code that's using globbed readsread*
, or globbed importsimport*
can’t find the files that it requires.This has been something that Pkl (and Pcl before it) haven’t supported, so I’m curious how we ended up with this regression or what we did. Here’s the bit of code in Pkl where symlinks are ignored: https://github.com/apple/pkl/blob/e81a47a03807739f8ab69eb8c595b53ec0afb434/pkl-core/src/main/java/org/pkl/core/module/FileResolver.java#L39-L42
Not having a solution for this will be a deal breaker for some projects as they will have a number of
pkl_library
targets that they progressively depend upon and expect to have present when wepkl_eval
orpkl_test
.My understanding is that supporting this in Pkl is non-trivial right now, and requires work on cycle detection.
I’ve provided a patch to the
Symlinks.java
code which copies files over rather than symlinking them.