oduwsdl / MemGator

A Memento Aggregator CLI and Server in Go
https://memgator.cs.odu.edu/api.html
MIT License
56 stars 11 forks source link

Fix crossbuild script to continue after invalid arch. #136

Closed machawk1 closed 3 years ago

machawk1 commented 3 years ago

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 commented 3 years ago

@ibnesayeed A subsequent PR will be to add support for arm64, which Apple silicon uses (see also https://github.com/machawk1/wail/issues/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 commented 3 years ago

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

ibnesayeed commented 3 years ago

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

machawk1 commented 3 years ago

@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?

ibnesayeed commented 3 years ago

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

machawk1 commented 3 years ago

@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 commented 3 years ago

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

machawk1 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

@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.