Skip to content

[native_toolchain_c] Support MSVC arm64 toolchain #167

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

Merged
merged 1 commit into from
Oct 30, 2023
Merged

[native_toolchain_c] Support MSVC arm64 toolchain #167

merged 1 commit into from
Oct 30, 2023

Conversation

pbo-linaro
Copy link
Contributor

This PR adds support to be able to compile native-assets on windows-arm64.

It seems to be what is needed to compile windows-arm64 flutter apps, as discussed initially here.

@dcharkes I'm not sure which tests to update exactly. Since windows-arm64 runners are not available for this repository, will we still be able to test this? In more, do existing x64 runners have installed msvc arm64 toolchain?

@dcharkes
Copy link
Collaborator

@dcharkes I'm not sure which tests to update exactly. Since windows-arm64 runners are not available for this repository, will we still be able to test this?

I think we have to rely on you testing this locally inside flutter_tools on an arm64 Windows host.

In more, do existing x64 runners have installed msvc arm64 toolchain?

I wouldn't think so, but you can try adding a test and see if the arm64 executables can be found on the Windows bot.

@pbo-linaro
Copy link
Contributor Author

Ok. Locally I can test this, no problem.
To enable flutter windows-arm64 support, we'll need to have a new version of native_toolchain_c published, so it can be referenced in pubspec.yaml.

I'll try to add a new test here to see if it works on windows-x64 hosts.

@dcharkes
Copy link
Collaborator

To enable flutter windows-arm64 support, we'll need to have a new version of native_toolchain_c published, so it can be referenced in pubspec.yaml.

Please bump the version in the pubspec and add an entry to the changelog.md for that.

@pbo-linaro
Copy link
Contributor Author

Please bump the version in the pubspec and add an entry to the changelog.md for that.

Will do once you're okay with changes and tests are passing.

@pbo-linaro
Copy link
Contributor Author

Updated tests to see how it goes.
I fixed vcvarsX from cl.exe tests which were not testing the right vcvars was found.

@dcharkes
Copy link
Collaborator

(to be squashed)

PRs are squashed on merge in most (or all) of Dart/Flutter repos.

@dcharkes
Copy link
Collaborator

Hm, seems like we have a bunch of failures due to #161 (comment).

@dcharkes
Copy link
Collaborator

I have retracted package:native_assets_cli v0.3.1, try pushing a commit.

@pbo-linaro
Copy link
Contributor Author

pbo-linaro commented Oct 27, 2023

No problem, I rebased on top of commit parent of #161.

@coveralls
Copy link

coveralls commented Oct 27, 2023

Coverage Status

coverage: 97.988% (-0.09%) from 98.079% when pulling eadce16 on pbo-linaro:windows-arm64 into 9629a55 on dart-lang:main.

@pbo-linaro
Copy link
Contributor Author

Tests were successful, so arm64 toolchain is available on runners 👍.
Bumped version and added an entry in changelog.

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.

image

🚀

Some small comments left.

Thanks @pbo-linaro!

@pbo-linaro
Copy link
Contributor Author

Implemented changes required by open discussions.
I checked built example with native assets create a windows-arm64 dll with expected symbols.
I still have a problem with symbol not being loaded (using flutter test), but I think it's something on flutter side, so this PR should be complete.

@dcharkes
Copy link
Collaborator

See the bots: we have some analysis failures:

      error - lib/src/native_toolchain/msvc.dart:81:11 - The argument type 'dynamic' can't be assigned to the parameter type 'String'. - argument_type_not_assignable
      error - lib/src/native_toolchain/msvc.dart:83:17 - The argument type 'dynamic' can't be assigned to the parameter type 'String'. - argument_type_not_assignable
    warning - lib/src/native_toolchain/msvc.dart:66:9 - The type of fileName can't be inferred without either a type or initializer. Try specifying the type of the variable. - inference_failure_on_uninitialized_variable
       info - lib/src/native_toolchain/msvc.dart:66:9 - An uninitialized variable should have an explicit type annotation. Try adding a type annotation. - prefer_typing_uninitialized_variables

@pbo-linaro
Copy link
Contributor Author

Fixed, final fileName; required explicit typing.

@dcharkes dcharkes merged commit 279094d into dart-lang:main Oct 30, 2023
@pbo-linaro
Copy link
Contributor Author

Thanks @dcharkes for quick interactions, that was a fun ride!

@pbo-linaro
Copy link
Contributor Author

pbo-linaro commented Oct 30, 2023

Will the new version for native_toolchain_c (0.3.1) be published automatically, or do you tag it manually?

@dcharkes
Copy link
Collaborator

I've created a release+tag. It should be published automatically now.

@pbo-linaro
Copy link
Contributor Author

I can use it now, perfect! Thanks

@dcharkes
Copy link
Collaborator

Well, thank you! 🙏

HosseinYousefi pushed a commit that referenced this pull request Nov 16, 2023
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 19eeec562b37d29a1ad055b7de9c280bd0906d8d to 308abcba03229002f0055e17d79d00c32fca160f.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@19eeec5...308abcb)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
HosseinYousefi pushed a commit that referenced this pull request Nov 16, 2023
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 19eeec562b37d29a1ad055b7de9c280bd0906d8d to 308abcba03229002f0055e17d79d00c32fca160f.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@19eeec5...308abcb)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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