Commit Graph

179 Commits

Author SHA1 Message Date
Greg Magolan 73d021fb36
fix: correctly split quoted args (#909) 2024-08-19 16:36:41 -04:00
Greg Magolan eb55a3c03f
refactor: deprecated expand_locations which is just pass-through to ctx.expand_location() (#910) 2024-08-19 15:28:45 -04:00
Alex Eagle 5d09fc1b83
fix(docs): description of jq example didn't match behavior (#897)
* fix(docs): description of jq example didn't match behavior

I think this was wrong? Wish our examples were also executable...

---------

Co-authored-by: Derek Cormier <derek@aspect.dev>
2024-08-11 15:56:06 -07:00
Justin Pinkul 74ac451d8a
Adding a preserve time feature to copy_to_directory and copy_directory (#898) 2024-08-10 22:08:56 -07:00
Alex Eagle 0f5e1dcafd
chore(deps): upgrade stardoc (#894)
* chore(deps): upgrade stardoc

This uses the Bazel 7 'starlark_doc_extract' rule which our docsite expects for slurping data.

* chore: stardoc setup in WORKSPACE too

* chore: skip stardoc on bazel 6 in cases where the legacy extractor produces different docstrings
2024-08-08 12:56:11 -07:00
Alex Eagle 109f32eefb
docs(tar): point to the tests as useful examples (#892)
* docs(tar): point to the tests as useful examples

Improve the content to make it easier to reference as examples of usage.

* fix broken link
2024-08-05 11:18:57 -07:00
Markus Hofbauer cdbfe4190c
fix(typos): Fix almost all typos with hook (#884)
* Fix almost all typos with hook

* align docs
2024-07-31 10:09:17 -04:00
Matt 59453e5c50
fix: Set size to a default value as well as timeout. (#839)
* fix: Set size to a default value as well as timeout.

Currently, we are unable to run our `write_source_files` tests in our pre-upload checks, because we have `--test_size_filter=small`, and setting `size` will attempt to set it on both the run rule and the test rule, the former being invalid.

* code review feedback

* chore: fix one more test that should use size for defaulting

---------

Co-authored-by: Alex Eagle <alex@aspect.dev>
2024-07-19 12:50:50 -07:00
Tobias Schlatter 086624ae47
fix(tar): expose package_dir argument in mtree_mutate (#873)
This was likely forgotten in #829 when making the parameters explicit
during review.
2024-07-02 13:29:24 +03:00
Alex Eagle fb950d38ae
docs: add missing default stamp var (#865)
* docs: add missing default stamp var

* update docs
2024-06-13 09:56:06 -07:00
Malte Poll 1697a3275b
fix: coreutils toolchain: Use statically linked linux amd64 variant (#706)
* coreutils toolchain: Use statically linked linux amd64 variant

Uutils has a musl release artifact for linux amd64.
In the future, it should probably also be possible to add a
aarch64 musl toolchain. At the moment, this is not an upstream release
artifact.

* coreutils toolchain: temporarily add back old darwin variant

On release 0.0.26 of uutils/coreutils, the darwin x86_64 binary is missing.
Also, any releases between 0.0.23 and 0.0.26 are missing binary artifacts.
Downgrade coreutils toolchain on darwin x86_64 for now.

https://github.com/uutils/coreutils/releases/tag/0.0.26
2024-05-08 07:06:12 -07:00
Sahin Yort d1d063f3e5
feat: introduce zstd toolchain (#831) 2024-05-03 16:12:56 -07:00
Alex Eagle 977f27f7a0
feat(tar): add ergonomic way to strip_prefix (#829) 2024-05-01 12:36:39 -07:00
Thomas Lam faaada2eaa
feat: add platform_transition_test (#770)
* Add platform_transition_test

Signed-off-by: Thomas Lam <thomaslam@canva.com>

* Set target platform constraints for tests

Signed-off-by: Thomas Lam <thomaslam@canva.com>

* Update docs

Signed-off-by: Thomas Lam <thomaslam@canva.com>

---------

Signed-off-by: Thomas Lam <thomaslam@canva.com>
2024-04-03 14:42:07 -07:00
Greg Magolan 7716549ab9
feat: export utils from //lib:utils.bzl to match repo_utils and platform_utils (#810) 2024-04-03 14:00:44 -07:00
Greg Magolan abf56a6454
feat: add get_home_directory to repo_utils (#809) 2024-04-03 13:53:18 -07:00
Alex Eagle fea9515087
feat: don't require 'out' on expand_template (#798)
In a lot of cases the name of the generated file is unimportant.
For example in https://github.com/bazel-contrib/rules_oci/pull/534 I wanted to remove 'out' in a bunch of these calls.
2024-03-26 16:57:16 -07:00
Alex Eagle 0fc838839c
feat: add a helper for rules to work with resource_sets (#792)
* 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
2024-03-18 15:38:24 -07:00
Sahin Yort a29dd93c0b
fix: srcs is not mandatory (#786) 2024-03-08 10:47:38 -08:00
Greg Magolan fdb7bf3a56
docs: add warning about using use_default_shell_env (#779) 2024-03-05 10:33:05 -08:00
Greg Magolan 73e620161a
docs: add use_default_shell_env to docstring of run_binary (#778) 2024-03-05 10:27:02 -08:00
Sahin Yort 197b2da974
feat: support location expansion in tar (#774) 2024-03-01 14:51:47 -08:00
Marc Redemske a3d7efe298
feat(list): add `unique` function (#716)
* feat(list): add `unique` function

* Update lists.bzl

* Update lists.bzl

* Update lists.bzl

* Update lists.bzl

---------

Co-authored-by: Alex Eagle <alex@aspect.dev>
2024-02-27 08:25:00 -08:00
Mike Lundy dfcffca8f5
jq: add data file and location expansion support (#757)
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).
2024-02-26 17:43:56 -08:00
Jason Bedard 8e5a86f8b8 docs: add bats docs 2024-02-26 15:55:48 -08:00
Alex Eagle 38fecbcbb5
Update tar.bzl (#751)
* Update tar.bzl

Fix header so it's not presented at the same level as the parent (the `tar` macro)

* fix docs
2024-02-08 15:26:05 -08:00
Greg Magolan 71a8052589
fix: merge user tags in stardoc_with_diff_test (#746) 2024-02-05 17:43:58 -08:00
Eric Hauser ee0442db9c
FR-723: make WriteSourceFileInfo public (#724)
* FR-723: make WriteSourceFileInfo public

* Update docs

---------

Co-authored-by: Greg Magolan <greg@aspect.dev>
2024-01-22 21:51:05 -08:00
Greg Magolan 5b3b7d7794
feat: allow write_source_file(s) to write source files to bazel packages outside of the target's package (#717) 2024-01-10 15:07:03 -08:00
Greg Magolan 516a5fe725
feat: add is_bazel_7_or_greater utility (#714) 2024-01-07 16:42:57 -08:00
Greg Magolan d313c8bf75
fix: move flags that should only be set with bazel 6 to bazel6.bazelrc recommended settings (#711) 2024-01-04 08:16:59 -08:00
Sahin Yort 4f6b4bd5cb
feat: implement bats test runner (#699) 2023-12-20 13:08:47 -08:00
Alex Eagle f65019be4e
chore: improve docs about mtree mutation (#692) 2023-12-13 15:03:32 -08:00
Sahin Yort a219f5260d
fix: expose tar_lib as public (#680) 2023-12-08 10:31:01 -08:00
Tobias Schlatter 975a933e24
docs: fix load path for copy_file_to_bin_action (#673) 2023-11-30 10:58:48 -08:00
Derek Cormier 2b38ad5d29
feat: expose toolchains used for copy actions (#661) 2023-11-16 07:15:50 -08:00
Derek Cormier 5bd6e5fdd4
fix(ci): fix bzlmod issues and enable on ci (#658) 2023-11-15 15:07:03 -08:00
David Zbarsky b74a45456d
Upgrade coreutils and add darwin arm64 binary (#649) 2023-11-14 08:47:21 -08:00
Greg Magolan 602b7b8f80
Revert: feat: expose a config_setting for copy execution_requirements (#606) (#640) 2023-10-31 15:19:38 -07:00
Derek Cormier 5077d5ae4a
chore: remove bazel5 presets (#614) 2023-10-16 13:35:41 -07:00
Derek Cormier 20f1ac39e0
refactor: rework toolchain registration for WORKSPACE and bzlmod users (#597) 2023-10-10 12:16:13 -07:00
Douglas Parker 323329f119 fix: always include files from the same workspace as the build target in `copy_to_directory()` (#360)
* 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>
2023-10-10 10:57:08 -07:00
Alex Eagle 472bf9b122
feat: tar includes runfiles (#595)
* 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
2023-10-09 15:57:52 -07:00
Alex Eagle 4bfe55711a
feat: expose a config_setting for copy execution_requirements (#606)
* feat: expose a config_setting for copy execution_requirements

Fixes #604

* chore: add user docs

* chore: improve docs

* chore: better link to copy_file
2023-10-09 13:57:34 -07:00
Greg Magolan 1cd2eb7e0a
refactor: remove exclude_prefixes from copy_to_directory and copy_to_directory_bin_action (#591) 2023-10-06 10:17:33 -07:00
Greg Magolan cb9b74f41e
refactor: remove to_workspace_path and to_manifest_path (#590) 2023-10-06 08:37:53 -07:00
Greg Magolan 231dad5c92
refactor: remove output_dir from run_binary and expand_variables (#588) 2023-10-06 08:32:55 -07:00
Greg Magolan 3a16b4de26
refactor: remove legacy copy_directory_action helper (#589) 2023-10-06 08:32:25 -07:00
Alex Eagle 894ba445c4
chore: remove is_windows attributes (#587)
Fixes some TODOs for 2.0
2023-10-05 16:03:15 -07:00
Derek Cormier dca2b1df0c
chore: remove legacy copy_to_directory_action (#582) 2023-10-05 15:52:37 -07:00