GithubHelp home page GithubHelp logo

Comments (9)

grouma avatar grouma commented on May 31, 2024

We'll need to update package:build_modules to always spawn with mode detachedWithStdio. We'll also need to work around dart-lang/sdk#35874

from webdev.

natebosch avatar natebosch commented on May 31, 2024

Why do we need detachedWithStdio if we're running from a snapshot?

If we want to run from a snapshot, should we run in an isolate?

from webdev.

grouma avatar grouma commented on May 31, 2024

The daemon needs to continue to run when webdev is killed. detachedWithStdio provides this behavior. I don't think it's possible to do this with an isolate.

from webdev.

natebosch avatar natebosch commented on May 31, 2024

The persistent workers in build_modules have the same lifespan as the daemon... Are those the workers under discussion?

from webdev.

grouma avatar grouma commented on May 31, 2024

Sorry, there are a couple things going on so let me be clear.

WebDev starts the daemon through package:build_daemon here:
https://github.com/dart-lang/build/blob/master/build_daemon/lib/client.dart#L75

Obviously this process needs to be long running and thus uses detachedWithStdio. Right now it works around pub spawning a new terminal by calling the snapshot directly:
https://github.com/dart-lang/webdev/blob/master/webdev/lib/src/serve/daemon_client.dart#L20

Ideally it would call pub.bat instead of the snapshot.

Now this daemon process spins up a bunch of worker processes through package:build_modules here: https://github.com/dart-lang/build/blob/master/build_modules/lib/src/workers.dart#L68

These don't necessarily have to be long running. Since they are spawned with the default process mode, they create new terminals. See why here: dart-lang/sdk#35809

We could change them to be isolates but that would be a breaking change to BazelWorkerDriver. These worker processes already properly shutdown if the daemon shuts down. I think it makes sense to leave them as processes and just update their mode.

from webdev.

grouma avatar grouma commented on May 31, 2024

This is mostly resolved. There is still a single flash of a terminal due to dart-lang/pub#2042

from webdev.

jakemac53 avatar jakemac53 commented on May 31, 2024

@grouma should we close this?

from webdev.

grouma avatar grouma commented on May 31, 2024

There is no work to be done on webdev. This issue will be fully resolved once dart-lang/pub#2042 is resolved.

from webdev.

grouma avatar grouma commented on May 31, 2024

Closing this since there isn't work to be done in webdev.

from webdev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.