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

Enhance makefile tools binaries to be system and arch independent #9589

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

vpnachev
Copy link
Member

@vpnachev vpnachev commented Apr 15, 2024

How to categorize this PR?

/area dev-productivity
/kind enhancement

What this PR does / why we need it:
Enhance makefile tools binaries to be system and arch independent

Sometimes, I am mounting the source code in a dev container and running various make commands from there, hence the system could differ (linux vs darwin and arm64 vs amd64). This results in failure because darwin cannot run linux binaries and vise versa, to fix this I have to manually delete binaries one by one or the entire folder which is time consuming. By using dedicated folder for each system and arch, each target will get own set of binaries and the collision will be avoided.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

The tools installed via the `tools.mk` make file are now by default installed in an OS and arch specific folder to allow running make targets from different platforms sharing the same source code.
The previous behavior can be achieved by setting the variable `TOOLS_BIN_DIR` to `hack/tools/bin` to any make target.

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) kind/enhancement Enhancement, improvement, extension labels Apr 15, 2024
@gardener-prow gardener-prow bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 15, 2024
@vpnachev
Copy link
Member Author

/retest-required

@vpnachev
Copy link
Member Author

/cc @timebertt

@vpnachev
Copy link
Member Author

/retest-required

Copy link
Member

@oliver-goetz oliver-goetz left a comment

Choose a reason for hiding this comment

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

This change will break our precompiled tools (ref). When they are imported again (ref) the files would be copied to something like ./hack/tools/bin/linux-amd64/linux-amd64

I think the unit-tests are failing because golangci-lint does not find the library at the place where it is expected (.golangci-lint.yaml). I don't know if it is possible to use the sub folder here too.

@gardener-prow gardener-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 16, 2024
@vpnachev
Copy link
Member Author

Now, by default the os-arch specific dir will be used, in pre-configured environment the non os-arch specific dir will be used.

@vpnachev
Copy link
Member Author

/retest-required

Copy link
Member

@oliver-goetz oliver-goetz left a comment

Choose a reason for hiding this comment

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

/retest

@gardener-prow gardener-prow bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 17, 2024
@oliver-goetz
Copy link
Member

/remove-lgtm
I wanted to leave lgtm for someone else to cross-check 😅

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
@vpnachev
Copy link
Member Author

I might need to rebase because of the tests failing like https://prow.gardener.cloud/view/gs/gardener-prow/pr-logs/pull/gardener_gardener/9589/pull-gardener-e2e-kind-ha-multi-zone-upgrade/1780228296198328320#1:build-log.txt%3A1694-1697

  [FAILED] Expected
      <string>: v1.93.0-dev
  to equal
      <string>: v1.92.1

@vpnachev
Copy link
Member Author

/test pull-gardener-e2e-kind

@vpnachev
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

1 similar comment
@vpnachev
Copy link
Member Author

/test pull-gardener-e2e-kind-ha-multi-zone

@vpnachev
Copy link
Member Author

/retest

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2024
Copy link
Contributor

gardener-prow bot commented Apr 18, 2024

LGTM label has been added.

Git tree hash: 417359dd209bd3cf010a0bce8aaaf89f95b34d2f

Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Nice improvement!

Copy link
Contributor

gardener-prow bot commented Apr 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oliver-goetz, timebertt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [oliver-goetz,timebertt]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vpnachev
Copy link
Member Author

/retest

@gardener-prow gardener-prow bot merged commit 9f135c3 into gardener:master Apr 18, 2024
17 checks passed
@vpnachev vpnachev deleted the enh/hack-tools branch April 18, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/dev-productivity Developer productivity related (how to improve development) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants