Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Rebuild .tools as they can be outdated #5220

Merged
merged 9 commits into from
Apr 19, 2024

Conversation

pellared
Copy link
Member

@pellared pellared commented Apr 17, 2024

Why

I find it annoying that the target for tools are only build once and it easy to get the tooling outdated locally and have different results than on CI.

What

  1. Change "order-only prerequisites" to "normal prerequisites" in all places except for creating directories (which is even shown as an idiomatic example).
  2. Add internal/tools/go.mod as a normal prerequisite for tools so that they are rebuild once go.mod changes. I want to point out that go.mod is touched each time go mod tidy is executed so often the tools will be rebuild when people use make. Rebuilding the tools thanks to the go build cache takes only a few seconds. If one e.g. just runs make golangci-lint a few times then the tools will not be rebuild.
  3. Added a step in CI to set "proper" timestamp for internal/tools/go.mod as otherwise all build tools would be rebuild; e.g.: https://github.com/open-telemetry/opentelemetry-go/actions/runs/8717700613/job/23913426182 (related thread: [chore] Rebuild .tools as they can be outdated #5220 (comment)). More: https://stackoverflow.com/a/55609950/859275

More: https://www.gnu.org/software/make/manual/make.html#index-order_002donly-prerequisites

Alternative

This PR looks to me more "Make idiomatic", but the alternative approach is simpler:

@pellared pellared changed the title [chore] Build .tools when they can be outdated [chore] Rebuild .tools as they can be outdated Apr 17, 2024
@pellared pellared marked this pull request as ready for review April 17, 2024 07:32
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@pellared pellared marked this pull request as draft April 18, 2024 08:52
@pellared pellared marked this pull request as ready for review April 18, 2024 10:41
@pellared pellared merged commit 1f76264 into open-telemetry:main Apr 19, 2024
26 checks passed
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.

3 participants