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

Fix crossbuild script to continue after invalid arch. #136

Merged
merged 7 commits into from
Apr 5, 2021
Merged

Conversation

machawk1
Copy link
Member

@machawk1 machawk1 commented Apr 2, 2021

This PR accounts for invalid architectures in the crossbuild script and closes #135.

I adjusted the bash script to print a message if the architecture combo used to build fails. Executing the revised script produces the binaries in /tmp/mgbins: memgator-darwin-amd64, memgator-windows-386.exe, memgator-linux-386, memgator-windows-amd64.exe, memgator-linux-amd64.

@machawk1 machawk1 requested a review from ibnesayeed April 2, 2021 21:00
Copy link
Member

@ibnesayeed ibnesayeed left a comment

Choose a reason for hiding this comment

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

I did not like the idea of inconsistent builds and silently ignoring the error. This change will let the script exit with success even if the build failed due to reasons other than the OS/Arch combo not supported.

Let's just get rid of the 32 bit builds for all OSes and change line 14 to:

arcs="amd64"

@machawk1
Copy link
Member Author

machawk1 commented Apr 2, 2021

@ibnesayeed A subsequent PR will be to add support for arm64, which Apple silicon uses (see also machawk1/wail#494), but I am unsure if the other permutations exist (e.g., arm64+linux, arm64+windows).

Any way you accomplish it, there needs to be a change for the script to work as expected with the currently listed permutations.

@ibnesayeed
Copy link
Member

I would simply remove the loop and include 3-4 flat lines with commands for each combination we want.

@ibnesayeed
Copy link
Member

@machawk1 I have pushed a few changes to this branch. See if that works for you.

@machawk1
Copy link
Member Author

machawk1 commented Apr 5, 2021

@ibnesayeed Your changes work for me and produce three binaries. What are your thoughts on adding darwin/arm64 while we are at it to support Apple Silicon...or would you rather that be a separate PR?

@machawk1 machawk1 requested a review from ibnesayeed April 5, 2021 17:59
@ibnesayeed
Copy link
Member

Please go ahead and add the new platform entry in this PR. Also, please test the binary, if you have that machine available.

@machawk1
Copy link
Member Author

machawk1 commented Apr 5, 2021

@ibnesayeed I built for the additional platform and did some rudimentary tests with the binary on a machine with that platform. If you want some further tests or for me to run automated tests on the additional platform, let me know.

@ibnesayeed
Copy link
Member

I have fixed the GH Workflow issues and this is good to go.

@ibnesayeed ibnesayeed merged commit 3ddd45d into master Apr 5, 2021
@ibnesayeed ibnesayeed deleted the issue-135 branch April 5, 2021 20:44
@machawk1
Copy link
Member Author

machawk1 commented Apr 5, 2021

@ibnesayeed Good! I meant to mention that after the last PR but also experienced an issue with Golang resolving the mflag package in my older Golang installation prior to submitting this PR/issue.

@ibnesayeed
Copy link
Member

@machawk1 is the mflag package resolution still an issue? Things were changed when Golang moved to modules for dependencies. I noticed that go.mod file is still referencing to Go 1.14, which should be changed to 1.16 now.

@machawk1
Copy link
Member Author

machawk1 commented Apr 6, 2021

@ibnesayeed After updating my Go version, the mflag issues was no longer reported. Of note, though likely insignificant, I have yet to build MemGator on arm64 for lack of the environment (still a new machine). In the above, I built it on amd64, transferred the arm64 binary to the arm64 machine, and ran it with success.

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.

Crossbuild script produces incomplete results with invalid architectures
2 participants