devtools
devtools copied to clipboard
Devtool Extension does not load in Devtools for git dependencies (with build generated)
We are attempting a workflow where we use our CD flow in GitHub Actions to build the artifacts for our devtool extension on rohd and push them to a separate branch. The goal is that users can point to a pre-release version of our package hosted on git but still benefit from the devtools extension by pointing to this special branch instead of main. But, we're not seeing the devtools extension show up in devtools when we point it there.
If helpful, this PR (https://github.com/intel/rohd/pull/461) has the relevant changes we're making, and here's a dependency override that we expected would work (on a fork, for now):
dependency_overrides:
rohd:
git:
url: https://github.com/quekyj/rohd.git
ref: artifacts
You can see all the build output located here: https://github.com/quekyj/rohd/tree/artifacts/extension/devtools/build
This isn't working for me on Dart SDK version: 3.3.0 (stable) (None) on "linux_x64"
(in windows 11 WSL2 ubuntu)
Here's a tiny example program that you can set a breakpoint on after the call to .build()
, and the extension should show up in the devtools and show the built module within it
import 'package:rohd/rohd.dart';
class MyMod extends Module {
MyMod(Logic x) {
x = addInput('x', x);
}
}
void main(List<String> arguments) async {
final m = MyMod(Logic());
await m.build();
print(m.generateSynth());
}
This is a follow-up to this Discord discussion: https://discord.com/channels/608014603317936148/1159561514072690739/1206721049430069248
After you run dart pub get
on the package with the git dependency, can you check your .dart_tool/package_config.json
file for the rohd
entry. The pub cache location it points to is where DevTools looks for the rohd/extension/devtools
folder. Do you see the content you expect in that location?
After you run
dart pub get
on the package with the git dependency, can you check your.dart_tool/package_config.json
file for therohd
entry. The pub cache location it points to is where DevTools looks for therohd/extension/devtools
folder. Do you see the content you expect in that location?
Yes, I see the built devtools extension in the downloaded git dependency
{
"name": "rohd",
"rootUri": "file:///home/max/.pub-cache/git/rohd-aba2c2ffac83c318615160b4172aa771f8422d45/",
"packageUri": "lib/",
"languageVersion": "2.19"
},
$ ls /home/max/.pub-cache/git/rohd-aba2c2ffac83c318615160b4172aa771f8422d45/extension/devtools/build/
assets canvaskit favicon.png flutter.js flutter_service_worker.js icons index.html main.dart.js manifest.json version.json
Are you also on the latest version of the devtools_extensions
package and Flutter master?
I believe this was built on devtools_extensions 0.0.12 based on the actions run (vs. 0.0.14 current latest): https://github.com/quekyj/rohd/actions/runs/7913672857/job/21601807816
I'll try rerunning with the latest in case some recent change or fix resolves the issue. Is there any reason you'd expect it not to have worked on 0.0.12?
Oh also, it looks like we're running on "Flutter SDK version "3.18.0-0.2.pre" from the beta channel on linux", so we'll update that too.
@quekyj has shown me that using Flutter 3.19.0-0.3.pre on beta channel on Windows 11 (and the Dart version included) does properly load up the devtools extension. So perhaps this is specific to the version of Dart/Flutter, or Linux vs. Windows, or WSL vs. native?
It is possible that you were hitting some bugs that we've fixed in later versions of DevTools and / or the devtools_extensions package. Extension authors should develop their extensions using Flutter master (at least right now while the package is immature). But your extension should be able to be loaded by a user that is on Flutter stable.
As an update, building with flutter stable 3.19.3, consuming with Dart 3.3.3 in WSL still doesn't have any rohd extension show up in the devtools.
dependency_overrides:
rohd:
git:
url: https://github.com/intel/rohd
ref: artifacts
This using not quite the latest devtools (0.1.0) stuff because it seems flutter_test
is not compatible with vm_service 14.0.0 yet.
Here's the output from running and building the devtools extension: https://github.com/intel/rohd/actions/runs/8557398136/job/23449524118
+ devtools_app_shared 0.0.9 (0.1.0 available)
+ devtools_extensions 0.0.13 (0.1.0 available)
+ devtools_shared 6.0.4 (8.1.0 available)
Here's some reproduction steps on non-WSL using a GitHub codespace container, so it should be portable.
- Go to https://github.com/intel/rohd-vf and create a GitHub codespace on
main
. - Add the
artifacts
branch as a dependency override to pubspec.yaml (and pub get/upgrade):
dependency_overrides:
rohd:
git:
url: https://github.com/intel/rohd
ref: artifacts
- Set a breakpoint in
example/main.dart
atSimulator.setMaxSimTime(300);
(line 32) and launch themain
in debug mode. - Open devtools in browser. Note this is a little trickier in a codespace:
- After clicking "open devtools in browser", it will open a new tab but not connect
- Find the port number from the debug console in the codespace window
- In the ports tab, make that port "public" visibility, then copy the forwarded address
- Concatenate that forwarded address with the rest of the path from the debug console after the port, and put that into the devtools web page
- Observe that the "rohd" extension is not visible
Fixed by https://github.com/flutter/devtools/pull/7533. Thanks for flagging this issue with clear repro steps - made it easy to address.