Skip to content

Introduced a build tag to select watcher implementation.#13452

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:build_tags
Dec 15, 2025
Merged

Introduced a build tag to select watcher implementation.#13452
glours merged 1 commit into
docker:mainfrom
ndeloof:build_tags

Conversation

@ndeloof
Copy link
Copy Markdown
Contributor

@ndeloof ndeloof commented Dec 15, 2025

What I did

Watcher implementation is selected based on a build tag. This one used to be set by OS, but this brings a constraining requirement to use CGO for users of the compose SDK, even if they don't rely on this feature.
=> Switched to a specific build tag, set by makefile when running on MacOS
Also fixed GO_BUILDTAGS not being passed to bake

Related issue
closes #13448

(not mandatory) A picture of a cute animal, if possible in relation to what you did

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof requested a review from a team as a code owner December 15, 2025 07:56
@ndeloof ndeloof requested a review from glours December 15, 2025 07:56
@ndeloof ndeloof changed the title Introduced fsnotify build tag to select watcher implementation. Introduced a build tag to select watcher implementation. Dec 15, 2025
Copy link
Copy Markdown
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours glours merged commit e224264 into docker:main Dec 15, 2025
24 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Dec 19, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | patch | `v5.0.0` -> `v5.0.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v5.0.1`](https://github.com/docker/compose/releases/tag/v5.0.1)

[Compare Source](docker/compose@v5.0.0...v5.0.1)

#### What's Changed

##### 🐛 Fixes

- Restored support for `COMPOSE_COMPATIBILITY` by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13424](docker/compose#13424)
- Fixed grammatical errors and improve clarity in code. by [@&#8203;xiaolinny](https://github.com/xiaolinny) in [#&#8203;13429](docker/compose#13429)
- Fixed broken `run --quiet`. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13430](docker/compose#13430)
- Fixed SDK example by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13416](docker/compose#13416)
- Added a check buildx version is set before comparing it. by [@&#8203;yangfeiyu20102011](https://github.com/yangfeiyu20102011) in [#&#8203;13415](docker/compose#13415)
- Fixed grammar: pluralize 'service' and remove apostrophes in lets. by [@&#8203;rashmivagha](https://github.com/rashmivagha) in [#&#8203;13423](docker/compose#13423)
- Fixed progress UI not restoring terminal once operation completes. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13439](docker/compose#13439)
- Fixed status alignment in progress UI. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13438](docker/compose#13438)
- Restored image layer download progress details on pull. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13445](docker/compose#13445)
- Added 'configured' event at the end of model configuration phase. by [@&#8203;glours](https://github.com/glours) in [#&#8203;13446](docker/compose#13446)
- Introduced a build tag to select watcher implementation. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13452](docker/compose#13452)
- Removed mention for `v2` on README. by [@&#8203;alexislefebvre](https://github.com/alexislefebvre) in [#&#8203;13451](docker/compose#13451)
- Fixed missing error handling in `setEnvWithDotEnv`. by [@&#8203;htoyoda18](https://github.com/htoyoda18) in [#&#8203;13450](docker/compose#13450)
- Adopted morikuni/aec library over raw ANSI sequences. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13440](docker/compose#13440)
- Prevented incorrect progress metrics to break compose display. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13457](docker/compose#13457)
- Restored support for BUILDKIT\_PROGRESS. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13455](docker/compose#13455)
- Added check model plugin is successfully loaded. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13464](docker/compose#13464)
- Added a warning when no service has been selected to build. by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13467](docker/compose#13467)

##### ⚙️ Dependencies

- Drop Go min patch version by [@&#8203;austinvazquez](https://github.com/austinvazquez) in [#&#8203;13418](docker/compose#13418)
- bump golang 1.24.11 by [@&#8203;austinvazquez](https://github.com/austinvazquez) in [#&#8203;13417](docker/compose#13417)
- bump osxcross by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13425](docker/compose#13425)
- bump golang.org/x/sys from 0.38.0 to 0.39.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13433](docker/compose#13433)
- bump github.com/docker/cli-docs-tool from 0.10.0 to 0.11.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13437](docker/compose#13437)
- bump golang.org/x/sync from 0.18.0 to 0.19.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13434](docker/compose#13434)
- bump tags.cncf.io/container-device-interface from 1.0.1 to 1.1.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13441](docker/compose#13441)
- bump github.com/moby/buildkit from 0.26.2 to 0.26.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13462](docker/compose#13462)

#### New Contributors

- [@&#8203;yangfeiyu20102011](https://github.com/yangfeiyu20102011) made their first contribution in [#&#8203;13415](docker/compose#13415)
- [@&#8203;xiaolinny](https://github.com/xiaolinny) made their first contribution in [#&#8203;13429](docker/compose#13429)
- [@&#8203;alexislefebvre](https://github.com/alexislefebvre) made their first contribution in [#&#8203;13451](docker/compose#13451)
- [@&#8203;htoyoda18](https://github.com/htoyoda18) made their first contribution in [#&#8203;13450](docker/compose#13450)

**Full Changelog**: <docker/compose@v5.0.0...v5.0.1>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi41OS4xIiwidXBkYXRlZEluVmVyIjoiNDIuNTkuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
pose added a commit to pulumi/pulumi-docker that referenced this pull request May 26, 2026
## Summary

Adds `patches/0003-Remove-docker_compose-resource.patch`, which deletes
`internal/provider/resource_docker_compose.go` and its one registration
in `framework_provider.go` from the upstream submodule. That resource is
the sole importer of `github.com/docker/compose/v2`, whose transitive
`pkg/watch` → `github.com/fsnotify/fsevents` import requires CGO on
darwin and breaks the `CGO_ENABLED=0` darwin cross-build. Rebased onto
the current v4.4.0 submodule.

Part of the master breakage tracked in #1698.

## Why

The `docker_compose` resource (added upstream in v4.3.0, still present
in v4.4.0) imports `github.com/docker/compose/v2/pkg/compose`, which
always pulls in `pkg/watch` → `github.com/fsnotify/fsevents`. `fsevents`
requires CGO on darwin in every released version, but the
bridged-provider build cross-compiles darwin from Linux with
`CGO_ENABLED=0` and cannot resolve its symbols. I confirmed the resource
is the only file in the upstream provider that reaches this import, so
removing it fully clears the darwin build.

## Why this shape of patch

The patch is deliberately minimal: it touches only the resource file and
its registration and leaves `go.mod`/`go.sum` untouched. The now-unused
compose requires are harmless (nothing imports them, so the build never
compiles them), and keeping the patch off `go.mod`/`go.sum` avoids the
recurring upgrade merge conflicts that `go.sum` patches cause (per
@corymhall's review note). This is also why the patch survived the
v4.3.0 → v4.4.0 rebase as a clean regeneration rather than a conflict.

## Upstream

The durable fix is to let non-CGO consumers opt out upstream.
`kreuzwerker/terraform-provider-docker#937` adds a `no_compose` build
tag for exactly this and is now open and rebased onto v4.4.0.
Separately, `docker/compose` moved its watcher behind a `//go:build
fsnotify` tag (docker/compose#13452), but only in the
`docker/compose/v5.1+` line; the provider pins `docker/compose/v2`,
which never received it. Once #937 (or a compose-v5 migration) lands,
this patch can be dropped and the resource re-enabled. Tracked in #1720.

## Trade-off

The `docker_compose` resource is unavailable while the patch is in
place. It is not surfaced in the generated Pulumi schema (the schema
check on this PR reports no resource/function changes), so removing it
does not alter the provider's public API.

## Verification

Built the v4.4.0 upstream provider with the patch applied:

```
# with the patch: darwin/arm64, CGO_ENABLED=0 — internal/provider compiles clean
# without the patch: same build fails on github.com/fsnotify/fsevents undefined symbols
```

A `workflow_dispatch` of `master.yml` on this branch reconfirms the full
6-platform `build_provider` matrix on v4.4.0.

## Related

- #1698 — workflow-failure tracker for the master break
- #1720 — tracker for dropping this patch once upstream supports non-CGO
darwin builds
- kreuzwerker/terraform-provider-docker#937 — upstream `no_compose`
build tag (reopened, rebased onto v4.4.0)
- docker/compose#13452 — watcher build-tag fix (v5.1+ only)
- pulumi/ci-mgmt#2233 — add darwin to the PR-time `build_provider`
matrix to catch this class earlier
- pulumi/ci-mgmt#2273 — scope `CGO_ENABLED=1` darwin cross-builds as a
durable fallback

Part of #1698
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.

SDK packaging: avoid forcing CGO on Darwin for watch-only functionality

2 participants