Skip to content

Conversation

rdesgroppes
Copy link

The exclude_patterns parameter passed to buildifier macros happens to be ignored by the Windows runner script template, which the present change proposes to address.

The change tries to adhere to existing choices, by limiting the impact on factory.bzl where the find-suitable pattern can't be used by the embedded powershell script, and also by respecting the script's style.

@rdesgroppes rdesgroppes force-pushed the also-make-buildifier-honor-excluded-patterns-on-windows branch from 3c808ad to eac1abb Compare October 7, 2025 15:09
@rdesgroppes
Copy link
Author

Cc @PatriceVignola, since you brought Windows support (#1011).

@rdesgroppes rdesgroppes force-pushed the also-make-buildifier-honor-excluded-patterns-on-windows branch 2 times, most recently from cdd8420 to 4bfb583 Compare October 14, 2025 11:20
The `exclude_patterns` parameter passed to `buildifier` macros happens
to be ignored by the Windows runner script template, which the present
change proposes to address.

The change tries to adhere to existing choices, by limiting the impact
on `factory.bzl` where the `find`-suitable pattern can't be used by the
embedded powershell script, and also by respecting the script's style.
@rdesgroppes rdesgroppes force-pushed the also-make-buildifier-honor-excluded-patterns-on-windows branch from 4bfb583 to a5af94a Compare October 14, 2025 11:21
rdesgroppes added a commit to DataDog/datadog-agent that referenced this pull request Oct 14, 2025
### What does this PR do?
Applies 2 more patches that were submitted upstream:
- bazelbuild/buildtools#1399
- bazelbuild/buildtools#1400

### Motivation
1. `buildifier` macro: its implementation and Windows runner script
template ignore excluded patterns as of today,
2. `buildifier_test` macro: the Windows runner script template doesn't
consider the `bazel`-provided manifest file.

### Describe how you validated your changes
Local Windows VM (QEMU/virt-manager).

### Additional Notes
`bazel run //bazel/buildifier` takes [2
minutes](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/1177131952#L77-L78)
on Windows:
1. they're spawning a nested powershell and then use a "manual"
recursion from within, which could be optimized => later effort,
2. as Tony mentioned at multiple occasions, we should only run
`buildifier` on modified files => again, later effort.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant