-
Notifications
You must be signed in to change notification settings - Fork 218
Support for node platform with --precompiled flag #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That said, I'm definitely interested in getting the full matrix of build/DDC/platform configurations, and I have some experimental work in progress to that end that will hopefully come out on the sooner end. |
That makes sense, thanks for quick response. If there is anywhere I can click "Subscribe" to follow progress on this front please let me know! |
I'll try to remember to post something here once code reviews start going up. Out of curiosity, are you interested in build mostly for the speed improvements of DDC or because you're running tests against generated code? |
Mostly to validate that my JS bindings work in both DDC and dart2js (as well as Dart code using these bindings). There are differences in how JS interop is interpreted by both compilers, the same code can run perfectly fine in dart2js but fail badly in DDC and vice versa. So I needed a way to run tests with both of them. For now I'm just gonna use a little shell script as a workaround: #!/bin/sh
pub run build_runner build --output=build/
for filename in test/*_test.dart; do
node "build/$filename.js"
done |
I am going to see if I can tackle this - we are changing the semantics and support level for --precompiled so it can be used reliably with build_runner for all scenarios. |
@pulyaevskiy this is published now if you want to give it a shot! Please file issues if it doesn't work for you :). |
hmm I checked out out the node_interop repo and I am seeing a couple problems, sent out #807 which resolves the first issue. |
Thanks @jakemac53 ! This is great. Just tried a quick run with new versions and it almost works. I'm getting errors like:
I tried to run test with Might need to fix something in build_node_compilers, not sure yet. Update: Just saw your PR, this might fix it. |
Yep - that issue should be fixed with my latest pr, can you add a dependency override on that branch and try? Should look roughly like this:
|
Sure, checking it now |
I am getting a weird permissions issue with Node locally - not sure what exactly the problem is though so I am curious if you get the same thing. |
It looks better now:
This maybe something I should fix in |
You probably just need to add a dependency on |
Yeah, added Now I'm getting some DDC/strong mode warnings with streams. And for dart2js it ran successfully except it only executed 1 test file ( |
Ok - getting somewhere! I think the strong mode errors are legit errors that need to be fixed in the node test runner bootstrapping code. |
Oh, I take it back. Looks like all tests ran it's just output is somewhat weird |
What was weird about the output? |
If I use
Here it's missing |
I'm sure it runs all the tests as numbers in the end match, so it's probably something unrelated. I think some time ago I saw similar issues with regular tests in Dart VM and it had something to do with how test package runs tests in parallel. Update: this reminded me of |
Ya I think you are right, the order I think is intentionally not consistent but the fact that the names are wrong is pretty weird. |
Ok, merged that PR but going to try and fix the runtime error for DDC before I publish a new version. |
dart-archive/stream_channel#18 was one of the issues, was quite difficult to track down lol |
@pulyaevskiy can you try now with a dependency override on master? You will also need to pub upgrade to get the latest stream_channel. |
Checking this now. Will update in a few. |
Everything works great as far as I can tell. I ran tests in node_interop, node_io and node_http packages with both dartdevc and dart2js precompiled sources and there was no issues. So cool! One question: I noticed in #811 we drop support for Dart 1 and it's only a patch version bump on this package. Shouldn't it at least go to |
yes, the "breaking" change is already managed by pub so you can't version solve to an incompatible version of package:test. |
Ah, right, so Pub would only consider versions with appropriate SDK constraint when solving? Makes sense, thanks for explanation! |
Yup! Glad to hear it works we should get this published pretty soon. |
Closing as this is just waiting on a release |
I was trying to get
build_runner
to build and run tests in node_interop package butpub run test --precompiled
doesn't seem to support node platform yet. It always falls back to compile the source itself.I have created build_node_compilers package which produces Node-compatible output. If I just build my tests and run them manually (e.g.
node build/test/some_test.dart.js
) it works fine. But it'd be really great to have it running through the standard tooling.The text was updated successfully, but these errors were encountered: