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 linux arm64 support in Constantine build #198

Closed
garyschulte opened this issue Aug 13, 2024 · 2 comments · Fixed by #203
Closed

Add linux arm64 support in Constantine build #198

garyschulte opened this issue Aug 13, 2024 · 2 comments · Fixed by #203
Assignees

Comments

@garyschulte
Copy link
Contributor

garyschulte commented Aug 13, 2024

Initial support for Constantine in besu-native in #184 omitted building for linux-arm64. Support for linux arm64 is mostly just a matter of getting nim installed in the CI build container for arm64, as the rest of the plumbing already exists.

choosenim-init: Error: Sorry, your platform (linux_arm64) is not supported by choosenim.
choosenim-init: Error: You will need to install Nim using an alternative method.
choosenim-init: Error: See the following link for more info: https://nim-lang.org/install.html

Originally posted by @garyschulte in #184 (comment)

@garyschulte
Copy link
Contributor Author

It appears that the mac support aarch64 and x86 are not getting included in the final artifact. The build version for 0.9.4 only includes linux x86 libs:

     0 Tue Aug 13 23:09:30 PDT 2024 META-INF/
   246 Tue Aug 13 23:09:30 PDT 2024 META-INF/MANIFEST.MF
     0 Tue Aug 13 23:09:30 PDT 2024 org/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/constantine/
  1939 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/constantine/LibConstantineEIP196.class
     0 Tue Aug 13 23:09:30 PDT 2024 lib/
     0 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/
 16608 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/libconstantineeip196.so
3116280 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/libconstantine.so

@garyschulte garyschulte changed the title Merging as-is, with an expectation that linux-arm64 will be added in a follow-on PR, as the CHOOSENIM install method does not work on linux arm64, and ubuntu does not have nim support until 23.10: Add linux arm64 support in Constantine build Aug 13, 2024
@NickSneo
Copy link
Contributor

NickSneo commented Aug 14, 2024

It appears that the mac support aarch64 and x86 are not getting included in the final artifact. The build version for 0.9.4 only includes linux x86 libs:

     0 Tue Aug 13 23:09:30 PDT 2024 META-INF/
   246 Tue Aug 13 23:09:30 PDT 2024 META-INF/MANIFEST.MF
     0 Tue Aug 13 23:09:30 PDT 2024 org/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/
     0 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/constantine/
  1939 Tue Aug 13 23:09:30 PDT 2024 org/hyperledger/besu/nativelib/constantine/LibConstantineEIP196.class
     0 Tue Aug 13 23:09:30 PDT 2024 lib/
     0 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/
 16608 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/libconstantineeip196.so
3116280 Tue Aug 13 23:09:30 PDT 2024 lib/linux-gnu-x86_64/libconstantine.so

I think it is due to this line of code -

def osName = System.getProperty('os.name').toLowerCase()
def osArch = System.getProperty('os.arch')
def libDir

if (osName.contains('mac') && osArch.contains('aarch64')) {
    libDir = 'darwin-aarch64'
} else if (osName.contains('mac')) {
    libDir = 'darwin-x86-64'
} else if (osName.contains('linux') && osArch.contains('aarch64')) {
    libDir = 'linux-gnu-aarch64'
} else {
    libDir = 'linux-gnu-x86_64'
}

task libCopy(type: Copy) {
    from "build/${libDir}/lib/"
    into "build/resources/main/lib/${libDir}"
}

It just copying lib for that particular OS_TYPE, whereas we need to copy lib for all the OS_TYPE in build.gradle
Will add a fix for this.

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 a pull request may close this issue.

2 participants