samples icon indicating copy to clipboard operation
samples copied to clipboard

problems building `web/samples_index`

Open ghost opened this issue 4 years ago • 5 comments

not sure if anyone tried to build it manually on latest dart (following the readme instructions), but as per https://dart.dev/tools/pub/cmd

the standalone pub command is deprecated

so even after installing via flutter pub global activate grinder, executing grind generate results in grind: 7: pub: not found

related: https://github.com/google/grinder.dart/issues/381 (includes OS, versions, etc)

ghost avatar Jun 04 '21 08:06 ghost

Nice catch. Do you mind trying this command to see if it does the trick for you?

dart pub global activate grinder

If you have the Flutter SDK installed, the cached version of dart should be available in your path, which should make that command possible.

If it does work, I'll update the README to match.

redbrogdon avatar Jun 11 '21 00:06 redbrogdon

the real problem is: grinder internally calls pub, so expects it to be on path

  • inline aliasing pub to dart pub (within terminal session) – does not work ❌
  • global alias pub='dart pub' in .profile – works ✅
  • enclosing flutter pub $@ into a bash-script named pub – works ✅
  • manually adding /usr/lib/dart/bin/ to $PATH evidently works too :shrug: – flutter only added $HOME/snap/flutter/common/flutter/.pub-cache/bin to the path on install

but i think the linked related issue with grinder itself should be resolved first

ghost avatar Jun 11 '21 08:06 ghost

moving on..

webdev serve webdev could not run for this project. Could not find a file named "pubspec.yaml" in "~/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0".

b/c.. there is no such directory

sure, pub get _fe_analyzer_shared, done

webdev serve

[INFO] Building new asset graph completed, took 1.4s
[SEVERE] Conflicting outputs were detected and the build is unable to prompt for permission to remove them. These outputs must be removed manually or the build can be run with `--delete-conflicting-outputs`. The outputs are: lib/src/data.g.dart
Unhandled exception:
Bad state: Unable to start build daemon.
#0      _handleDaemonStartup (package:build_daemon/client.dart:82:5)
<asynchronous suspension>
#1      BuildDaemonClient.connect (package:build_daemon/client.dart:183:5)
<asynchronous suspension>
#2      _startBuildDaemon (package:webdev/src/serve/dev_workflow.dart:28:12)
<asynchronous suspension>
#3      DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:193:18)
<asynchronous suspension>
#4      ServeCommand.run (package:webdev/src/command/serve_command.dart:102:9)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#6      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:40:12)
<asynchronous suspension>
#7      main (file:///home/dym/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/webdev-2.7.4/bin/webdev.dart:19:16)
<asynchronous suspension>

ok, sure,

webdev serve --delete-conflicting-outputs Could not find an option named "delete-conflicting-outputs".

what? you JUST told me to run with that flag :facepalm:

as per https://github.com/dart-lang/webdev/issues/1177#issuecomment-723149986 , one flag is not enough, so

webdev serve web --verbose --debug-extension --enable-expression-evaluation -- --verbose --delete-conflicting-outputs --track-performance

it finally worked!

http://127.0.0.1:8080/

no thumbnails Screenshot 2021-06-11 at 10-58-18 Flutter samples_20210611085926

ghost avatar Jun 11 '21 08:06 ghost

Thanks for the deep dive, and for the friction notes.

Over the next couple weeks, I'm going to be revisiting the samples index as part of some related work on maintaining our repo structure, and will revisit this as I'm doing it.

redbrogdon avatar Jun 14 '21 19:06 redbrogdon

im kinda surprised dart/flutter projects dont have docker-ish "setup+test+run" on new empty VMs for every release, to ensure full integrity with every other part of the final system

ghost avatar Jun 14 '21 20:06 ghost