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

chore: refactor Makefile #354

Merged
merged 7 commits into from
Jun 28, 2022
Merged

Conversation

tricktron
Copy link
Contributor

Changes

  • Extract the build logic from build.sh to the Makefile: This makes it easier to override variables to customise the build, e.g we can overwrite VERSION or OUTPUT_DIR variables more easily. This is especially useful for package manager like nix.
  • Uses openssl to calculate the sha256 because it is both available on linux and macOS, so we don't need to check the OS.
  • Adds a test rule: Allows to easily run the tests with: make test.

@abiosoft
Copy link
Owner

Thanks :)

Makefile Show resolved Hide resolved
@tricktron
Copy link
Contributor Author

@abiosoft I still need/want to test this with nix. So can you hold on with the merge?

@abiosoft
Copy link
Owner

@abiosoft I still need/want to test this with nix. So can you hold on with the merge?

That's fine by me. You can also mark the PR as draft and mark it as ready when you're done.

@tricktron tricktron marked this pull request as draft June 27, 2022 08:23
@tricktron tricktron force-pushed the f-refactor-makefile-pr branch from 3480ca1 to 80dccea Compare June 28, 2022 07:42
@tricktron tricktron marked this pull request as ready for review June 28, 2022 08:11
@tricktron
Copy link
Contributor Author

@abiosoft I tested it with nix and it works. Could you run the workflows/tests to check if it does not break anything?

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@abiosoft abiosoft changed the title Refactor Makefile chore: refactor Makefile Jun 28, 2022
@abiosoft abiosoft merged commit 656ae6d into abiosoft:main Jun 28, 2022
@tricktron tricktron deleted the f-refactor-makefile-pr branch June 28, 2022 17:36
abiosoft added a commit that referenced this pull request Jun 28, 2022
* refactor: extract build logic from build.sh to Makefile

* chore: add test rule to Makefile

* apply review suggestion

Co-authored-by: Abiola Ibrahim <[email protected]>

* fix: use defined `OUTPUT_DIR` variable

* chore: remove -race flag from test as it needs CGO_ENABLED=1

* chore: generate sha in binaries directory

* chore: propagate Go build environment variables

Co-authored-by: Abiola Ibrahim <[email protected]>
abiosoft added a commit that referenced this pull request Jun 29, 2022
* chore: move CGO_ENABLE arg to makefile

* chore: use actual current executable path

* chore: fix generated binary on M1 mac

* net: fix #344 qemu process missing gvproxy config

* chore: update gitignore

* chore: refactor, mock filesystem in tests

* chore: update nix environment

* chore: refactor Makefile (#354)

* refactor: extract build logic from build.sh to Makefile

* chore: add test rule to Makefile

* apply review suggestion

Co-authored-by: Abiola Ibrahim <[email protected]>

* fix: use defined `OUTPUT_DIR` variable

* chore: remove -race flag from test as it needs CGO_ENABLED=1

* chore: generate sha in binaries directory

* chore: propagate Go build environment variables

Co-authored-by: Abiola Ibrahim <[email protected]>

* chore: disable CGO

* chore: remove empty file

Co-authored-by: tricktron <[email protected]>
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.

2 participants