Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (#149)

Bumps [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) from 1.6.0 to 1.6.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/releases">dart-lang/setup-dart's releases</a>.</em></p>
<blockquote>
<h2>v1.6.2</h2>
<ul>
<li>Switch to running the workflow on <code>node20</code> from <code>node16</code>. See also <a href="https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/">Transitioning from Node 16 to Node 20</a>.</li>
</ul>
<h2>v1.6.1</h2>
<ul>
<li>Updated the google storage url for <code>main</code> channel releases.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/dart-lang/setup-dart/blob/main/CHANGELOG.md">dart-lang/setup-dart's changelog</a>.</em></p>
<blockquote>
<h2>v1.6.2</h2>
<ul>
<li>Switch to running the workflow on <code>node20`` from </code>node16`. See also
<a href="https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/">Transitioning from Node 16 to Node 20</a>.</li>
</ul>
<h2>v1.6.1</h2>
<ul>
<li>Updated the google storage url for <code>main</code> channel releases.</li>
</ul>
<h2>v1.6.0</h2>
<ul>
<li>Enable provisioning of the latest Dart SDK patch release by specifying just
the major and minor version (e.g. <code>3.2</code>).</li>
</ul>
<h2>v1.5.1</h2>
<ul>
<li>No longer test the <code>setup-dart</code> action on pre-2.12 SDKs.</li>
<li>Upgrade JS interop code to use extension types
(the new name for inline classes).</li>
<li>The upcoming rename of the <code>be</code> channel to <code>main</code> is now supported with
forward compatibility that switches when the rename happens.</li>
</ul>
<h2>v1.5.0</h2>
<ul>
<li>Re-wrote the implementation of the action into Dart.</li>
<li>Auto-detect the platform architecture (<code>x64</code>, <code>ia32</code>, <code>arm</code>, <code>arm64</code>).</li>
<li>Improved the caching and download resilience of the sdk.</li>
<li>Added a new action output: <code>dart-version</code> - the installed version of the sdk.</li>
</ul>
<h2>v1.4.0</h2>
<ul>
<li>Automatically create OIDC token for pub.dev.</li>
<li>Add a reusable workflow for publishing.</li>
</ul>
<h2>v1.3.0</h2>
<ul>
<li>The install location of the Dart SDK is now available
in an environment variable, <code>DART_HOME</code>
(<a href="https://redirect.github.com/dart-lang/setup-dart/issues/43">#43</a>).</li>
<li>Fixed an issue where cached downloads could lead to unzip issues
on self-hosted runners
(<a href="https://redirect.github.com/dart-lang/setup-dart/issues/35">#35</a>).</li>
</ul>
<h2>v1.2.0</h2>
<ul>
<li>Fixed a path issue impacting git dependencies on Windows.</li>
</ul>
<h2>v1.1.0</h2>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/dart-lang/setup-dart/commit/fedb1266e91cf51be2fdb382869461a434b920a3"><code>fedb126</code></a> switch to using node20 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/122">#122</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/ca7e6fee45ffbd82b555a7ebfc236d2c86439f5b"><code>ca7e6fe</code></a> update the changelog; prep to release 1.6.1 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/120">#120</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/c1b2cdbfafc77480d10fe0246ef4dd2f83a9e7b7"><code>c1b2cdb</code></a> Clean up after renaming the be channel to main. (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/115">#115</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/49b0b8e0a88f72a8fdf1319a41cc261cec63c3c7"><code>49b0b8e</code></a> Bump actions/checkout from 3 to 4 in README.md (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/117">#117</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/7f54cd0cee53e120db0d1fce4196b7772ebd6f6e"><code>7f54cd0</code></a> Bump <code>@​actions/http-client</code> from 2.1.1 to 2.2.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/112">#112</a>)</li>
<li><a href="https://github.com/dart-lang/setup-dart/commit/6e2fe379bd3c8a39facc503f4494396e0de36f13"><code>6e2fe37</code></a> Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (<a href="https://redirect.github.com/dart-lang/setup-dart/issues/113">#113</a>)</li>
<li>See full diff in <a href="https://github.com/dart-lang/setup-dart/compare/b64355ae6ca0b5d484f0106a033dd1388965d06d...fedb1266e91cf51be2fdb382869461a434b920a3">compare view</a></li>
</ul>
</details>
<br />

[![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`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

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 <dependency name> 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)

</details>
1 file changed
tree: f3d928c01d574c840cdeef91c54ef8100c0bb751
  1. .github/
  2. example/
  3. lib/
  4. test/
  5. .gitignore
  6. analysis_options.yaml
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
README.md

Dart CI pub package package publisher

This library provides the ability to parse, inspect, and manipulate stack traces produced by the underlying Dart implementation. It also provides functions to produce string representations of stack traces in a more readable format than the native StackTrace implementation.

Traces can be parsed from native StackTraces using Trace.from, or captured using Trace.current. Native StackTraces can also be directly converted to human-readable strings using Trace.format.

Here's an example native stack trace from debugging this library:

#0      Object.noSuchMethod (dart:core-patch:1884:25)
#1      Trace.terse.<anonymous closure> (file:///usr/local/google-old/home/goog/dart/dart/pkg/stack_trace/lib/src/trace.dart:47:21)
#2      IterableMixinWorkaround.reduce (dart:collection:29:29)
#3      List.reduce (dart:core-patch:1247:42)
#4      Trace.terse (file:///usr/local/google-old/home/goog/dart/dart/pkg/stack_trace/lib/src/trace.dart:40:35)
#5      format (file:///usr/local/google-old/home/goog/dart/dart/pkg/stack_trace/lib/stack_trace.dart:24:28)
#6      main.<anonymous closure> (file:///usr/local/google-old/home/goog/dart/dart/test.dart:21:29)
#7      _CatchErrorFuture._sendError (dart:async:525:24)
#8      _FutureImpl._setErrorWithoutAsyncTrace (dart:async:393:26)
#9      _FutureImpl._setError (dart:async:378:31)
#10     _ThenFuture._sendValue (dart:async:490:16)
#11     _FutureImpl._handleValue.<anonymous closure> (dart:async:349:28)
#12     Timer.run.<anonymous closure> (dart:async:2402:21)
#13     Timer.Timer.<anonymous closure> (dart:async-patch:15:15)

and its human-readable representation:

dart:core-patch 1884:25                     Object.noSuchMethod
pkg/stack_trace/lib/src/trace.dart 47:21    Trace.terse.<fn>
dart:collection 29:29                       IterableMixinWorkaround.reduce
dart:core-patch 1247:42                     List.reduce
pkg/stack_trace/lib/src/trace.dart 40:35    Trace.terse
pkg/stack_trace/lib/stack_trace.dart 24:28  format
test.dart 21:29                             main.<fn>
dart:async 525:24                           _CatchErrorFuture._sendError
dart:async 393:26                           _FutureImpl._setErrorWithoutAsyncTrace
dart:async 378:31                           _FutureImpl._setError
dart:async 490:16                           _ThenFuture._sendValue
dart:async 349:28                           _FutureImpl._handleValue.<fn>
dart:async 2402:21                          Timer.run.<fn>
dart:async-patch 15:15                      Timer.Timer.<fn>

You can further clean up the stack trace using Trace.terse. This folds together multiple stack frames from the Dart core libraries, so that only the core library method that was directly called from user code is visible. For example:

dart:core                                   Object.noSuchMethod
pkg/stack_trace/lib/src/trace.dart 47:21    Trace.terse.<fn>
dart:core                                   List.reduce
pkg/stack_trace/lib/src/trace.dart 40:35    Trace.terse
pkg/stack_trace/lib/stack_trace.dart 24:28  format
test.dart 21:29                             main.<fn>

Stack Chains

This library also provides the ability to capture “stack chains” with the Chain class. When writing asynchronous code, a single stack trace isn't very useful, since the call stack is unwound every time something async happens. A stack chain tracks stack traces through asynchronous calls, so that you can see the full path from main down to the error.

To use stack chains, just wrap the code that you want to track in Chain.capture. This will create a new Zone in which stack traces are recorded and woven into chains every time an asynchronous call occurs. Zones are sticky, too, so any asynchronous operations started in the Chain.capture callback will have their chains tracked, as will asynchronous operations they start and so on.

Here‘s an example of some code that doesn’t capture its stack chains:

import 'dart:async';

void main() {
  _scheduleAsync();
}

void _scheduleAsync() {
  Future.delayed(Duration(seconds: 1)).then((_) => _runAsync());
}

void _runAsync() {
  throw 'oh no!';
}

If we run this, it prints the following:

Unhandled exception:
oh no!
#0      _runAsync (file:///Users/kevmoo/github/stack_trace/example/example.dart:12:3)
#1      _scheduleAsync.<anonymous closure> (file:///Users/kevmoo/github/stack_trace/example/example.dart:8:52)
<asynchronous suspension>

Notice how there‘s no mention of main in that stack trace. All we know is that the error was in runAsync; we don’t know why runAsync was called.

Now let's look at the same code with stack chains captured:

import 'dart:async';

import 'package:stack_trace/stack_trace.dart';

void main() {
  Chain.capture(_scheduleAsync);
}

void _scheduleAsync() {
  Future.delayed(Duration(seconds: 1)).then((_) => _runAsync());
}

void _runAsync() {
  throw 'oh no!';
}

Now if we run it, it prints this:

Unhandled exception:
oh no!
example/example.dart 14:3                                     _runAsync
example/example.dart 10:52                                    _scheduleAsync.<fn>
package:stack_trace/src/stack_zone_specification.dart 126:26  StackZoneSpecification._registerUnaryCallback.<fn>.<fn>
package:stack_trace/src/stack_zone_specification.dart 208:15  StackZoneSpecification._run
package:stack_trace/src/stack_zone_specification.dart 126:14  StackZoneSpecification._registerUnaryCallback.<fn>
dart:async/zone.dart 1406:47                                  _rootRunUnary
dart:async/zone.dart 1307:19                                  _CustomZone.runUnary
===== asynchronous gap ===========================
dart:async/zone.dart 1328:19                                  _CustomZone.registerUnaryCallback
dart:async/future_impl.dart 315:23                            Future.then
example/example.dart 10:40                                    _scheduleAsync
package:stack_trace/src/chain.dart 97:24                      Chain.capture.<fn>
dart:async/zone.dart 1398:13                                  _rootRun
dart:async/zone.dart 1300:19                                  _CustomZone.run
dart:async/zone.dart 1803:10                                  _runZoned
dart:async/zone.dart 1746:10                                  runZoned
package:stack_trace/src/chain.dart 95:12                      Chain.capture
example/example.dart 6:9                                      main
dart:isolate-patch/isolate_patch.dart 297:19                  _delayEntrypointInvocation.<fn>
dart:isolate-patch/isolate_patch.dart 192:12                  _RawReceivePortImpl._handleMessage

That's a lot of text! If you look closely, though, you can see that main is listed in the first trace in the chain.

Thankfully, you can call Chain.terse just like Trace.terse to get rid of all the frames you don't care about. The terse version of the stack chain above is this:

test.dart 17:3       runAsync
test.dart 13:28      scheduleAsync.<fn>
===== asynchronous gap ===========================
dart:async           _Future.then
test.dart 13:12      scheduleAsync
test.dart 7:18       main.<fn>
package:stack_trace  Chain.capture
test.dart 6:16       main

That's a lot easier to understand!