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

[native_toolchain_c] Setup Android RISCV64 toolchain. #165

Merged
merged 1 commit into from
Nov 28, 2023
Merged

[native_toolchain_c] Setup Android RISCV64 toolchain. #165

merged 1 commit into from
Nov 28, 2023

Conversation

rmacnak-google
Copy link
Contributor

No description provided.

@rmacnak-google
Copy link
Contributor Author

The failing tests are about Target.androidRiscv64 not being defined, but it is defined in this PR. Possibly the tests for native_toolchain_c are not using the version of native_assets_cli in this repository?

@dcharkes
Copy link
Collaborator

The failing tests are about Target.androidRiscv64 not being defined, but it is defined in this PR. Possibly the tests for native_toolchain_c are not using the version of native_assets_cli in this repository?

They don't have path dependencies on each other, they have dependencies via a published version on pub on each other.

@dcharkes
Copy link
Collaborator

The failing tests are about Target.androidRiscv64 not being defined, but it is defined in this PR. Possibly the tests for native_toolchain_c are not using the version of native_assets_cli in this repository?

They don't have path dependencies on each other, they have dependencies via a published version on pub on each other.

So this PR needs to be split into two PRs.

Copy link
Collaborator

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

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

LGTM for native_assets_cli changes (which need to land first)

@@ -38,6 +38,7 @@ class Architecture {
Abi.androidArm64: Architecture.arm64,
Abi.androidIA32: Architecture.ia32,
Abi.androidX64: Architecture.x64,
Abi.androidRiscv64: Architecture.riscv64,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file needs to be it's own PR + a version bump to 0.3.1 so that it can be published before the native_toolchain_c PR.

@rmacnak-google
Copy link
Contributor Author

Hm, actually, maybe this is premature because it would require a canary NDK to test and I'm not sure how the GitHub actions testing gets its NDK.

@dcharkes
Copy link
Collaborator

Hm, actually, maybe this is premature because it would require a canary NDK to test and I'm not sure how the GitHub actions testing gets its NDK.

- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b

@github-actions github-actions bot added type-infra A repository infrastructure change or enhancement and removed package:native_assets_cli labels Oct 26, 2023
@rmacnak-google rmacnak-google changed the title Setup Android RISCV64 toolchain. [native_toolchain_c] Setup Android RISCV64 toolchain. Oct 26, 2023
@@ -46,7 +46,7 @@ jobs:

- uses: nttld/setup-ndk@dbacc5871a0fac6eef9a09d2ca86bc8bf79432c3
with:
ndk-version: r25b
ndk-version: r27
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't work / not available from the source. Only increasing to r26b now.

I'm surprised the tests pass now. Are they only looking for the toolchain binaries but not invoking them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

image

This should be invoking the tools you could double check the dylibs locally to see that it's build for the right arch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, it uses -nostartfiles and links with nothing, so it's okay will all the standard libraries not existing yet :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please file an issue that we should add tests for that on this repo.

@github-actions github-actions bot added type-infra A repository infrastructure change or enhancement and removed type-infra A repository infrastructure change or enhancement labels Oct 27, 2023
auto-submit bot pushed a commit that referenced this pull request Nov 1, 2023
Addresses: #165 (comment)

This is in line with what CMake does, so it's probably a more reasonable thing to do than `-nostartfiles`.

The documentation says the sysroot should be auto-discovered on NDKs newer than 22, but it doesn't seem to break the newer versions, so maybe lets just keep the logic consistent for various NDK versions.

We probably need a workaround for #165 temporarily.
@github-actions github-actions bot removed the type-infra A repository infrastructure change or enhancement label Nov 3, 2023
@coveralls
Copy link

Coverage Status

coverage: 97.993% (+0.001%) from 97.992%
when pulling 3e0a9c3 on rmacnak-google:android-riscv64
into c72ed16 on dart-lang:main.

HosseinYousefi pushed a commit that referenced this pull request Nov 16, 2023
Addresses: #165 (comment)

This is in line with what CMake does, so it's probably a more reasonable thing to do than `-nostartfiles`.

The documentation says the sysroot should be auto-discovered on NDKs newer than 22, but it doesn't seem to break the newer versions, so maybe lets just keep the logic consistent for various NDK versions.

We probably need a workaround for #165 temporarily.
@@ -17,20 +17,24 @@ void main() {
Target.androidArm64,
Target.androidIA32,
Target.androidX64,
// TODO(rmacnak): Enable when stable NDK 27 is available.
// Target.androidRiscv64,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rmacnak-google Can this PR be landed or are we blocked on having NDK 27?

It looks like that will be only in the new year: https://github.com/android/ndk/wiki#ndk-r27-lts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can land this if you're okay with leaving this test disabled, otherwise we need to wait for NDK 27.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay lets land it then 👍 The changes eyeballed look good.

@auto-submit auto-submit bot merged commit 50b6a78 into dart-lang:main Nov 28, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants