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(ci): properly set os and architecture for nightly and release #1780

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

vpavlin
Copy link
Member

@vpavlin vpavlin commented Jun 5, 2023

Description

This PR updates config.nims according to findings by Nimbus about various CPU archs and options (https://github.com/status-im/nimbus-eth2/blob/stable/config.nims#L94). It also updates release workflows (Nightly and actual releases) to leverage these options.

Next, it adds arm64 architecture for Mac OSX system to make the released assets run on Apple M1 hardware (cc @alrevuelta)

This also reverts #1759 which was an interim solution to enable compatibility between various CPU architectures.

Lastly, it changes the name of the uploaded binary artifacts to

nwaku-${{matrix.arch}}-${{runner.os}}.tar.gz

i.e.

nwaku-arm64-macos.tar.gz
nwaku-amd64-linux.tar.gz

See the example nightly release here: https://github.com/nwaku-test-org/nwaku/releases/tag/nightly

Changes

  • Add arm64 architecture for Mac OSX system in the build matrix
  • Update the CPU configuration when native architecture is disabled (according to Nimbus)
  • Remove the default -march=x86_64 from Makefile
  • Rename binary release artifact tarball from nim-waku-${OS}-latest.tar.gz to nwaku-${{arch}}-${{os}}.tar.gz

Issue

closes #1760

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for it!
Just a question whether we could somehow test the build in a Windows machine. Maybe we would need to set up a Windows runner for that ?

@@ -41,8 +56,9 @@ else:
if defined(windows):
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782
# ("-fno-asynchronous-unwind-tables" breaks Nim's exception raising, sometimes)
switch("passC", "-mno-avx512vl")
switch("passL", "-mno-avx512vl")
switch("passC", "-mno-avx512f")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a way to test this works?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are no building for Windows right now, so no, we do not really have a reasonable way to fix this. On the other hand this is "just" to prevent the compiler to enable these abx512f instructions which was the initial reason to look into this. Once we start building for Windows, we'll also want to verify the build artifacts work:) For now it is just a "dumb" copy of best practices from Nimbus:)

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Thanks!

@vpavlin vpavlin merged commit 44bcf0f into master Jun 6, 2023
@vpavlin vpavlin deleted the chore/cpu-arch branch June 6, 2023 15:41
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.

chore: asses and configure target CPU architecture properly
3 participants