From 6a24a65a61d11d28a7c4e6613127c543449e5d54 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 11 Jul 2023 13:14:12 -0700 Subject: [PATCH 01/23] first commit --- .../.github/dependabot.yaml | 10 ++++++ .../.github/workflows/dart.yaml | 35 +++++++++++++++++++ pkgs/native_synchronization/.gitignore | 10 ++++++ pkgs/native_synchronization/CHANGELOG.md | 3 ++ pkgs/native_synchronization/LICENSE | 27 ++++++++++++++ pkgs/native_synchronization/README.md | 22 ++++++++++++ .../analysis_options.yaml | 1 + pkgs/native_synchronization/lib/sample.dart | 7 ++++ pkgs/native_synchronization/pubspec.yaml | 14 ++++++++ 9 files changed, 129 insertions(+) create mode 100644 pkgs/native_synchronization/.github/dependabot.yaml create mode 100644 pkgs/native_synchronization/.github/workflows/dart.yaml create mode 100644 pkgs/native_synchronization/.gitignore create mode 100644 pkgs/native_synchronization/CHANGELOG.md create mode 100644 pkgs/native_synchronization/LICENSE create mode 100644 pkgs/native_synchronization/README.md create mode 100644 pkgs/native_synchronization/analysis_options.yaml create mode 100644 pkgs/native_synchronization/lib/sample.dart create mode 100644 pkgs/native_synchronization/pubspec.yaml diff --git a/pkgs/native_synchronization/.github/dependabot.yaml b/pkgs/native_synchronization/.github/dependabot.yaml new file mode 100644 index 00000000..439e796b --- /dev/null +++ b/pkgs/native_synchronization/.github/dependabot.yaml @@ -0,0 +1,10 @@ +# Dependabot configuration file. +version: 2 + +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + labels: + - autosubmit diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml new file mode 100644 index 00000000..fba0a6c4 --- /dev/null +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -0,0 +1,35 @@ +name: Dart + +on: + schedule: + # “At 00:00 (UTC) on Sunday.” + - cron: '0 0 * * 0' + push: + branches: [ main ] + pull_request: + branches: [ main ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # These are the latest versions of the github actions; dependabot will + # send PRs to keep these up-to-date. + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + + - name: Install dependencies + run: dart pub get + + - name: Verify formatting + run: dart format --output=none --set-exit-if-changed . + + - name: Analyze project source + run: dart analyze --fatal-infos + + # - name: Run tests + # run: dart test diff --git a/pkgs/native_synchronization/.gitignore b/pkgs/native_synchronization/.gitignore new file mode 100644 index 00000000..65c34dc8 --- /dev/null +++ b/pkgs/native_synchronization/.gitignore @@ -0,0 +1,10 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build outputs. +build/ + +# Omit committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/pkgs/native_synchronization/CHANGELOG.md b/pkgs/native_synchronization/CHANGELOG.md new file mode 100644 index 00000000..1b9970e5 --- /dev/null +++ b/pkgs/native_synchronization/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.1.0-wip + +- Initial version. diff --git a/pkgs/native_synchronization/LICENSE b/pkgs/native_synchronization/LICENSE new file mode 100644 index 00000000..4fd5739c --- /dev/null +++ b/pkgs/native_synchronization/LICENSE @@ -0,0 +1,27 @@ +Copyright 2023, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkgs/native_synchronization/README.md b/pkgs/native_synchronization/README.md new file mode 100644 index 00000000..80d064c3 --- /dev/null +++ b/pkgs/native_synchronization/README.md @@ -0,0 +1,22 @@ +[![Dart](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml/badge.svg)](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml) + +Low level synchronization primitives built on dart:ffi. + +## TODO: Projects docs + +TODO: Add a brief project description here. + +## Status: experimental + +**NOTE**: This package is currently experimental and published under the +[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to +solicit feedback. + +For packages in the labs.dart.dev publisher we generally plan to either graduate +the package into a supported publisher (dart.dev, tools.dart.dev) after a period +of feedback and iteration, or discontinue the package. These packages have a +much higher expected rate of API and breaking changes. + +Your feedback is valuable and will help us evolve this package. For general +feedback, suggestions, and comments, please file an issue in the +[bug tracker](https://github.com/dart-lang/native_synchronization/issues). diff --git a/pkgs/native_synchronization/analysis_options.yaml b/pkgs/native_synchronization/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/native_synchronization/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/native_synchronization/lib/sample.dart b/pkgs/native_synchronization/lib/sample.dart new file mode 100644 index 00000000..ca6b24ea --- /dev/null +++ b/pkgs/native_synchronization/lib/sample.dart @@ -0,0 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void main(List args) { + print('hello world'); +} diff --git a/pkgs/native_synchronization/pubspec.yaml b/pkgs/native_synchronization/pubspec.yaml new file mode 100644 index 00000000..299b70e4 --- /dev/null +++ b/pkgs/native_synchronization/pubspec.yaml @@ -0,0 +1,14 @@ +name: native_synchronization +description: Low level synchronization primitives built on dart:ffi. +version: 0.1.0-wip +repository: https://github.com/dart-lang/native_synchronization + +environment: + sdk: ^3.0.0 + +dependencies: + # lib_name: ^1.2.0 + +dev_dependencies: + dart_flutter_team_lints: ^1.0.0 + test: ^1.16.0 From 5183e24e0f8841282c9ae17419947787591a32ab Mon Sep 17 00:00:00 2001 From: Slava Egorov Date: Mon, 7 Aug 2023 15:58:10 +0200 Subject: [PATCH 02/23] Update workflow to run tests on all OSes (dart-lang/native_synchronization#3) --- .../.github/workflows/dart.yaml | 25 ++++++++++++++++--- .../test/primitives_test.dart | 9 +++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 pkgs/native_synchronization/test/primitives_test.dart diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index fba0a6c4..1d1bc071 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -13,7 +13,7 @@ on: permissions: read-all jobs: - build: + analyze: runs-on: ubuntu-latest steps: @@ -21,15 +21,32 @@ jobs: # send PRs to keep these up-to-date. - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + with: + sdk: dev - name: Install dependencies run: dart pub get - + - name: Verify formatting run: dart format --output=none --set-exit-if-changed . - name: Analyze project source run: dart analyze --fatal-infos - # - name: Run tests - # run: dart test + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + sdk: [dev] + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + with: + sdk: ${{ matrix.sdk }} + + - name: Install dependencies + run: dart pub get + + - name: Run tests + run: dart test diff --git a/pkgs/native_synchronization/test/primitives_test.dart b/pkgs/native_synchronization/test/primitives_test.dart new file mode 100644 index 00000000..d68b515e --- /dev/null +++ b/pkgs/native_synchronization/test/primitives_test.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:test/test.dart'; + +void main() { + test('dummy', () {}); +} From 473f72ad884a284e23a8e7476a2ac2bb7671b72a Mon Sep 17 00:00:00 2001 From: Slava Egorov Date: Wed, 9 Aug 2023 13:21:10 +0200 Subject: [PATCH 03/23] Initial implementation of the package. (dart-lang/native_synchronization#2) --- .../.github/workflows/dart.yaml | 1 + pkgs/native_synchronization/.gitignore | 3 + pkgs/native_synchronization/CHANGELOG.md | 2 + pkgs/native_synchronization/README.md | 12 +- pkgs/native_synchronization/lib/mailbox.dart | 125 ++++++++++++++++++ pkgs/native_synchronization/lib/posix.dart | 93 +++++++++++++ .../lib/primitives.dart | 117 ++++++++++++++++ pkgs/native_synchronization/lib/sample.dart | 7 - pkgs/native_synchronization/lib/sendable.dart | 21 +++ .../lib/src/bindings/pthread.dart | 38 ++++++ .../lib/src/bindings/winapi.dart | 32 +++++ pkgs/native_synchronization/lib/windows.dart | 74 +++++++++++ pkgs/native_synchronization/pubspec.yaml | 4 +- .../test/mailbox_test.dart | 32 +++++ .../test/primitives_test.dart | 112 +++++++++++++++- 15 files changed, 657 insertions(+), 16 deletions(-) create mode 100644 pkgs/native_synchronization/lib/mailbox.dart create mode 100644 pkgs/native_synchronization/lib/posix.dart create mode 100644 pkgs/native_synchronization/lib/primitives.dart delete mode 100644 pkgs/native_synchronization/lib/sample.dart create mode 100644 pkgs/native_synchronization/lib/sendable.dart create mode 100644 pkgs/native_synchronization/lib/src/bindings/pthread.dart create mode 100644 pkgs/native_synchronization/lib/src/bindings/winapi.dart create mode 100644 pkgs/native_synchronization/lib/windows.dart create mode 100644 pkgs/native_synchronization/test/mailbox_test.dart diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 1d1bc071..f6a4ea58 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -34,6 +34,7 @@ jobs: run: dart analyze --fatal-infos test: + needs: analyze runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/pkgs/native_synchronization/.gitignore b/pkgs/native_synchronization/.gitignore index 65c34dc8..52160c45 100644 --- a/pkgs/native_synchronization/.gitignore +++ b/pkgs/native_synchronization/.gitignore @@ -8,3 +8,6 @@ build/ # Omit committing pubspec.lock for library packages; see # https://dart.dev/guides/libraries/private-files#pubspeclock. pubspec.lock + +# VSCode configuration files +.vscode/ diff --git a/pkgs/native_synchronization/CHANGELOG.md b/pkgs/native_synchronization/CHANGELOG.md index 1b9970e5..69c03a6e 100644 --- a/pkgs/native_synchronization/CHANGELOG.md +++ b/pkgs/native_synchronization/CHANGELOG.md @@ -1,3 +1,5 @@ ## 0.1.0-wip - Initial version. +- Expose `Mutex` and `ConditionVariable` +- Implement `Mailbox`. diff --git a/pkgs/native_synchronization/README.md b/pkgs/native_synchronization/README.md index 80d064c3..b56aad11 100644 --- a/pkgs/native_synchronization/README.md +++ b/pkgs/native_synchronization/README.md @@ -1,16 +1,16 @@ [![Dart](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml/badge.svg)](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml) -Low level synchronization primitives built on dart:ffi. +This package exposes a portable interface for low-level thread +synchronization primitives like `Mutex` and `ConditionVariable`. -## TODO: Projects docs - -TODO: Add a brief project description here. +It also provides some slightly more high-level synchronization primitives +like `Mailbox` built on top of low-level primitives. ## Status: experimental **NOTE**: This package is currently experimental and published under the [labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to -solicit feedback. +solicit feedback. For packages in the labs.dart.dev publisher we generally plan to either graduate the package into a supported publisher (dart.dev, tools.dart.dev) after a period @@ -18,5 +18,5 @@ of feedback and iteration, or discontinue the package. These packages have a much higher expected rate of API and breaking changes. Your feedback is valuable and will help us evolve this package. For general -feedback, suggestions, and comments, please file an issue in the +feedback, suggestions, and comments, please file an issue in the [bug tracker](https://github.com/dart-lang/native_synchronization/issues). diff --git a/pkgs/native_synchronization/lib/mailbox.dart b/pkgs/native_synchronization/lib/mailbox.dart new file mode 100644 index 00000000..d7a2796f --- /dev/null +++ b/pkgs/native_synchronization/lib/mailbox.dart @@ -0,0 +1,125 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:typed_data'; + +import 'package:ffi/ffi.dart'; + +import 'package:native_synchronization/primitives.dart'; +import 'package:native_synchronization/sendable.dart'; + +final class _MailboxRepr extends Struct { + external Pointer buffer; + + @Int32() + external int bufferLength; + + @Int32() + external int state; +} + +class _SendableMailbox { + final int address; + final Sendable mutex; + final Sendable condVar; + + _SendableMailbox( + {required this.address, required this.mutex, required this.condVar}); +} + +/// Mailbox communication primitive. +/// +/// This synchronization primitive allows a single producer to send messages +/// to one or more consumers. Producer uses [put] to place a message into +/// a mailbox which consumers can then [take] out. +/// +/// [Mailbox] object can not be directly sent to other isolates via a +/// `SendPort`, but it can be converted to a `Sendable` via +/// `asSendable` getter. +/// +/// [Mailbox] object is owned by an isolate which created them. +class Mailbox { + final Pointer<_MailboxRepr> _mailbox; + final Mutex _mutex; + final ConditionVariable _condVar; + + static const _stateEmpty = 0; + static const _stateFull = 1; + + static final finalizer = Finalizer((Pointer<_MailboxRepr> mailbox) { + calloc.free(mailbox.ref.buffer); + calloc.free(mailbox); + }); + + Mailbox() + : _mailbox = calloc.allocate(sizeOf<_MailboxRepr>()), + _mutex = Mutex(), + _condVar = ConditionVariable() { + finalizer.attach(this, _mailbox); + } + + Mailbox._fromSendable(_SendableMailbox sendable) + : _mailbox = Pointer.fromAddress(sendable.address), + _mutex = sendable.mutex.materialize(), + _condVar = sendable.condVar.materialize(); + + /// Place a message into the mailbox if has space for it. + /// + /// If mailbox already contains a message then [put] will throw. + void put(Uint8List message) { + final buffer = message.isEmpty ? nullptr : _toBuffer(message); + _mutex.runLocked(() { + if (_mailbox.ref.state != _stateEmpty) { + throw StateError('Mailbox is full'); + } + + _mailbox.ref.state = _stateFull; + _mailbox.ref.buffer = buffer; + _mailbox.ref.bufferLength = message.length; + + _condVar.notify(); + }); + } + + /// Take a message from the mailbox. + /// + /// If mailbox is empty this will synchronously block until message + /// is available. + Uint8List take() => _mutex.runLocked(() { + while (_mailbox.ref.state != _stateFull) { + _condVar.wait(_mutex); + } + + final result = _toList(_mailbox.ref.buffer, _mailbox.ref.bufferLength); + + _mailbox.ref.state = _stateEmpty; + _mailbox.ref.buffer = nullptr; + _mailbox.ref.bufferLength = 0; + return result; + }); + + static final _emptyResponse = Uint8List(0); + + static Uint8List _toList(Pointer buffer, int length) { + return length == 0 + ? _emptyResponse + // We have to ignore sdk_version_since warning due to dartbug.com/53142. + // ignore: sdk_version_since + : buffer.asTypedList(length, finalizer: malloc.nativeFree); + } + + static Pointer _toBuffer(Uint8List list) { + final buffer = malloc.allocate(list.length); + buffer.asTypedList(list.length).setRange(0, list.length, list); + return buffer; + } + + Sendable get asSendable => Sendable.wrap( + Mailbox._fromSendable, + _SendableMailbox( + address: _mailbox.address, + mutex: _mutex.asSendable, + condVar: _condVar.asSendable)); +} diff --git a/pkgs/native_synchronization/lib/posix.dart b/pkgs/native_synchronization/lib/posix.dart new file mode 100644 index 00000000..b59d7ae0 --- /dev/null +++ b/pkgs/native_synchronization/lib/posix.dart @@ -0,0 +1,93 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part of 'primitives.dart'; + +class _PosixMutex extends Mutex { + /// This is maximum value of `sizeof(pthread_mutex_t)` across all supported + /// platforms. + static const _sizeInBytes = 64; + + final Pointer _impl; + + static final _finalizer = Finalizer>((ptr) { + pthread_mutex_destroy(ptr); + malloc.free(ptr); + }); + + _PosixMutex() + : _impl = malloc.allocate(_PosixMutex._sizeInBytes), + super._() { + if (pthread_mutex_init(_impl, nullptr) != 0) { + malloc.free(_impl); + throw StateError('Failed to initialize mutex'); + } + _finalizer.attach(this, _impl); + } + + _PosixMutex.fromAddress(int address) + : _impl = Pointer.fromAddress(address), + super._(); + + @override + void _lock() { + if (pthread_mutex_lock(_impl) != 0) { + throw StateError('Failed to lock mutex'); + } + } + + @override + void _unlock() { + if (pthread_mutex_unlock(_impl) != 0) { + throw StateError('Failed to unlock mutex'); + } + } + + @override + int get _address => _impl.address; +} + +class _PosixConditionVariable extends ConditionVariable { + /// This is maximum value of `sizeof(pthread_cond_t)` across all supported + /// platforms. + static const _sizeInBytes = 64; + + final Pointer _impl; + + static final _finalizer = Finalizer>((ptr) { + pthread_cond_destroy(ptr); + malloc.free(ptr); + }); + + _PosixConditionVariable() + : _impl = malloc.allocate(_PosixConditionVariable._sizeInBytes), + super._() { + if (pthread_cond_init(_impl, nullptr) != 0) { + malloc.free(_impl); + throw StateError('Failed to initialize condition variable'); + } + _finalizer.attach(this, _impl); + } + + _PosixConditionVariable.fromAddress(int address) + : _impl = Pointer.fromAddress(address), + super._(); + + @override + void notify() { + if (pthread_cond_signal(_impl) != 0) { + throw StateError('Failed to signal condition variable'); + } + } + + @override + void wait(covariant _PosixMutex mutex) { + if (pthread_cond_wait(_impl, mutex._impl) != 0) { + throw StateError('Failed to wait on a condition variable'); + } + } + + @override + int get _address => _impl.address; +} diff --git a/pkgs/native_synchronization/lib/primitives.dart b/pkgs/native_synchronization/lib/primitives.dart new file mode 100644 index 00000000..c792dd96 --- /dev/null +++ b/pkgs/native_synchronization/lib/primitives.dart @@ -0,0 +1,117 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// This library contains native synchronization primitives such as [Mutex] +/// and [ConditionVariable] implemented on top of low-level primitives +/// provided by the OS. +/// +/// See OS specific documentation for more details: +/// +/// * POSIX man pages (Linux, Android, Mac OS X and iOS X) +/// * `pthread_mutex_lock` and `pthread_mutex_unlock`, +/// * `pthread_cond_wait` and `pthread_cond_signal`. +/// * Windows +/// * [Slim Reader/Writer (SRW) Locks](https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks), +/// * [Condition Variables](https://learn.microsoft.com/en-us/windows/win32/sync/condition-variables), +library; + +import 'dart:ffi'; +import 'dart:io'; + +import 'package:ffi/ffi.dart'; +import 'package:native_synchronization/sendable.dart'; + +import 'package:native_synchronization/src/bindings/pthread.dart'; +import 'package:native_synchronization/src/bindings/winapi.dart'; + +part 'posix.dart'; +part 'windows.dart'; + +/// A *mutex* synchronization primitive. +/// +/// Mutex can be used to synchronize access to a native resource shared between +/// multiple threads. +/// +/// [Mutex] object can not be directly sent to other isolates via a `SendPort`, +/// but it can be converted to a `Sendable` via `asSendable` getter. +/// +/// Mutex objects are owned by an isolate which created them. +sealed class Mutex implements Finalizable { + Mutex._(); + + factory Mutex() => Platform.isWindows ? _WindowsMutex() : _PosixMutex(); + + /// Acquire exclusive ownership of this mutex. + /// + /// If this mutex is already acquired then an attempt to acquire it + /// blocks the current thread until the mutex is released by the + /// current owner. + /// + /// **Warning**: attempting to hold a mutex across asynchronous suspension + /// points will lead to undefined behavior and potentially crashes. + void _lock(); + + /// Release exclusive ownership of this mutex. + /// + /// It is an error to release ownership of the mutex if it was not + /// previously acquired. + void _unlock(); + + /// Run the given synchronous `action` under a mutex. + /// + /// This function takes exclusive ownership of the mutex, executes `action` + /// and then releases the mutex. It returns the value returned by `action`. + /// + /// **Warning**: you can't combine `runLocked` with an asynchronous code. + R runLocked(R Function() action) { + _lock(); + try { + return action(); + } finally { + _unlock(); + } + } + + Sendable get asSendable => Sendable.wrap( + Platform.isWindows ? _WindowsMutex.fromAddress : _PosixMutex.fromAddress, + _address); + + int get _address; +} + +/// A *condition variable* synchronization primitive. +/// +/// Condition variable can be used to synchronously wait for a condition to +/// occur. +/// +/// [ConditionVariable] object can not be directly sent to other isolates via a +/// `SendPort`, but it can be converted to a `Sendable` +/// object via [asSendable] getter. +/// +/// [ConditionVariable] objects are owned by an isolate which created them. +sealed class ConditionVariable implements Finalizable { + ConditionVariable._(); + + factory ConditionVariable() => Platform.isWindows + ? _WindowsConditionVariable() + : _PosixConditionVariable(); + + /// Block and wait until another thread calls [notify]. + /// + /// `mutex` must be a [Mutex] object exclusively held by the current thread. + /// It will be released and the thread will block until another thread + /// calls [notify]. + void wait(Mutex mutex); + + /// Wake up at least one thread waiting on this condition variable. + void notify(); + + Sendable get asSendable => Sendable.wrap( + Platform.isWindows + ? _WindowsConditionVariable.fromAddress + : _PosixConditionVariable.fromAddress, + _address); + + int get _address; +} diff --git a/pkgs/native_synchronization/lib/sample.dart b/pkgs/native_synchronization/lib/sample.dart deleted file mode 100644 index ca6b24ea..00000000 --- a/pkgs/native_synchronization/lib/sample.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -void main(List args) { - print('hello world'); -} diff --git a/pkgs/native_synchronization/lib/sendable.dart b/pkgs/native_synchronization/lib/sendable.dart new file mode 100644 index 00000000..6afba3d8 --- /dev/null +++ b/pkgs/native_synchronization/lib/sendable.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +abstract final class Sendable { + static Sendable wrap(T Function(U) make, U data) { + return _SendableImpl._(make, data); + } + + T materialize(); +} + +final class _SendableImpl implements Sendable { + final U _data; + final T Function(U v) _make; + + _SendableImpl._(this._make, this._data); + + @override + T materialize() => _make(_data); +} diff --git a/pkgs/native_synchronization/lib/src/bindings/pthread.dart b/pkgs/native_synchronization/lib/src/bindings/pthread.dart new file mode 100644 index 00000000..d1776716 --- /dev/null +++ b/pkgs/native_synchronization/lib/src/bindings/pthread.dart @@ -0,0 +1,38 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// ignore_for_file: non_constant_identifier_names, camel_case_types + +import 'dart:ffi'; + +final class pthread_mutex_t extends Opaque {} + +final class pthread_cond_t extends Opaque {} + +@Native, Pointer)>() +external int pthread_mutex_init( + Pointer mutex, Pointer attrs); + +@Native)>() +external int pthread_mutex_lock(Pointer mutex); + +@Native)>() +external int pthread_mutex_unlock(Pointer mutex); + +@Native)>() +external int pthread_mutex_destroy(Pointer cond); + +@Native, Pointer)>() +external int pthread_cond_init( + Pointer cond, Pointer attrs); + +@Native, Pointer)>() +external int pthread_cond_wait( + Pointer cond, Pointer mutex); + +@Native)>() +external int pthread_cond_destroy(Pointer cond); + +@Native)>() +external int pthread_cond_signal(Pointer cond); diff --git a/pkgs/native_synchronization/lib/src/bindings/winapi.dart b/pkgs/native_synchronization/lib/src/bindings/winapi.dart new file mode 100644 index 00000000..20aec4e4 --- /dev/null +++ b/pkgs/native_synchronization/lib/src/bindings/winapi.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// ignore_for_file: non_constant_identifier_names, camel_case_types + +import 'dart:ffi'; + +final class SRWLOCK extends Opaque {} + +final class CONDITION_VARIABLE extends Opaque {} + +@Native)>() +external void InitializeSRWLock(Pointer lock); + +@Native)>() +external void AcquireSRWLockExclusive(Pointer lock); + +@Native)>() +external void ReleaseSRWLockExclusive(Pointer mutex); + +@Native)>() +external void InitializeConditionVariable(Pointer condVar); + +@Native< + Int Function( + Pointer, Pointer, Uint32, Uint32)>() +external int SleepConditionVariableSRW(Pointer condVar, + Pointer srwLock, int timeOut, int flags); + +@Native)>() +external void WakeConditionVariable(Pointer condVar); diff --git a/pkgs/native_synchronization/lib/windows.dart b/pkgs/native_synchronization/lib/windows.dart new file mode 100644 index 00000000..b15da7e6 --- /dev/null +++ b/pkgs/native_synchronization/lib/windows.dart @@ -0,0 +1,74 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +part of 'primitives.dart'; + +class _WindowsMutex extends Mutex { + static const _sizeInBytes = 8; // `sizeof(SRWLOCK)` + + final Pointer _impl; + + static final _finalizer = Finalizer>((ptr) { + malloc.free(ptr); + }); + + _WindowsMutex() + : _impl = malloc.allocate(_WindowsMutex._sizeInBytes), + super._() { + InitializeSRWLock(_impl); + _finalizer.attach(this, _impl); + } + + _WindowsMutex.fromAddress(int address) + : _impl = Pointer.fromAddress(address), + super._(); + + @override + void _lock() => AcquireSRWLockExclusive(_impl); + + @override + void _unlock() => ReleaseSRWLockExclusive(_impl); + + @override + int get _address => _impl.address; +} + +class _WindowsConditionVariable extends ConditionVariable { + static const _sizeInBytes = 8; // `sizeof(CONDITION_VARIABLE)` + + final Pointer _impl; + + static final _finalizer = Finalizer>((ptr) { + malloc.free(ptr); + }); + + _WindowsConditionVariable() + : _impl = malloc.allocate(_WindowsConditionVariable._sizeInBytes), + super._() { + InitializeConditionVariable(_impl); + _finalizer.attach(this, _impl); + } + + _WindowsConditionVariable.fromAddress(int address) + : _impl = Pointer.fromAddress(address), + super._(); + + @override + void notify() { + WakeConditionVariable(_impl); + } + + @override + void wait(covariant _WindowsMutex mutex) { + const infinite = 0xFFFFFFFF; + const exclusive = 0; + if (SleepConditionVariableSRW(_impl, mutex._impl, infinite, exclusive) == + 0) { + throw StateError('Failed to wait on a condition variable'); + } + } + + @override + int get _address => _impl.address; +} diff --git a/pkgs/native_synchronization/pubspec.yaml b/pkgs/native_synchronization/pubspec.yaml index 299b70e4..f7150123 100644 --- a/pkgs/native_synchronization/pubspec.yaml +++ b/pkgs/native_synchronization/pubspec.yaml @@ -4,10 +4,10 @@ version: 0.1.0-wip repository: https://github.com/dart-lang/native_synchronization environment: - sdk: ^3.0.0 + sdk: ">=3.1.0-348.0.dev <4.0.0" dependencies: - # lib_name: ^1.2.0 + ffi: ^2.1.0 dev_dependencies: dart_flutter_team_lints: ^1.0.0 diff --git a/pkgs/native_synchronization/test/mailbox_test.dart b/pkgs/native_synchronization/test/mailbox_test.dart new file mode 100644 index 00000000..2400d56a --- /dev/null +++ b/pkgs/native_synchronization/test/mailbox_test.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; +import 'dart:isolate'; +import 'dart:typed_data'; + +import 'package:native_synchronization/mailbox.dart'; +import 'package:native_synchronization/sendable.dart'; +import 'package:test/test.dart'; + +void main() { + Future startHelperIsolate(Sendable sendableMailbox) { + return Isolate.run(() { + sleep(const Duration(milliseconds: 500)); + final mailbox = sendableMailbox.materialize(); + mailbox.put(Uint8List(42)..[41] = 42); + return 'success'; + }); + } + + test('mailbox', () async { + final mailbox = Mailbox(); + final helperResult = startHelperIsolate(mailbox.asSendable); + final value = mailbox.take(); + expect(value, isA()); + expect(value.length, equals(42)); + expect(value[41], equals(42)); + expect(await helperResult, equals('success')); + }); +} diff --git a/pkgs/native_synchronization/test/primitives_test.dart b/pkgs/native_synchronization/test/primitives_test.dart index d68b515e..e1d6b1fb 100644 --- a/pkgs/native_synchronization/test/primitives_test.dart +++ b/pkgs/native_synchronization/test/primitives_test.dart @@ -2,8 +2,118 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:ffi'; +import 'dart:io'; +import 'dart:isolate'; + +import 'package:ffi/ffi.dart'; +import 'package:native_synchronization/primitives.dart'; +import 'package:native_synchronization/sendable.dart'; import 'package:test/test.dart'; void main() { - test('dummy', () {}); + group('mutex', () { + test('simple', () { + final mutex = Mutex(); + expect(mutex.runLocked(() => 42), equals(42)); + }); + + Future spawnHelperIsolate( + int ptrAddress, Sendable sendableMutex) { + return Isolate.run(() { + final ptr = Pointer.fromAddress(ptrAddress); + final mutex = sendableMutex.materialize(); + + while (true) { + sleep(Duration(milliseconds: 10)); + if (mutex.runLocked(() { + if (ptr.value == 2) { + return true; + } + ptr.value = 0; + sleep(Duration(milliseconds: 500)); + ptr.value = 1; + return false; + })) { + break; + } + } + + return 'success'; + }); + } + + test('isolate', () async { + await using((arena) async { + final ptr = arena.allocate(1); + final mutex = Mutex(); + + final helperResult = spawnHelperIsolate(ptr.address, mutex.asSendable); + + while (true) { + final sw = Stopwatch()..start(); + if (mutex.runLocked(() { + if (sw.elapsedMilliseconds > 300 && ptr.value == 1) { + ptr.value = 2; + return true; + } + return false; + })) { + break; + } + await Future.delayed(const Duration(milliseconds: 10)); + } + expect(await helperResult, equals('success')); + }); + }); + }); + + group('condvar', () { + Future spawnHelperIsolate( + int ptrAddress, + Sendable sendableMutex, + Sendable sendableCondVar) { + return Isolate.run(() { + final ptr = Pointer.fromAddress(ptrAddress); + final mutex = sendableMutex.materialize(); + final condVar = sendableCondVar.materialize(); + + return mutex.runLocked(() { + ptr.value = 1; + while (ptr.value == 1) { + condVar.wait(mutex); + } + return ptr.value == 2 ? 'success' : 'failure'; + }); + }); + } + + test('isolate', () async { + await using((arena) async { + final ptr = arena.allocate(1); + final mutex = Mutex(); + final condVar = ConditionVariable(); + + final helperResult = spawnHelperIsolate( + ptr.address, mutex.asSendable, condVar.asSendable); + + while (true) { + final success = mutex.runLocked(() { + if (ptr.value == 1) { + ptr.value = 2; + condVar.notify(); + return true; + } + return false; + }); + if (success) { + break; + } + await Future.delayed(const Duration(milliseconds: 20)); + } + + expect(await helperResult, equals('success')); + }); + }); + }); } From ef45ca3f7e20b43565d664301eb87b2e64ca520f Mon Sep 17 00:00:00 2001 From: Slava Egorov Date: Wed, 9 Aug 2023 13:26:37 +0200 Subject: [PATCH 04/23] Prepare to publish v0.1.0 (dart-lang/native_synchronization#4) --- pkgs/native_synchronization/CHANGELOG.md | 2 +- pkgs/native_synchronization/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/CHANGELOG.md b/pkgs/native_synchronization/CHANGELOG.md index 69c03a6e..09b4b62a 100644 --- a/pkgs/native_synchronization/CHANGELOG.md +++ b/pkgs/native_synchronization/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.1.0-wip +## 0.1.0 - Initial version. - Expose `Mutex` and `ConditionVariable` diff --git a/pkgs/native_synchronization/pubspec.yaml b/pkgs/native_synchronization/pubspec.yaml index f7150123..b1d3f7dd 100644 --- a/pkgs/native_synchronization/pubspec.yaml +++ b/pkgs/native_synchronization/pubspec.yaml @@ -1,6 +1,6 @@ name: native_synchronization description: Low level synchronization primitives built on dart:ffi. -version: 0.1.0-wip +version: 0.1.0 repository: https://github.com/dart-lang/native_synchronization environment: From 8de76baadf2a000a817dcc08315e4ad554bf238f Mon Sep 17 00:00:00 2001 From: Slava Egorov Date: Wed, 9 Aug 2023 13:53:49 +0200 Subject: [PATCH 05/23] Lower SDK lower bound to 3.0.0 (dart-lang/native_synchronization#5) --- .../.github/workflows/dart.yaml | 10 ++++++--- pkgs/native_synchronization/CHANGELOG.md | 4 ++++ pkgs/native_synchronization/lib/mailbox.dart | 21 ++++++++++++++----- pkgs/native_synchronization/pubspec.yaml | 4 ++-- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index f6a4ea58..6cd5c4d4 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -14,7 +14,11 @@ permissions: read-all jobs: analyze: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + sdk: [dev, stable] steps: # These are the latest versions of the github actions; dependabot will @@ -22,7 +26,7 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: dev + sdk: ${{ matrix.sdk }} - name: Install dependencies run: dart pub get @@ -39,7 +43,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - sdk: [dev] + sdk: [dev, stable] steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f diff --git a/pkgs/native_synchronization/CHANGELOG.md b/pkgs/native_synchronization/CHANGELOG.md index 09b4b62a..9acca142 100644 --- a/pkgs/native_synchronization/CHANGELOG.md +++ b/pkgs/native_synchronization/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.0 + +- Lower SDK lower bound to 3.0.0. + ## 0.1.0 - Initial version. diff --git a/pkgs/native_synchronization/lib/mailbox.dart b/pkgs/native_synchronization/lib/mailbox.dart index d7a2796f..0871a7c0 100644 --- a/pkgs/native_synchronization/lib/mailbox.dart +++ b/pkgs/native_synchronization/lib/mailbox.dart @@ -103,11 +103,22 @@ class Mailbox { static final _emptyResponse = Uint8List(0); static Uint8List _toList(Pointer buffer, int length) { - return length == 0 - ? _emptyResponse - // We have to ignore sdk_version_since warning due to dartbug.com/53142. - // ignore: sdk_version_since - : buffer.asTypedList(length, finalizer: malloc.nativeFree); + if (length == 0) { + return _emptyResponse; + } + + // TODO: remove feature detection once 3.1 becomes stable. + // ignore: omit_local_variable_types + final Uint8List Function(int) asTypedList = buffer.asTypedList; + if (asTypedList is Uint8List Function(int, + {Pointer finalizer})) { + return asTypedList(length, finalizer: malloc.nativeFree); + } + + final result = Uint8List(length); + result.setRange(0, length, buffer.asTypedList(length)); + malloc.free(buffer); + return result; } static Pointer _toBuffer(Uint8List list) { diff --git a/pkgs/native_synchronization/pubspec.yaml b/pkgs/native_synchronization/pubspec.yaml index b1d3f7dd..e16317f0 100644 --- a/pkgs/native_synchronization/pubspec.yaml +++ b/pkgs/native_synchronization/pubspec.yaml @@ -1,10 +1,10 @@ name: native_synchronization description: Low level synchronization primitives built on dart:ffi. -version: 0.1.0 +version: 0.2.0 repository: https://github.com/dart-lang/native_synchronization environment: - sdk: ">=3.1.0-348.0.dev <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: ffi: ^2.1.0 From 161490d428d302864c7b5a94bead87c53abe9c4c Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 11 Aug 2023 01:05:46 -0700 Subject: [PATCH 06/23] blast_repo fixes (dart-lang/native_synchronization#6) auto-publish --- .../.github/workflows/publish.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pkgs/native_synchronization/.github/workflows/publish.yaml diff --git a/pkgs/native_synchronization/.github/workflows/publish.yaml b/pkgs/native_synchronization/.github/workflows/publish.yaml new file mode 100644 index 00000000..1cb7e9cf --- /dev/null +++ b/pkgs/native_synchronization/.github/workflows/publish.yaml @@ -0,0 +1,17 @@ +# A CI configuration to auto-publish pub packages. + +name: Publish + +on: + pull_request: + branches: [ main ] + push: + tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] + +jobs: + publish: + if: ${{ github.repository_owner == 'dart-lang' }} + uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main + permissions: + id-token: write # Required for authentication using OIDC + pull-requests: write # Required for writing the pull request note From bc4ca397232d820a78abf242954d4563f25d6931 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 11 Aug 2023 01:06:18 -0700 Subject: [PATCH 07/23] add standard markdown badges (dart-lang/native_synchronization#7) --- pkgs/native_synchronization/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/native_synchronization/README.md b/pkgs/native_synchronization/README.md index b56aad11..1a2a74e8 100644 --- a/pkgs/native_synchronization/README.md +++ b/pkgs/native_synchronization/README.md @@ -1,4 +1,6 @@ [![Dart](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml/badge.svg)](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml) +[![pub package](https://img.shields.io/pub/v/native_synchronization.svg)](https://pub.dev/packages/native_synchronization) +[![package publisher](https://img.shields.io/pub/publisher/native_synchronization.svg)](https://pub.dev/packages/native_synchronization/publisher) This package exposes a portable interface for low-level thread synchronization primitives like `Mutex` and `ConditionVariable`. From d0f7ba0029cea2f140a1c2c91e9bb3955b36a04b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 19:56:09 +0000 Subject: [PATCH 08/23] Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/native_synchronization#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
Release notes

Sourced from actions/checkout's releases.

v3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

Changelog

Sourced from actions/checkout's changelog.

Changelog

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

v3.0.1

v3.0.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.5.3&new-version=3.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 6cd5c4d4..6bd9d28c 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: sdk: ${{ matrix.sdk }} From 1cc5a3f34e3ab8e21909156cb5a96539def0bfc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 19:57:17 +0000 Subject: [PATCH 09/23] Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/native_synchronization#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.0 to 1.5.1.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

  • Added a flavor option setup.sh to allow downloading unpublished builds.

v1.0.0

  • Promoted to 1.0 stable.

v0.5

  • Fixed a Windows pub global activate path issue.

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.0&new-version=1.5.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 6bd9d28c..cc7a09f3 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -24,7 +24,7 @@ jobs: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} @@ -46,7 +46,7 @@ jobs: sdk: [dev, stable] steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f + - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} From 9e462b073099192c9660f3866549cba5a0c5b03e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:26:41 +0000 Subject: [PATCH 10/23] Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/native_synchronization#10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.0.
Release notes

Sourced from actions/checkout's releases.

v4.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.0.0...v4.1.0

v4.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v4.0.0

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3.6.0&new-version=4.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index cc7a09f3..9e167905 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} From d7a698687f4259ac23280f753b1241b679a5dfb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 19:15:45 +0000 Subject: [PATCH 11/23] Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/native_synchronization#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
Release notes

Sourced from actions/checkout's releases.

v4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.0...v4.1.1

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.0&new-version=4.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 9e167905..6af7b501 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 with: sdk: ${{ matrix.sdk }} From ebeb1bbcbb13b06f993d8133a8beb64d89b49e22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 20:00:31 +0000 Subject: [PATCH 12/23] Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/native_synchronization#13) Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.5.1 to 1.6.0.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

  • Added a flavor option setup.sh to allow downloading unpublished builds.

v1.0.0

  • Promoted to 1.0 stable.

v0.5

  • Fixed a Windows pub global activate path issue.

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.5.1&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 6af7b501..d409585e 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -24,7 +24,7 @@ jobs: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} @@ -46,7 +46,7 @@ jobs: sdk: [dev, stable] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@8a4b97ea2017cc079571daec46542f76189836b1 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d with: sdk: ${{ matrix.sdk }} From 1df8cc48b0db0f9f6f5fe2b1de297d1539fb22aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:10:36 +0000 Subject: [PATCH 13/23] Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/native_synchronization#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.2.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

v1.2.0

  • Fixed a path issue impacting git dependencies on Windows.

v1.1.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.6.0&new-version=1.6.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index d409585e..73c24954 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -24,7 +24,7 @@ jobs: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d + - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} @@ -46,7 +46,7 @@ jobs: sdk: [dev, stable] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d + - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From 044a655f524fe7fd2b56ce365f7ba3c264279cc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:28:40 +0000 Subject: [PATCH 14/23] Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/native_synchronization#18) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2.
Release notes

Sourced from actions/checkout's releases.

v4.1.2

We are investigating the following issue with this release and have rolled-back the v4 tag to point to v4.1.1

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.1...v4.1.2

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.1&new-version=4.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 73c24954..be528e0c 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From 44041f1547dd0c1c400ca004e5c6b52cae476993 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 19:22:08 +0000 Subject: [PATCH 15/23] Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/native_synchronization#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.4.
Release notes

Sourced from actions/checkout's releases.

v4.1.4

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.3...v4.1.4

v4.1.3

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.2...v4.1.3

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.4

v4.1.3

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.2&new-version=4.1.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index be528e0c..68efc162 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 with: sdk: ${{ matrix.sdk }} From c2d14931f2f67360e9257557f584c288fd31bfe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 03:00:17 +0000 Subject: [PATCH 16/23] Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/native_synchronization#20) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.2 to 1.6.4.
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.4

  • Rebuild JS code to include changes from v1.6.3

v1.6.3

Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.4

  • Rebuild JS code.

v1.6.3

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

  • Automatically create OIDC token for pub.dev.
  • Add a reusable workflow for publishing.

v1.3.0

  • The install location of the Dart SDK is now available

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dart-lang/setup-dart&package-manager=github_actions&previous-version=1.6.2&new-version=1.6.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 68efc162..7e83d041 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -24,7 +24,7 @@ jobs: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 + - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} @@ -46,7 +46,7 @@ jobs: sdk: [dev, stable] steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - - uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3 + - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} From 2c6c4ce751aefeacb79c963c6079951cb6290960 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 9 May 2024 16:38:53 -0700 Subject: [PATCH 17/23] blast_repo fixes (dart-lang/native_synchronization#21) dependabot --- pkgs/native_synchronization/.github/dependabot.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/native_synchronization/.github/dependabot.yaml b/pkgs/native_synchronization/.github/dependabot.yaml index 439e796b..bf6b38a4 100644 --- a/pkgs/native_synchronization/.github/dependabot.yaml +++ b/pkgs/native_synchronization/.github/dependabot.yaml @@ -8,3 +8,7 @@ updates: interval: monthly labels: - autosubmit + groups: + github-actions: + patterns: + - "*" From dec7c2dc3362ab20adc0774a227db280c25706ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 23:41:42 +0000 Subject: [PATCH 18/23] Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group (dart-lang/native_synchronization#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.1.4 to 4.1.5
Release notes

Sourced from actions/checkout's releases.

v4.1.5

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.4...v4.1.5

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.4&new-version=4.1.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 7e83d041..740c2c92 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} From e096914abef567e4a68e43973e3f95946eef9a12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 19:48:04 +0000 Subject: [PATCH 19/23] Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group (dart-lang/native_synchronization#23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4.1.5 to 4.1.6
Release notes

Sourced from actions/checkout's releases.

v4.1.6

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v4.1.5...v4.1.6

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.6

v4.1.5

v4.1.4

v4.1.3

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=4.1.5&new-version=4.1.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 740c2c92..5247d99d 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,7 +23,7 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} @@ -45,7 +45,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 with: sdk: ${{ matrix.sdk }} From dc5c91da193b0d2b4f31bdad438831919ba99651 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:43:01 +0000 Subject: [PATCH 20/23] Bump the github-actions group with 2 updates (dart-lang/native_synchronization#24) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart). Updates `actions/checkout` from 4.1.6 to 4.1.7
Release notes

Sourced from actions/checkout's releases.

v4.1.7

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v4.1.6...v4.1.7

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.1.7

v4.1.6

v4.1.5

v4.1.4

v4.1.3

v4.1.2

v4.1.1

v4.1.0

v4.0.0

v3.6.0

v3.5.3

... (truncated)

Commits

Updates `dart-lang/setup-dart` from 1.6.4 to 1.6.5
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.6.5

dart-lang/native_synchronization#118: dart-lang/setup-dartdart-lang/native_synchronization#118

Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.6.5

dart-lang/native_synchronization#118: dart-lang/setup-dartdart-lang/native_synchronization#118

v1.6.4

  • Rebuild JS code.

v1.6.3

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

  • Re-wrote the implementation of the action into Dart.
  • Auto-detect the platform architecture (x64, ia32, arm, arm64).
  • Improved the caching and download resilience of the sdk.
  • Added a new action output: dart-version - the installed version of the sdk.

v1.4.0

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
--- pkgs/native_synchronization/.github/workflows/dart.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/pkgs/native_synchronization/.github/workflows/dart.yaml index 5247d99d..b22733d9 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/pkgs/native_synchronization/.github/workflows/dart.yaml @@ -23,8 +23,8 @@ jobs: steps: # These are the latest versions of the github actions; dependabot will # send PRs to keep these up-to-date. - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: ${{ matrix.sdk }} @@ -45,8 +45,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] sdk: [dev, stable] steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - - uses: dart-lang/setup-dart@f0ead981b4d9a35b37f30d36160575d60931ec30 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: sdk: ${{ matrix.sdk }} From 80894f7d1f225924c53fa223d550de75cdd735fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Thu, 1 Aug 2024 05:40:35 -0700 Subject: [PATCH 21/23] Add closed state to Mailbox (dart-lang/native_synchronization#26) * Add closed state to Mailbox * Update documentation --- pkgs/native_synchronization/CHANGELOG.md | 4 +++ pkgs/native_synchronization/lib/mailbox.dart | 32 ++++++++++++++++--- pkgs/native_synchronization/pubspec.yaml | 2 +- .../test/mailbox_test.dart | 21 ++++++++++++ 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/pkgs/native_synchronization/CHANGELOG.md b/pkgs/native_synchronization/CHANGELOG.md index 9acca142..7a52326a 100644 --- a/pkgs/native_synchronization/CHANGELOG.md +++ b/pkgs/native_synchronization/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0 + +- Add a closed state to `Mailbox`. + ## 0.2.0 - Lower SDK lower bound to 3.0.0. diff --git a/pkgs/native_synchronization/lib/mailbox.dart b/pkgs/native_synchronization/lib/mailbox.dart index 0871a7c0..57cb9975 100644 --- a/pkgs/native_synchronization/lib/mailbox.dart +++ b/pkgs/native_synchronization/lib/mailbox.dart @@ -47,6 +47,7 @@ class Mailbox { static const _stateEmpty = 0; static const _stateFull = 1; + static const _stateClosed = 2; static final finalizer = Finalizer((Pointer<_MailboxRepr> mailbox) { calloc.free(mailbox.ref.buffer); @@ -67,12 +68,13 @@ class Mailbox { /// Place a message into the mailbox if has space for it. /// - /// If mailbox already contains a message then [put] will throw. + /// If mailbox already contains a message or mailbox is closed then [put] will + /// throw [StateError]. void put(Uint8List message) { final buffer = message.isEmpty ? nullptr : _toBuffer(message); _mutex.runLocked(() { if (_mailbox.ref.state != _stateEmpty) { - throw StateError('Mailbox is full'); + throw StateError('Mailbox is closed or full'); } _mailbox.ref.state = _stateFull; @@ -83,15 +85,35 @@ class Mailbox { }); } + /// Close a mailbox. + /// + /// If mailbox already contains a message then [close] will drop the message. + void close() => _mutex.runLocked(() { + if (_mailbox.ref.state == _stateFull && _mailbox.ref.bufferLength > 0) { + malloc.free(_mailbox.ref.buffer); + } + + _mailbox.ref.state = _stateClosed; + _mailbox.ref.buffer = nullptr; + _mailbox.ref.bufferLength = 0; + + _condVar.notify(); + }); + /// Take a message from the mailbox. /// - /// If mailbox is empty this will synchronously block until message - /// is available. + /// If mailbox is empty then [take] will synchronously block until message + /// is available or mailbox is closed. If mailbox is closed then [take] will + /// throw [StateError]. Uint8List take() => _mutex.runLocked(() { - while (_mailbox.ref.state != _stateFull) { + while (_mailbox.ref.state == _stateEmpty) { _condVar.wait(_mutex); } + if (_mailbox.ref.state == _stateClosed) { + throw StateError('Mailbox is closed'); + } + final result = _toList(_mailbox.ref.buffer, _mailbox.ref.bufferLength); _mailbox.ref.state = _stateEmpty; diff --git a/pkgs/native_synchronization/pubspec.yaml b/pkgs/native_synchronization/pubspec.yaml index e16317f0..bf93c3f1 100644 --- a/pkgs/native_synchronization/pubspec.yaml +++ b/pkgs/native_synchronization/pubspec.yaml @@ -1,6 +1,6 @@ name: native_synchronization description: Low level synchronization primitives built on dart:ffi. -version: 0.2.0 +version: 0.3.0 repository: https://github.com/dart-lang/native_synchronization environment: diff --git a/pkgs/native_synchronization/test/mailbox_test.dart b/pkgs/native_synchronization/test/mailbox_test.dart index 2400d56a..9b32bfa3 100644 --- a/pkgs/native_synchronization/test/mailbox_test.dart +++ b/pkgs/native_synchronization/test/mailbox_test.dart @@ -29,4 +29,25 @@ void main() { expect(value[41], equals(42)); expect(await helperResult, equals('success')); }); + + Future startHelperIsolateClose(Sendable sendableMailbox) { + return Isolate.run(() { + sleep(const Duration(milliseconds: 500)); + final mailbox = sendableMailbox.materialize(); + try { + mailbox.take(); + } catch (_) { + return 'success'; + } + return 'failed'; + }); + } + + test('mailbox close', () async { + final mailbox = Mailbox(); + mailbox.put(Uint8List(42)..[41] = 42); + mailbox.close(); + final helperResult = startHelperIsolateClose(mailbox.asSendable); + expect(await helperResult, equals('success')); + }); } From 393c0766e8342ed0b0197b8f45a034f20fe90432 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 23 Sep 2024 16:26:14 -0700 Subject: [PATCH 22/23] update github workflow files --- .../workflows/native_synchronization.yml | 27 ++++++++++++------- .../.github/dependabot.yaml | 14 ---------- .../.github/workflows/publish.yaml | 17 ------------ 3 files changed, 18 insertions(+), 40 deletions(-) rename pkgs/native_synchronization/.github/workflows/dart.yaml => .github/workflows/native_synchronization.yml (74%) delete mode 100644 pkgs/native_synchronization/.github/dependabot.yaml delete mode 100644 pkgs/native_synchronization/.github/workflows/publish.yaml diff --git a/pkgs/native_synchronization/.github/workflows/dart.yaml b/.github/workflows/native_synchronization.yml similarity index 74% rename from pkgs/native_synchronization/.github/workflows/dart.yaml rename to .github/workflows/native_synchronization.yml index b22733d9..49051065 100644 --- a/pkgs/native_synchronization/.github/workflows/dart.yaml +++ b/.github/workflows/native_synchronization.yml @@ -1,20 +1,26 @@ -name: Dart +name: package:native_synchronization +permissions: read-all on: - schedule: - # “At 00:00 (UTC) on Sunday.” - - cron: '0 0 * * 0' - push: - branches: [ main ] pull_request: branches: [ main ] - -# Declare default permissions as read only. -permissions: read-all + paths: + - '.github/workflows/native_synchronization.yml' + - 'pkgs/native_synchronization/**' + push: + branches: [ main ] + paths: + - '.github/workflows/native_synchronization.yml' + - 'pkgs/native_synchronization/**' + schedule: + - cron: '0 0 * * 0' # weekly jobs: analyze: runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: pkgs/native_synchronization strategy: matrix: os: [ubuntu-latest] @@ -40,6 +46,9 @@ jobs: test: needs: analyze runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: pkgs/native_synchronization strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] diff --git a/pkgs/native_synchronization/.github/dependabot.yaml b/pkgs/native_synchronization/.github/dependabot.yaml deleted file mode 100644 index bf6b38a4..00000000 --- a/pkgs/native_synchronization/.github/dependabot.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Dependabot configuration file. -version: 2 - -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: monthly - labels: - - autosubmit - groups: - github-actions: - patterns: - - "*" diff --git a/pkgs/native_synchronization/.github/workflows/publish.yaml b/pkgs/native_synchronization/.github/workflows/publish.yaml deleted file mode 100644 index 1cb7e9cf..00000000 --- a/pkgs/native_synchronization/.github/workflows/publish.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# A CI configuration to auto-publish pub packages. - -name: Publish - -on: - pull_request: - branches: [ main ] - push: - tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] - -jobs: - publish: - if: ${{ github.repository_owner == 'dart-lang' }} - uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main - permissions: - id-token: write # Required for authentication using OIDC - pull-requests: write # Required for writing the pull request note From 44d4a91689cb810c82a9d33de6f439fbf0cce32e Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 26 Sep 2024 09:16:21 -0700 Subject: [PATCH 23/23] update the status badge --- pkgs/native_synchronization/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/native_synchronization/README.md b/pkgs/native_synchronization/README.md index 1a2a74e8..0c43bf57 100644 --- a/pkgs/native_synchronization/README.md +++ b/pkgs/native_synchronization/README.md @@ -1,4 +1,4 @@ -[![Dart](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml/badge.svg)](https://github.com/dart-lang/native_synchronization/actions/workflows/dart.yaml) +[![package:native_synchronization](https://github.com/dart-lang/labs/actions/workflows/native_synchronization.yml/badge.svg)](https://github.com/dart-lang/labs/actions/workflows/native_synchronization.yml) [![pub package](https://img.shields.io/pub/v/native_synchronization.svg)](https://pub.dev/packages/native_synchronization) [![package publisher](https://img.shields.io/pub/publisher/native_synchronization.svg)](https://pub.dev/packages/native_synchronization/publisher)