Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize and promote dart run --resident #54245

Open
Levi-Lesches opened this issue Dec 5, 2023 · 1 comment
Open

Stabilize and promote dart run --resident #54245

Levi-Lesches opened this issue Dec 5, 2023 · 1 comment
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-run Issues related to 'dart run' P2 A bug or feature request we're likely to work on

Comments

@Levi-Lesches
Copy link

When exploring dart run -h, I found this:

-r, --resident   Enable faster startup times with the resident frontend compiler.
                 See 'dart compilation-server -h' for more information.

So I ran dart compilation-server -h and saw the options to start or stop the server. This surprised me because I couldn't find compilation-server in dart --help, so it felt a bit hidden. But it's a great feature -- it sped up my start-up time from 20s to < 1s (albeit, on a Raspberry Pi).

When running dart run -r for the first time in a session, I get the following error:

$ dart run -r
Failed to build bin\subsystems.dart:
SocketException: The remote computer refused the network connection.
 (OS Error: The remote computer refused the network connection.
, errno = 1225), address = 127.0.0.1, port = 42800

Running the command again works fine, I imagine this is starting up the server but not waiting long enough for it to connect. The next time the command runs, I get the message that the server is running, but on a different port than what was reported in the error.

I get why keeping Dart running as a daemon isn't the default option, but I think it's useful enough to be polished and promoted.

cc @mraleph

General info

  • Dart 3.2.2 (stable) (Tue Nov 28 11:22:54 2023 +0000) on "windows_x64"
  • on windows / "Windows 10 Home" 10.0 (Build 22631)
  • locale is en-US

Process info

Memory CPU Elapsed time Command line
81 MB -- dart.exe
@lrhn lrhn added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-run Issues related to 'dart run' labels Dec 6, 2023
@bkonyi
Copy link
Contributor

bkonyi commented Dec 6, 2023

cc @a-siva

@a-siva a-siva added the P2 A bug or feature request we're likely to work on label Feb 23, 2024
copybara-service bot pushed a commit that referenced this issue Mar 20, 2024
…orrectly

TEST=Test cases added to pkg/dartdev/test/commands/run_test.dart and
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: #54245
Change-Id: Iebd20c82dd9aeac44fd9ec76206a5a3a15403829
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358543
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 2, 2024
…ation-server`

TEST=CI

Issue: #54245
Change-Id: I1806e1ef62e17d626e1bc37a10f67e6e8b402a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358741
Reviewed-by: Ben Konyi <bkonyi@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 2, 2024
…iler-info-file option

For backwards compatibility reasons, the arg parser will still understand --resident-server-info-file, but it will not print a help message for it.

TEST=pkg/dartdev/test/commands/compilation_server_test.dart and
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: #54245
Change-Id: I59a1a7c495194ff3c48de7fb65255de5d9f150f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359660
Reviewed-by: Ben Konyi <bkonyi@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 2, 2024
…ompiler-info-file

TEST=test case added to
pkg/dartdev/test/commands/compilation_server_test.dart

Issue: #54245
Change-Id: I3d982a8d85b63fed8510144bade71e2c95ced121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359581
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 3, 2024
…ile is inaccessible

Issue: #54245
Change-Id: Ibfe8d7277bca9d1ef94c9c84248d2a98eb3335ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 3, 2024
…rnel files or snapshots

Refer to the magic numbers in https://github.com/dart-lang/sdk/blob/main/runtime/bin/dartutils.cc

TEST=pkg/dartdev/test/resident_frontend_utils_test.dart, manual testing

Issue: #54245
Fixes: #49694
Change-Id: I3ba67f4a68898c3f8b24d19a7516e3d8713d886d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359921
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 12, 2024
function

TEST=test cases added to
pkg/dartdev/test/commands/compilation_server_test.dart and
pkg/dartdev/test/commands/run_test.dart

This CL factors out shutDownOrForgetResidentFrontendCompiler from the
CompilationIssue.serverError handling code in RunCommand. This CL also
changes the error handling logic of `dart run --resident` and
`dart compilation-server shutdown` to stop them from displaying
unactionable errors to the user, and instead have them handle those
errors more gracefully.

Issue: #54245
Change-Id: I214392911dbb44e3273ffd36f8f59f791b33494c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362520
Reviewed-by: Ben Konyi <bkonyi@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 12, 2024
TEST=test case added to
pkg/dartdev/test/resident_frontend_utils_test.dart

Issue: #54245
Change-Id: I5b1d5227657cb9c17d6c4e84be9e23d36c04571f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 17, 2024
…nt frontend compilers are started and when they are used

TEST=test case added to pkg/dartdev/test/commands/run_test.dart

Issue: #54245
Fixes: #55349
Change-Id: Ic3db064d0975e6b999beefed8b6fc32d2c603cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362522
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-run Issues related to 'dart run' P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

5 participants