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

Improve Makefile OS_ARCH variable #16

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Improve Makefile OS_ARCH variable #16

merged 1 commit into from
Jul 9, 2024

Conversation

sahaqaa
Copy link
Contributor

@sahaqaa sahaqaa commented Jul 8, 2024

Currently in Makefile we have next line:

OS_ARCH=darwin_arm64

When i need to make some changes to provider or to test some code i need to run "make" command. But for it to build proper version for me, i need to put manually "linux_amd64" in Makefile and doing this manually repeatedly seems like not the good idea.

Therefore i propose to change this line to:

OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)

$(shell go env GOHOSTOS) retrieves the operating system of the host machine.
$(shell go env GOHOSTARCH) retrieves the architecture of the host machine.

The combination $(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH) produces a string like darwin_arm64, linux_amd64, etc.

This reduces the need for manual update of Makefile.

@sahaqaa sahaqaa requested a review from a team as a code owner July 8, 2024 15:24
Copy link
Member

@arslanbekov arslanbekov left a comment

Choose a reason for hiding this comment

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

Great!

Copy link

@patoarvizu patoarvizu left a comment

Choose a reason for hiding this comment

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

👍

@sahaqaa sahaqaa merged commit 15debd6 into main Jul 9, 2024
1 check passed
@sahaqaa sahaqaa deleted the improve_makefile branch July 9, 2024 12:25
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