Skip to content

Unable to set breakpoints in dependencies from non-Pub sources that contain slashes in their URLs #2776

@DanTup

Description

@DanTup

This was raised by @SteveHawes at Dart-Code/Dart-Code#5898. I've tried to debug, but I'm not too familiar with the dwds code and I believe the issue is here somewhere.

To reproduce:

  • Be on macOS (I don't know why, but I can't repro on Windows)
  • Create an empty Flutter project
  • Add a dependency to pkg:args hosted here at a URL with slashes in it:
      args:
        hosted: https://dart.cloudsmith.io/ews/dart-bug/
        version: ^2.7.0
    
  • Add call to the code like var a = ArgParser().parse([]); in your main build method
  • Ctrl+Click into parse() and add a breakpoint somewhere in code that will be hit
  • Run the app using the Chrome device

The breakpoint is never hit and does not resolve:

Image

The path on disk has url-encoded slashes in it, so the folder is named like dart.cloudsmith.io%47ews%47dart-bug on disk. In package_config.json, the path is recorded as a file:/// URI, so it gets encoded again. This means it shows as dart.cloudsmith.io%2547ews%2547dart-bug there (and in any places using file:/// URIs).

The VM Service traffic all looks reasonable, but my guess is that somewhere the url-encoding is being interpreted incorrectly, but it's tricky to debug (I don't know how I can attach a debugger to dwds when running against a real Flutter app, nor how to reproduce this in a test - as outside of Pub deps, I can't get characters like this to work in local files in the project, because both the analyzer and the compiler seem to handle them badly).

One thing I did notice in the VM Service traffic is that in some places there are incorrect paths that look like /Users/danny/Dev/Test Projects/dartcode_5898/packages/args/src/usage.dart, but this is not where the package is (I know the packages are at /packages/ for the web, but it seems like they should get mapped back to the pub cache and never to this path?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onpackage:dwdstriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions