Skip to content
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

Unable to build node_io example on Dart 2.5 #67

Closed
matthewtsmith opened this issue Sep 20, 2019 · 4 comments · Fixed by #68
Closed

Unable to build node_io example on Dart 2.5 #67

matthewtsmith opened this issue Sep 20, 2019 · 4 comments · Fixed by #68

Comments

@matthewtsmith
Copy link

matthewtsmith commented Sep 20, 2019

We have a project that uses node_io that is no longer building after upgrading Dart to 2.5.

As a sanity check, I cloned the node-interop repo and attempted to build node_io. It's producing the same error. Here is the output:

➜  node_io git:(master) pub run build_runner build --output=build
[INFO] Generating build script completed, took 284ms
[INFO] Creating build script snapshot... completed, took 11.3s
[INFO] Building new asset graph completed, took 992ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 5ms
[WARNING] build_node_compilers:entrypoint on example/node_io.dart:
Skipping compiling node_io|example/node_io.dart with dart2js because some of its
transitive libraries have sdk dependencies that not supported on this platform:

node_io|lib/src/directory.dart
node_io|lib/src/http_headers.dart
node_io|lib/src/network_interface.dart
node_io|lib/src/file.dart
node_io|lib/src/streams.dart
node_io|lib/node_io.dart
node_io|lib/src/internet_address.dart
node_io|lib/src/link.dart
node_io|lib/src/file_system_entity.dart
node_io|lib/src/http_server.dart

https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

[INFO] Running build completed, took 3.2s
[INFO] Caching finalized dependency graph completed, took 108ms
[INFO] Creating merged output dir `build` completed, took 648ms
[INFO] Writing asset manifest completed, took 4ms
[INFO] Succeeded after 4.0s with 1215 outputs (4028 actions)

It appears to be skipping any file that imports dart:io.

The issue seems to be with build_node_compilers 0.2.2. If I pin it at 0.2.1 it builds successfully.

@pulyaevskiy
Copy link
Owner

Thanks for reporting. This is definitely an issue. Will see what can be done there.

@pulyaevskiy
Copy link
Owner

I submitted a PR that addresses this issue. I'm not sure if it's the best solution yet but you can test it out by adding a dependency override:

dependency_overrides:
  build_node_compilers:
    git:
      url: https://github.com/pulyaevskiy/node-interop.git
      path: build_node_compilers
      ref: skip-platform-check-for-node-io

Let me know if it works for you.

@matthewtsmith
Copy link
Author

@pulyaevskiy This fix is working for me. Thanks!

@pulyaevskiy
Copy link
Owner

Just released 0.2.3 with this included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants