Commit Graph

146 Commits

Author SHA1 Message Date
Sahin Yort 4109b3cf93
chore: cherry pick doc fixes (#800)
* chore: run gazelle (#584)

Also delete the local_config_platform workaround for bazel 5 which made our docs setup complex

(cherry picked from commit 6a4381bf07)

* chore: test against bazel 7.0.0 (#713)

(cherry picked from commit 5aaa785b96)

---------

Co-authored-by: Alex Eagle <alex@aspect.dev>
Co-authored-by: Greg Magolan <gmagolan@gmail.com>
2024-03-27 12:53:20 -07:00
Marc Redemske 7911ff5372
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-03-27 10:22:24 -04:00
Mike Lundy 044ff55fe9
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-03-27 10:21:39 -04:00
Eric Hauser 2e86d10332
FR-723: make WriteSourceFileInfo public (#724)
* FR-723: make WriteSourceFileInfo public

* Update docs

---------

Co-authored-by: Greg Magolan <greg@aspect.dev>
2024-03-27 10:17:05 -04:00
Greg Magolan 338c15c7fb
feat: allow write_source_file(s) to write source files to bazel packages outside of the target's package (#717) 2024-03-27 10:16:20 -04:00
Alex Eagle b4b7d1bc1c
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-27 10:08:51 -04:00
Greg Magolan 30a9b9d739
refactor: remove tar rule from 1.x branch to reduce branch maintenance 2024-03-26 12:07:05 -07:00
Sahin Yort d17884965d
fix: srcs is not mandatory (#786) 2024-03-23 02:17:29 -04:00
Sahin Yort 907a5d42e6
feat: support location expansion in tar (#774) 2024-03-23 02:17:17 -04:00
Alex Eagle 30a5725ef4
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-03-23 02:16:43 -04:00
Alex Eagle 471e074cf7
chore: improve docs about mtree mutation (#692) 2024-03-23 02:14:34 -04:00
Sahin Yort 6a543815f1
fix: expose tar_lib as public (#680) 2024-03-23 02:11:54 -04:00
Alex Eagle 0d901be0f5
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
2024-03-23 01:49:03 -04:00
Alex Eagle a393109223
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>
2024-03-23 01:42:58 -04:00
Greg Magolan 27e3b10472 fix: merge user tags in stardoc_with_diff_test (#746) 2024-02-05 17:51:30 -08:00
Greg Magolan bf7131ffe7 feat: add is_bazel_7_or_greater utility (#714) 2024-01-08 02:32:28 -08:00
Greg Magolan 3e62405a5e fix: move flags that should only be set with bazel 6 to bazel6.bazelrc recommended settings (#711) 2024-01-05 15:50:10 -08:00
Derek Cormier 78ed16ae46
feat: backport 2.x features for interoperability (#657) 2023-11-16 11:25:34 -07:00
Derek Cormier 7dbb96e225
fix(ci): fix bzlmod issues and enable on ci (#658) (#659) 2023-11-15 15:55:52 -08:00
Douglas Parker c6b39ab8f6
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 07:16:13 -07:00
Alex Eagle 8b06f31c46
feat: expose a config_setting for copy execution_requirements (#606) (#607)
* 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 14:08:17 -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
Greg Magolan 76ef6c8988
chore: add test coverage for run_binary & expand_variables makevars (#504) 2023-08-26 13:59:48 -07:00
Steven E. Harris 3af9e00308
docs: clarify write_source_files output constraint (#498)
* 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>
2023-08-23 12:32:56 -07:00
Alex Eagle c6e9fa0e62 chore: document JQ_BIN make var 2023-07-26 13:18:31 -07:00
Alex Eagle 5ecaeb5c53 chore: update docs 2023-07-18 11:01:26 -07:00
Malte Poll d79f4d4867 feat: yq supports stamping
Fixes #223
2023-06-15 16:50:26 -07:00
Jason Bedard 47dd4ce9fd chore: run buildifier 2023-06-13 16:28:17 -07:00
Alex Eagle c89ec6a554 docs: clarify rlocationpath 2023-05-24 17:16:00 -07:00
Sahin Yort 6af964f261
feat: support stamp substituions (#435) 2023-05-16 16:14:50 -07:00
Sahin Yort 781d1cbebf
feat: implement chr, ord, and hex (#425) 2023-05-15 12:15:55 -07:00
Alex Eagle 347cdac300 update docs 2023-05-08 07:49:24 -07:00
Alex Eagle 6f1f2fb198 fix(yq): restore default version, reverting #405
The new version of yq is quite breaking, as it requires '-oj -r' for continued operation in rules_oci.
We can do a default version flip later when more downstream projects are compatible.
2023-05-05 13:07:51 -07:00
Henk Erik van der Hoek 39d556a225
Chore: update YQ (#405)
* Chore: update YQ

* Update tests

* Update docs

* Update docs

---------

Co-authored-by: Greg Magolan <gmagolan@gmail.com>
2023-05-01 19:18:50 -07:00
Jason Bedard b983608c08
docs(write_source_file): specify the name of the generated diff_test (#410)
Fix #409
2023-04-19 14:09:03 -07:00
Alex Eagle a04c31248b docs(jq): document empty srcs 2023-04-19 09:03:52 -07:00
Alex Eagle 5162ae4d8c feat: detect bzlmod automatically rather than requiring the user sets the flag.
Thanks to @aherrmann for pointing out this is possible: https://github.com/aherrmann/demo-bazel-detect-bzlmod-config-setting
2023-03-31 14:56:22 -07:00
Gary Miguel e872660dbc
Update link to example from angular (#388)
* Update link to example from angular

Previous target was deleted or renamed. Now use a permalink.

* bazel run @//docs:update
2023-03-07 15:42:16 -08:00
Greg Magolan 8c58935da1
feat: add label_str utility to generate consistent label strings for all Bazel versions (#386) 2023-03-03 18:23:17 -08:00
Greg Magolan 1fdfd6e831
fix: add missing **kwargs to write_aspect_bazelrc_presets (#379) 2023-02-22 12:17:00 -08:00
Derek Cormier 83fb3050c2 feat: allow additional common args to be passed to update_docs 2023-02-21 10:49:06 -08:00
Greg Magolan 569fa374ef
feat: add write_aspect_bazelrc_presets macro (#370) 2023-02-17 14:34:06 -08:00
Alex Eagle 1df2becc7a chore: turn on more basic precommit checks
In particular this makes our bazelrc presets more compliant with client codebases, ensuring they can copy these files and not trip on their own pre-commit check
2023-02-17 11:00:00 -08:00
Alex Eagle bda8e69ea0 chore: fix spelling 2023-02-15 09:08:46 -08:00
Greg Magolan 8f02b3364e
feat: add to_rlocation_path and to_repository_relative_path functions to paths.bzl (#362) 2023-02-11 12:36:49 -08:00
Derek Cormier 096805f0ce enhancement: allow additional attributes to be passed to assert_* tests 2023-02-10 07:14:05 -08:00