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

Add arch support for local go build #447

Closed
wants to merge 1 commit into from

Conversation

maysunfaisal
Copy link
Member

@maysunfaisal maysunfaisal commented Feb 26, 2024

What does this PR do?:

Add arch support for go build binary in Makefile. Not needed in Dockerfile, since we are building inside the image.

Which issue(s)/story(ies) does this PR fixes:

PR acceptance criteria:

  • Unit/Functional tests

  • Documentation

  • Client Impact

How to test changes / Special notes to the reviewer:

MacBook-Pro:application-service maysun$ make platform_info
OS is darwin and ARCH is amd64
make: `platform_info' is up to date.

MacBook-Pro:application-service maysun$ make build
/Users/maysun/dev/appstudio/application-service/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
find . -not -path '*/\.*' -not -name '*zz_generated*.go' -name '*.go' -exec goimports -w {} \;
go vet ./...
GOOS=darwin GOARCH=amd64 go build -o bin/manager main.go

MacBook-Pro:application-service maysun$ echo $?
0

MacBook-Pro:application-service maysun$ ls -la bin/manager 
-rwxr-xr-x  1 maysun  staff  77239792 26 Feb 15:11 bin/manager

Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
1.9% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.63%. Comparing base (4863efd) to head (2daa2ff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #447      +/-   ##
==========================================
+ Coverage   80.57%   80.63%   +0.05%     
==========================================
  Files          35       35              
  Lines        5040     5040              
==========================================
+ Hits         4061     4064       +3     
+ Misses        774      772       -2     
+ Partials      205      204       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm tested locally with ubuntu (22.04) & amd64

Copy link

openshift-ci bot commented Feb 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maysunfaisal, thepetk

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 [maysunfaisal,thepetk]

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

@@ -52,6 +52,10 @@ APPLICATION_API_CRD = https://raw.githubusercontent.com/redhat-appstudio/applica
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.22

# Get the local platform
OS=$(shell go env GOOS)
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn'tgo build be able to automatically retrieve these?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question, I tried finding this exact verbage for go build on docs but didnt find any https://go.dev/doc/tutorial/compile-install

I tried various random posts and stackoverflow but didnt really find any info about it! 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly I am down to not merging this because I had the same notion before opening this PR.

@maysunfaisal
Copy link
Member Author

Closing this, as I echo what John mentioned in the comment, I dont think we need this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants