Skip to content

Remove --disable-dart-dev across org: flutter #154268

Description

@matanlurey

This issue is to track removing a flag that used to be important-ish, but no longer is, and is used across the Flutter codebase.

@bkonyi:

There used to be a slight performance benefit running with --disable-dart-dev when attempting to debug since we used to launch DDS from dartdev, so providing that flag would effectively just tell the VM to skip starting the dartdev isolate and DDS. Now that dart:_vmservice is responsible for starting DDS, this isn't really the case anymore.

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    P2Important issues not at the top of the work list
    c: tech-debtTechnical debt, code quality, testing, etc.
    on Aug 28, 2024
  2. self-assigned this
    on Aug 28, 2024
  3. aam commented on Aug 29, 2024

    @aam
    Member

    @bkonyi:

    There used to be a slight performance benefit running with --disable-dart-dev when attempting to
    debug since we used to launch DDS from dartdev, so providing that flag would effectively just tell
    the VM to skip starting the dartdev isolate and DDS. Now that dart:_vmservice is responsible for
    starting DDS, this isn't really the case anymore.

    Looking at https://github.com/dart-lang/sdk/blob/a0411ae24485526470b7f99148132f29fe01edcb/runtime/bin/main_impl.cc#L1419 it seems that --disable-dart-dev still bypasses dartdev isolate from launching, which might still be relevant for flutter to avoid.

  4. bkonyi commented on Aug 29, 2024

    @bkonyi
    Contributor

    @bkonyi:

    There used to be a slight performance benefit running with --disable-dart-dev when attempting to
    debug since we used to launch DDS from dartdev, so providing that flag would effectively just tell
    the VM to skip starting the dartdev isolate and DDS. Now that dart:_vmservice is responsible for
    starting DDS, this isn't really the case anymore.

    Looking at https://github.com/dart-lang/sdk/blob/a0411ae24485526470b7f99148132f29fe01edcb/runtime/bin/main_impl.cc#L1419 it seems that --disable-dart-dev still bypasses dartdev isolate from launching, which might still be relevant for flutter to avoid.

    The DartDev isolate will only launch if a command is provided (e.g., dart run foo.dart instead of dart foo.dart) so there really won't be much performance benefit.

  5. aam commented on Aug 29, 2024

    @aam
    Member

    I see, thanks Ben, but conceptually if flutter doesn't use dartdev, passing the flag still makes sense.

  6. matanlurey commented on Aug 29, 2024

    @matanlurey
    ContributorAuthor

    I see, thanks Ben, but conceptually if flutter doesn't use dartdev, passing the flag still makes sense.

    Alex / Ben - My understanding from talking to Ben (but also Jonah, etc), is this flag was historically used when there was a transition from dart being strictly the VM entrypoint to being a unified CLI tool, and during that transition period there being significant performance and stability benefits.

    If we still think those are true (either or/both), let's revert this change - otherwise if we don't think there is any real motivation to do so, I'd prefer not having flags that "used to be useful" in the codebase as they tend to get copied without understanding.

  7. bkonyi commented on Aug 29, 2024

    @bkonyi
    Contributor

    I don't think there's any significant performance or stability benefits of passing this flag anymore. Also, there's a good chance this flag goes away as Siva migrates dart to be an AOT executable of DartDev that calls into dartvm to run code from source, so it's better to remove it.

  8. matanlurey commented on Aug 29, 2024

    @matanlurey
    ContributorAuthor

    I ran into one difficult case where dev/devicelab/lib/framework/runner.dart seems load-bearing on --disable-dart-dev. I debugged it a bit with @jonahwilliams. We can reproduce the error locally by running the following (substitute your own paths):

    BOT=true LANG=en_US.UTF-8 /Users/matanl/Developer/flutter/bin/cache/dart-sdk/bin/dart --enable-vm-service --no-pause-isolates-on-exit bin/tasks/smoke_test_setup_failure.dart 
    Could not start the VM service:
    DartDevelopmentServiceException: Failed to start Dart Development Service
    vm-service: Error: Unhandled exception:
    HttpException: HttpServer is not bound to a socket
    #0      _HttpServer.address (dart:_http/http_impl.dart:3327:17)
    #1      Server.serverAddress (dart:vmservice_io/vmservice_server.dart:259:25)
    #2      Server.startup (dart:vmservice_io/vmservice_server.dart:616:24)
    <asynchronous suspension>
    #3      _toggleWebServer (dart:vmservice_io:244:5)
    <asynchronous suspension>

    I'll work on addressing this in the next PR.

  9. matanlurey commented on Aug 29, 2024

    @matanlurey
    ContributorAuthor

    Found the root cause, blocked on dart-lang/sdk#56606.

  10. matanlurey commented on Sep 10, 2024

    @matanlurey
    ContributorAuthor

    This is now unblocked and the last 2 PRs are in review.

  11. matanlurey commented on Sep 10, 2024

    @matanlurey
    ContributorAuthor
  12. github-actions commented on Sep 24, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.c: tech-debtTechnical debt, code quality, testing, etc.dependency: dartDart team may need to help usdependency:dart-triagedTriaged by Dart team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions