* feat: add a helper for rules to work with resource_sets
This API is poorly designed and needs some help to let rule users pick a value in cases that they aren't also the rule author
* chore: add some cpu resource_set values as well
This teaches the jq rule about a `data` attribute and adds conditional
support to do bazel location expansion. The expansion is disabled by
default because it likely would cause compat concerns (since jq can take
arbitrary text as input args).
`ctx.actions.run(executable = ...)` is sufficient to include the runfiles in the action inputs. (More generally, ctx.resolve_tools is discouraged in favor of `ctx.actions.run(tools = ...)`.)
In practice we've disabled this setting at some clients, because there's not a surrounding workflow to find these targets are being silently dropped from CI, nor run them on another schedule.
We can re-introduce something better when we add Test Selection to Aspect Workflows.
* Reproduction for mtree_spec behaving different in other repo
* Fix the bug (but not the test)
* Fix the test
* Rename mtree_spec e2e dir to tar
* Fix bzlmod tests
* Remove unnecessary skylib dependency from e2e repos
* Add e2e tests to matrix
* Replace e2e test with a normal test
To do this, we somewhat abuse the skylib dependency, but that's
probalby OK.
* chore: add windows binaries
* chore: fix/exclude windows brokenness
* chore: try to see why diff tests fail on windows
* fix: rm bazelisk rc again for windows
* fix: try our own diff_test
* chore: use only our own diff_test
* fix: always include files from the same workspace as the build target in `copy_to_directory`
Fixes #359.
This updates the `copy_to_directory` tool to accept a workspace name representing the workspace of the target it is executing under. Any files in this workspace are automatically included, regardless of the `include_external_repositories` option. This makes it support usage within an external target (such as `@wksp//:dir`).
* test: add e2e test which uses `copy_to_directory` within an external workspace
Refs #359.
This should catch regressions where no files are copied when built within an external workspace and not using `include_external_repositories`.
* ci: fix stray workspace refs
---------
Co-authored-by: Alex Eagle <alex@aspect.dev>
* feat: tar includes runfiles
* chore: try to fix red circleci
* fix: tracked down problem
* chore: document tar#srcs supports runfiles
* chore: add comment about logic for trimming manifest suffix
* chore: missed a replacement spot
* chore: give up on the listing test for now
* feat: expose a config_setting for copy execution_requirements
Fixes #604
* chore: add user docs
* chore: improve docs
* chore: better link to copy_file
* feat: add a BSD tar toolchain
@thesayyn discovered that it has a feature which should make it a drop-in replacement for pkg_tar
including fine-grained file permissions and symlinks:
https://man.freebsd.org/cgi/man.cgi?mtree(8)
* show example of mtree usage
* feat: introduce tar rule
* cleanup and get test passing
* more cleanup
* chore: add support for compress flags
* chore: add docs
* chore: add docs
* feat: implement linux bsdtar toolchain (#566)
* chore: improve target naming
* WIP: args
* feat: generate mtree spec
Also allow arbitrary args
* refactor: mtree is required
* refactor: style nits
* fix: support mix of source and generated artifacts
* feat: demonstrate strip_prefix
* chore: regen docs
* fix: make host toolchain a fallback toolchain
* fix: include libarchive13.so when installing BSD tar
* chore: buildifier
* fix: aarch64 cpu constraint
* fix(ci): include libarchive13.so when running tar
* chore: add libnettle
* refactor: inputs mutated less
* refactor: remove unneeded substitution arg
* refactor: don't advertise unsupported modes
* fix: hack enough to make it run on my machine
* chore: dynamic libraries included in sh_binary under toolchain
* make sh_binary work
* refactor: drop arm64 for now
* fix toolchain
* fix test
* chore: improve test naming scheme
---------
Co-authored-by: Sahin Yort <thesayyn@gmail.com>
* feat: add `propagate_common_{,test_,binary_}rule_attributes` to lib/utils.
* lib/private/utils: PR feedback: extract COMMON_BINARY_RULE_ATTRIBUTES and COMMON_TEST_RULE_ATTRIBUTES to global constants.
* lib/private/utils: PR feedback: remove default value for attrs param to propagate_common_*rule_attributes
* fix: lib/private/utils: buildifier.
* yq: allow any filename in srcs
* yq: add test cases for free-form file extensions in input
* run buildifier
---------
Co-authored-by: Alex Eagle <alex@aspect.dev>
* docs: clarify write_source_files output constraint
For both the "write_source_files" rule's "files" attribute and the
"write_source_file" rule's "out_file" attribute, we ensure that the
destination files and directories to which we'll write sit within the
same containing Bazel package as the Bazel target requesting this
writing. Clarify the documentation for each attribute to make it clear
that we're constraining the destinations and not the sources of the
content to be written.
* Update lib/write_source_files.bzl
---------
Co-authored-by: Derek Cormier <derek@aspect.dev>