Discussion:
[dart-misc] understanding pub by stepping through it
Daniel Davidson
2015-12-05 20:47:40 UTC
Permalink
I would like to step through pub as a way to learn more about it. I use
webstorm a little, but most of my work so far is cli and not much need for
debugging (i.e. print is fine).
Do authors/contributors of pub (+Bob Nystrom, + Natalie Weizenbaum) have a
setup where they can use a debugger and if so how?

I can debug my simple CLI projects with webstorm.
For example, this runs when I debug one of my cli test cases:

/usr/lib/dart/bin/dart --ignore-unrecognized-flags --checked
--pause_isolates_on_start --enable-vm-service:38139
--trace_service_pause_events
/home/dbdavidson/dev/open_source/ebisu/test/runner.dart

But suppose I have a pubspec.xml and I want to debug pub against it in
webstorm. How?

Thanks
Dan
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2015-12-07 17:11:49 UTC
Permalink
Post by Daniel Davidson
I would like to step through pub as a way to learn more about it. I use
webstorm a little, but most of my work so far is cli and not much need for
debugging (i.e. print is fine).
Do authors/contributors of pub (+Bob Nystrom, + Natalie Weizenbaum) have a
setup where they can use a debugger and if so how?
Strangely enough, I rarely use a debugger when hacking on pub.

We started it when there was no async/await and debugger support for
asynchronous code was nonexistent. Pub also has lots of tests so I sort of
work in a TDD fashion on it.

That got me in the habit of hacking on it by writing a test and looking at
the log output and test failures to understand what's going on. I never got
out of that habit.

But suppose I have a pubspec.xml and I want to debug pub against it in
Post by Daniel Davidson
webstorm. How?
You can run pub from source. You'll need to pull down the Dart SDK
repo and build
that locally <https://github.com/dart-lang/sdk#building-dart> because the
shipped SDK only contains a snapshot for pub. The shell script that runs
pub from within the repo roughly expands to:

$ dart --package-root=<build-dir>/packages/
<repo>/third_party/pkg/pub/bin/pub.dart <args>

Where <build-dir> is the directory in the repo where build output goes
("xcodebuild" on Mac, "out" on Linux, "build" on Windows?). <repo> is the
root directory of the repo. And, of course, <args> is any arguments you
want to pass to pub.

Cheers!

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Natalie Weizenbaum' via Dart Misc
2015-12-08 22:45:17 UTC
Permalink
Unless you're already hacking on the SDK, it's probably going to be easier
to run pub from the pub repo (https://github.com/dart-lang/pub). You can
just run "dart bin/pub.dart" with a Dart executable from a
normally-distributed SDK.
Post by 'Bob Nystrom' via Dart Misc
Post by Daniel Davidson
I would like to step through pub as a way to learn more about it. I use
webstorm a little, but most of my work so far is cli and not much need for
debugging (i.e. print is fine).
Do authors/contributors of pub (+Bob Nystrom, + Natalie Weizenbaum) have
a setup where they can use a debugger and if so how?
Strangely enough, I rarely use a debugger when hacking on pub.
We started it when there was no async/await and debugger support for
asynchronous code was nonexistent. Pub also has lots of tests so I sort of
work in a TDD fashion on it.
That got me in the habit of hacking on it by writing a test and looking at
the log output and test failures to understand what's going on. I never got
out of that habit.
But suppose I have a pubspec.xml and I want to debug pub against it in
Post by Daniel Davidson
webstorm. How?
You can run pub from source. You'll need to pull down the Dart SDK repo
and build that locally <https://github.com/dart-lang/sdk#building-dart>
because the shipped SDK only contains a snapshot for pub. The shell script
$ dart --package-root=<build-dir>/packages/ <repo>/third_party/pkg/pub/bin/pub.dart
<args>
Where <build-dir> is the directory in the repo where build output goes
("xcodebuild" on Mac, "out" on Linux, "build" on Windows?). <repo> is the
root directory of the repo. And, of course, <args> is any arguments you
want to pass to pub.
Cheers!
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Continue reading on narkive:
Loading...