Skip to content

Commit

Permalink
Merge branch 'dart-lang:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem authored Aug 13, 2024
2 parents b7edaa5 + 1fb3117 commit 44451c8
Show file tree
Hide file tree
Showing 145 changed files with 15,563 additions and 205 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pkgs/intl4x/lib/src/bindings/* linguist-generated=true
4 changes: 2 additions & 2 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Download Reference Exec Summary
if: github.ref != 'refs/heads/main'
continue-on-error: true
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: reference_exec_summary

Expand All @@ -47,7 +47,7 @@ jobs:

- name: Upload Reference Summary iff on main branch
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: reference_exec_summary
path: conformance/TEMP_DATA/testReports/exec_summary.json
116 changes: 114 additions & 2 deletions .github/workflows/intl4x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:
- cron: '0 0 * * 0' # weekly

jobs:
build:
runs-on: ubuntu-latest
build_checkout:
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: checkout
Expand All @@ -29,6 +29,7 @@ jobs:
strategy:
matrix:
sdk: [stable, dev] # {pkgs.versions}
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- sdk: dev
run-tests: true
Expand All @@ -53,3 +54,114 @@ jobs:

- run: dart --enable-experiment=native-assets test -p chrome
if: ${{matrix.run-tests}}

build_fetch:
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: fetch

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

defaults:
run:
working-directory: pkgs/intl4x

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true

- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: dev

- run: dart --enable-experiment=native-assets pub get

- run: dart --enable-experiment=native-assets test

build_local:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: local

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true

- name: Install Rust toolchains
run: |
rustup toolchain install stable
- name: Show the selected Rust toolchain
run: rustup show

- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: dev

- name: Build Linux
if: matrix.os == 'ubuntu-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/linux_x64 linux_x64 dynamic default_components,experimental_components
- name: Build Mac
if: matrix.os == 'macos-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64 macos_arm64 dynamic default_components,experimental_components
- name: Build Windows
if: matrix.os == 'windows-latest'
run: |
cd submodules/icu4x
mkdir bin
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/windows_x64 windows_x64 dynamic default_components,experimental_components
- run: echo "LOCAL_ICU4X_BINARY=$(realpath submodules/icu4x/bin/linux_x64)" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'

- run: echo "LOCAL_ICU4X_BINARY=$(realpath submodules/icu4x/bin/macos_arm64)" >> $GITHUB_ENV
if: matrix.os == 'macos-latest'

- run: echo ("LOCAL_ICU4X_BINARY=" + (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\') >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'

- run: echo $LOCAL_ICU4X_BINARY

- name: Display structure of downloaded files
run: ls -R

- run: |
cd pkgs/intl4x
dart pub get
- run: |
cd pkgs/intl4x
dart --enable-experiment=native-assets test
85 changes: 61 additions & 24 deletions .github/workflows/intl4x_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ permissions:
contents: write

on:
pull_request:
branches: [ main ]
paths:
- pkgs/intl4x/hook/hashes.dart
push:
tags:
- 'intl4x-v.*'
- 'intl4x-icu*'
schedule:
- cron: '0 0 * * 0' # weekly
workflow_dispatch:

jobs:
dart-libs:
name: "Build Dart binaries"
name: Build Dart binaries
strategy:
fail-fast: false
matrix:
Expand All @@ -21,7 +27,7 @@ jobs:
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: 'true'
submodules: true

- name: Install Rust toolchains
run: |
Expand Down Expand Up @@ -59,14 +65,14 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/android_arm android_arm
dart run ffi/dart/tool/build_libs.dart bin/android_arm64 android_arm64
dart run ffi/dart/tool/build_libs.dart bin/android_ia32 android_ia32
dart run ffi/dart/tool/build_libs.dart bin/android_x64 android_x64
dart run ffi/dart/tool/build_libs.dart bin/linux_arm linux_arm
dart run ffi/dart/tool/build_libs.dart bin/linux_arm64 linux_arm64
dart run ffi/dart/tool/build_libs.dart bin/linux_riscv64 linux_riscv64
dart run ffi/dart/tool/build_libs.dart bin/linux_x64 linux_x64
dart run ffi/dart/tool/build_libs.dart bin/android_arm android_arm dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/android_arm64 android_arm64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/android_ia32 android_ia32 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/android_x64 android_x64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/linux_arm linux_arm dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/linux_arm64 linux_arm64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/linux_riscv64 linux_riscv64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/linux_x64 linux_x64 dynamic default_components,experimental_components
cargo run -p icu_datagen -- --locales full --keys all --format blob --out bin/full.postcard
Expand All @@ -93,11 +99,11 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/ios_arm ios_arm
dart run ffi/dart/tool/build_libs.dart bin/ios_arm64 ios_arm64
dart run ffi/dart/tool/build_libs.dart bin/ios_x64 ios_x64
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64 macos_arm64
dart run ffi/dart/tool/build_libs.dart bin/macos_x64 macos_x64
dart run ffi/dart/tool/build_libs.dart bin/ios_arm ios_arm dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/ios_arm64 ios_arm64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/ios_x64 ios_x64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64 macos_arm64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/macos_x64 macos_x64 dynamic default_components,experimental_components
cd provider/datagen # avoid global feature resolution
rustup target add aarch64-apple-darwin
Expand All @@ -119,9 +125,9 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/windows_arm64 windows_arm64
dart run ffi/dart/tool/build_libs.dart bin/windows_ia32 windows_ia32
dart run ffi/dart/tool/build_libs.dart bin/windows_x64 windows_x64
dart run ffi/dart/tool/build_libs.dart bin/windows_arm64 windows_arm64 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/windows_ia32 windows_ia32 dynamic default_components,experimental_components
dart run ffi/dart/tool/build_libs.dart bin/windows_x64 windows_x64 dynamic default_components,experimental_components
cd provider/datagen # avoid global feature resolution
rustup target add aarch64-pc-windows-msvc
Expand All @@ -134,25 +140,56 @@ jobs:
cp target/x86_64-pc-windows-msvc/release/icu4x-datagen.exe bin/windows_x64-datagen.exe
- name: Upload artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: dart-${{matrix.os}}-libs
path: submodules/icu4x/bin


check_hashes:
needs: dart-libs
runs-on: ubuntu-latest

env:
ICU4X_BUILD_MODE: local

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true

- name: Download binaries
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
merge-multiple: true

- name: Display structure of downloaded files
run: ls -R

- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: dev

- name: Check hashes of released artifacts
run: |
cd pkgs/intl4x
dart pub get
dart --enable-experiment=native-assets tool/generate_hashes.dart
git diff --exit-code
release:
needs: dart-libs
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Download binaries
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16

- name: Display structure of downloaded files
run: ls -R

- name: Release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
files: '**'
fail_on_unmatched_files: true
body: "Build artifacts for `package:intl4x`, based on ICU4X at ref ${{ env.icu_version }}"
body: "Build artifacts for `package:intl4x`, based on ICU4X at ref ${{ github.ref_name }}"
1 change: 1 addition & 0 deletions pkgs/intl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Require `package:web` `^0.5.0`.
* Support compiling to WASM.
* Update to and account for `package:lints` `^4.0.0`.
* rtl Detection fix in `bidi.dart` for Kordi Sorani "ckb".

## 0.19.0
* Update to CLDR v44.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/intl/lib/src/intl/bidi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Bidi {
}

static final _rtlLocaleRegex = RegExp(
r'^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]'
r'^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]'
r'(Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))'
r'($|-|_)',
caseSensitive: false);
Expand Down
1 change: 1 addition & 0 deletions pkgs/intl/test/bidi_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void main() {
expect(Bidi.isRtlLanguage('az-Arab'), isTrue);
expect(Bidi.isRtlLanguage('az-ARAB-IR'), isTrue);
expect(Bidi.isRtlLanguage('az_arab_IR'), isTrue);
expect(Bidi.isRtlLanguage('ckb'), isTrue);
Intl.withLocale('en_US', () {
expect(Bidi.isRtlLanguage(), isFalse);
});
Expand Down
7 changes: 6 additions & 1 deletion pkgs/intl4x/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## 0.9.2-wip

- Copy files instead of symlinking, for easier upgrading.
- Get binaries from Github and check their hashes.

## 0.9.1

- Small fixes in imports
- Small fixes in imports.

## 0.9.0

Expand Down
14 changes: 14 additions & 0 deletions pkgs/intl4x/hook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### How to update the ICU4X version used in package:intl4x.

#### First PR
1. Create PR.
2. Update `submodules/icu4x` to whatever branch/hash you want.
3. Land PR.
4. Tag with `intl4x-icu*`, push. This creates new release with the new binaries.

#### Second PR
1. Create PR.
2. Run `bash tools/regenerate_bindings.sh`, and fix resulting errors.
3. Update `const version` in `hook/version.dart` to tag.
4. Regenerate hashes using `dart --enable-experiment=native-assets run tool/generate_hashes.dart`.
5. Land PR.
Loading

0 comments on commit 44451c8

Please sign in to comment.