Commit Graph

170 Commits

Author SHA1 Message Date
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
Alex Eagle 6a4381bf07
chore: run gazelle (#584)
Also delete the local_config_platform workaround for bazel 5 which made our docs setup complex
2023-10-05 14:22:38 -07:00
Derek Cormier 46a16e500c
chore: remove expand_template re-export (#580) 2023-10-05 12:33:13 -07:00
Alex Eagle a283a8216d feat: add a tar toolchain (#468)
* 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>
2023-10-03 13:50:55 -07:00
Derek Cormier 174bb9425d feat: support jq 1.7 toolchain (#520) 2023-10-03 13:50:55 -07:00
Greg Magolan bcb10f8154
feat: add undeclared output mode to expand_template (#561) 2023-09-29 11:30:02 -07:00
Greg Magolan 1d816e011b
feat: add assert_directory_contains test to testing.bzl (#560) 2023-09-29 09:53:00 -07:00
Aaron Son a4e997de1f
feat: add `propagate_common_{,test_,binary_}rule_attributes` to lib/utils. (#553)
* 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.
2023-09-26 14:29:42 -07:00
Marc Redemske 45986f000d
feat: add list utils (#512)
* feat: add list utils

* chore: add docs for lists

* fixes accoding to review

---------

Co-authored-by: Alex Eagle <alex@aspect.dev>
2023-09-21 10:12:47 -07:00
Alex Eagle 882bc95615
feat: expand_template allows inline template content (#533)
Co-authored-by: thesayyn <thesayyn@gmail.com>
2023-09-20 18:32:05 -07:00