[pkgs/native] MacOS support + CI

Pulls in a new versions of https://github.com/dart-lang/native with
support for MacOS and enables the tests for these on the MacOS pkg
bots.

Fixes the clang paths in pkg/test_runner/lib/src/options.dart for
mac and win.

Since a relatively recent XCode is available on the bots, use XCode
to build rather than the clang from DEPS.

test/native_toolchain/recognizer_test was refactored to only
run tests for tools installed on the host. So it's unskipped.

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: I3804b01da7a4e74d3e49a1b2ba3c8425132417d7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296180
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This commit is contained in:
Daco Harkes 2023-04-20 14:17:39 +00:00 committed by Commit Queue
parent 4e8b58ceb9
commit 4cb4d5d036
4 changed files with 23 additions and 5 deletions

3
DEPS
View file

@ -151,7 +151,7 @@ vars = {
"matcher_rev": "cb6b68c603d2c57a51bbddfff08fa211bba7dcd3",
"mime_rev": "2d8496df6a6e851816610c3f99eae0d9663f54c4",
"mockito_rev": "28e8eda2ef16f2e9c5e2e8fef48a834afd33ce44",
"native_rev": "a547d0cb57699fce5e0940b593c673f310c56a0c",
"native_rev": "9350cb71d44635f2ecb3a876f570045526e02543", # disable rev_sdk_deps.dart
"package_config_rev": "7e09db12e968482ef81e309de3ce233463b4cd7e",
"path_rev": "23e33194c4073c0fdd818a70dd944afd5ad206e6",
"pool_rev": "650e5d3eff10529c65ef45b5fcb4bca270c7ea8f",
@ -479,6 +479,7 @@ deps = {
Var("dart_root") + "/third_party/pkg/yaml":
Var("dart_git") + "yaml.git" + "@" + Var("yaml_rev"),
# Keep consistent with pkg/test_runner/lib/src/options.dart.
Var("dart_root") + "/buildtools/linux-x64/clang": {
"packages": [
{

View file

@ -1039,7 +1039,21 @@ final Map<String, String> sanitizerEnvironmentVariables = (() {
})();
final Map<String, String> nativeCompilerEnvironmentVariables = (() {
final hostFolderName = Abi.current().toString().replaceAll('_', '-');
if (Platform.isMacOS) {
// Use XCode instead, it has the right sysroot by default.
return <String, String>{};
}
// Keep consistent with DEPS.
const clangHostFolderName = {
Abi.linuxArm64: 'linux-arm64',
Abi.linuxX64: 'linux-x64',
Abi.macosArm64: 'mac-arm64',
Abi.macosX64: 'mac-x64',
Abi.windowsX64: 'win-x64',
};
final hostFolderName = clangHostFolderName[Abi.current()]!;
final clangBin =
Directory.current.uri.resolve('buildtools/$hostFolderName/clang/bin/');
return {

View file

@ -13,8 +13,11 @@ test/native_toolchain/ndk_test: SkipByDesign # Cross compilation is not tested o
[ $system == linux ]
test/cbuilder/compiler_resolver_test: SkipByDesign # Toolchains not installed in default locations on Dart CI.
test/native_toolchain/clang_test: SkipByDesign # Toolchains not installed in default locations on Dart CI.
test/native_toolchain/recognizer_test: SkipByDesign # Toolchains not installed in default locations on Dart CI.
test/tool/tool_resolver_test: SkipByDesign # Toolchains not installed in default locations on Dart CI.
[ $system != linux ]
[ $system == macos ]
test/cbuilder/cbuilder_cross_ios_test: SkipByDesign # XCode on Dart CI doesn't have the iphonesimulator SDK.
test/native_toolchain/xcode_test: SkipByDesign # XCode on Dart CI doesn't have the iphonesimulator SDK.
[ $system != linux && $system != macos ]
*: Skip # Non-Linux not yet implemented upstream.

View file

@ -5,5 +5,5 @@
[ $runtime != vm ]
*: SkipByDesign # Native assets is a VM-only feature.
[ $system != linux ]
[ $system != linux && $system != macos ]
*: Skip # Non-Linux not yet implemented upstream.