Giter Club home page Giter Club logo

Comments (17)

bkonyi avatar bkonyi commented on August 16, 2024 1

Platform.executable definitely doesn't do what I thought (I assumed it returned the path to the executable without resolving symlinks), so I'm going to revert this for now. See https://dart-review.googlesource.com/c/sdk/+/373381.

from sdk.

a-siva avatar a-siva commented on August 16, 2024 1

https://dart-review.googlesource.com/c/sdk/+/373381 has landed, closing this issue.

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024 1

I've managed to track down the cause of the issue.

If the user has dart on their PATH and invokes dart compile js (which spawns the VM service after compilation completes), the VM service would attempt to spawn DDS using ./dart as the executable path instead of dart. This would result in DDS failing to start since ./dart didn't exist, causing the VM to print an error and hang.

The fix here is to check to see if the parent directory of Platform.executable is . and then verify if ./dart exists or not. If it doesn't, dart is likely on the user's PATH and should be used directly as the executable path.

I have a CL almost ready for review that should resolve this issue and allow for relanding the reverted commit (see CL here).

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

@srujzs I'm unable to reproduce at HEAD and can't find 21ee651cc4ed07e5729d727dfbd5f15498bc31fd. Can you please confirm the revision you're seeing this on?

from sdk.

derekxu16 avatar derekxu16 commented on August 16, 2024

I downloaded the latest main channel release from https://storage.googleapis.com/dart-archive/channels/main/raw/latest/sdk/dartsdk-macos-arm64-release.zip with --version output Dart SDK version: 3.5.0-edge.4abd615d3279573ad4711995a545ed156da8a315 (main) (Wed Jun 26 17:18:17 2024 +0000) on "macos_arm64" and dart compile js works using it for me.

from sdk.

derekxu16 avatar derekxu16 commented on August 16, 2024

Actually, it looks Wed Jun 26 10:35:50 2024 -0700 is a bit newer than Wed Jun 26 17:18:17 2024 +0000, so let me try building the SDK locally.

from sdk.

srujzs avatar srujzs commented on August 16, 2024

Ah apologies, that was with a local revert CL. I can repro with Dart SDK version: 3.5.0-edge.3180d9545360cfb176a90d45db48009cf1beb842 (main) (Tue Jun 25 21:12:28 2024 +0000) on "macos_arm64".

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

Ah apologies, that was with a local revert CL. I can repro with Dart SDK version: 3.5.0-edge.3180d9545360cfb176a90d45db48009cf1beb842 (main) (Tue Jun 25 21:12:28 2024 +0000) on "macos_arm64".

@derekxu16 and I are both unable to reproduce with 3180d9545360cfb176a90d45db48009cf1beb842. This is from a locally built SDK?

from sdk.

srujzs avatar srujzs commented on August 16, 2024

Yes. It looks like this is the cause (for me at least), which makes sense with the error:

final dartDir = File(Platform.executable).parent.path;

Reverting that to resolvedExecutable fixes the issue. It's possible that executable gives us different behavior here.

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

Yes. It looks like this is the cause (for me at least), which makes sense with the error:

final dartDir = File(Platform.executable).parent.path;

Reverting that to resolvedExecutable fixes the issue. It's possible that executable gives us different behavior here.

Are you using symlinks anywhere by any chance?

from sdk.

srujzs avatar srujzs commented on August 16, 2024

Not that I'm aware of. Does Platform.executable give you a full path instead of just dart on your machine?

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

Hm, good question... do you have dart on your path at all? Maybe that's why I'm unable to reproduce.

from sdk.

srujzs avatar srujzs commented on August 16, 2024

Yup, I have this in my .bashrc:

export PATH=$PATH:~/dart-sdk/sdk/xcodebuild/ReleaseARM64/dart-sdk/bin/

from sdk.

a-siva avatar a-siva commented on August 16, 2024

If the user has dart on their PATH and invokes dart compile js (which spawns the VM service after compilation completes), the VM service would attempt to spawn DDS using ./dart as the executable path instead of dart. This would result in DDS failing to start since ./dart didn't exist, causing the VM to print an error and hang.

Does this spawning of VM service after compilation is done need to also attempt to spawn DDS ?

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

DDS is responsible for serving DevTools, so we probably want to spawn DDS when we can.

from sdk.

a-siva avatar a-siva commented on August 16, 2024

DDS is responsible for serving DevTools, so we probably want to spawn DDS when we can.

I agree but the command line 'dart compile js' does not imply start vm service for debugging, shouldn't 'dart --enable-vm-service compile js' be needed for that ?

from sdk.

bkonyi avatar bkonyi commented on August 16, 2024

DDS is responsible for serving DevTools, so we probably want to spawn DDS when we can.

I agree but the command line 'dart compile js' does not imply start vm service for debugging, shouldn't 'dart --enable-vm-service compile js' be needed for that ?

While that's true, there's currently no way to only enable the VM service without enabling DDS, and there could be functionality provided by DDS that developers want to utilize. If we want to provide a way to not start DDS, we'd need to add a named parameter to this API which I'm not sure we'd want to do.

from sdk.

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.