Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#### Description This PR is in the context of [this PR on the core Collector modifying `make check-contrib` to use the latest version of `mdatagen`](open-telemetry/opentelemetry-collector#11670). The `make generate` commands currently starts by compiling build tools in the `.tools` folder, then it `go install`s mdatagen globally for use in `go:generate`. Unfortunately, `go install` does not take into account the version of `mdatagen` referenced in `internal/tools/go.mod`. This means it isn't possible to generate using the local version of `mdatagen` for testing, even with `replace` statements. This PR fixes this by prepending `.tools` to the `$PATH` before running the generate command, which makes `go:generate` use the version of `mdatagen` in that folder instead of a global one. (Originally, this PR also added a new `modgenerate` target in `Makefile.Common`, to allow running generate commands on a specific group of modules instead of all of them for efficiency reasons. After discussing it with @mx-psi, we decided to hold off on that change for a later PR, as it warrants further discussion.)
- Loading branch information