Skip to content

null-safety: Need the ability to precompile executables that require experiments to be enabled #2504

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

Closed
kevmoo opened this issue May 27, 2020 · 6 comments

Comments

@kevmoo
Copy link
Member

kevmoo commented May 27, 2020

fails as follows for several null-safe migrations

See null-safety branches for vector_math, clock, fake_async.

Seeing this with 2.9.0-11.0.dev – but with previous dev releases, too.

> DART_VM_OPTIONS="--enable-experiment=non-nullable" pub run test
Precompiling executable... (6.8s)
Failed to precompile test:test:
../../.pub-cache/git/test-22ffc0a2e2798ca461d745fdc5079a03d58736ce/pkgs/test_core/lib/src/executable.dart:21:19: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
StreamSubscription? signalSubscription;
                  ^
../../.pub-cache/git/test-22ffc0a2e2798ca461d745fdc5079a03d58736ce/pkgs/test_core/lib/src/executable.dart:180:25: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
void _printUsage([String? error]) {
                        ^
../../.pub-cache/git/test-22ffc0a2e2798ca461d745fdc5079a03d58736ce/pkgs/test_api/lib/src/backend/runtime.dart:55:16: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
  final Runtime? parent;
               ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:100:4: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
Uri? _currentUriBase;
   ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:106:7: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
String? _current;
      ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:120:16: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
        [String? part2,
               ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:121:15: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
        String? part3,
              ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:122:15: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
        String? part4,
              ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:123:15: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
        String? part5,
              ^
../../.pub-cache/git/path-34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8/lib/path.dart:124:15: Error: This requires the 'non-nullable' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.9 or higher, and running 'pub get'.
        String? part6,
              ^

pubspec.lock

# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
  _fe_analyzer_shared:
    dependency: transitive
    description:
      name: _fe_analyzer_shared
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.0.0"
  analyzer:
    dependency: transitive
    description:
      name: analyzer
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.39.8"
  args:
    dependency: transitive
    description:
      name: args
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.6.0"
  async:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: e1d180cd049e7786c1fcd04a2c0343a2037259e5
      url: "git://github.com/dart-lang/async.git"
    source: git
    version: "2.4.1"
  boolean_selector:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: beb96996323cf7af05ae2ea592c0e4489797f271
      url: "git://github.com/dart-lang/boolean_selector.git"
    source: git
    version: "2.1.0-dev"
  charcode:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: "37656ef364141ae352d904bfafd0278ceee12703"
      url: "git://github.com/dart-lang/charcode.git"
    source: git
    version: "1.1.3"
  collection:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: "6ef56d3e8cfa4d347cbf70321251c5bb87acc9a1"
      url: "git://github.com/dart-lang/collection.git"
    source: git
    version: "1.14.13-dev"
  convert:
    dependency: transitive
    description:
      name: convert
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.1"
  coverage:
    dependency: transitive
    description:
      name: coverage
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.13.9"
  crypto:
    dependency: transitive
    description:
      name: crypto
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.5"
  csslib:
    dependency: transitive
    description:
      name: csslib
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.16.1"
  glob:
    dependency: transitive
    description:
      name: glob
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.2.0"
  html:
    dependency: transitive
    description:
      name: html
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.14.0+3"
  http:
    dependency: transitive
    description:
      name: http
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.12.1"
  http_multi_server:
    dependency: transitive
    description:
      name: http_multi_server
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.2.0"
  http_parser:
    dependency: transitive
    description:
      name: http_parser
      url: "https://pub.dartlang.org"
    source: hosted
    version: "3.1.4"
  io:
    dependency: transitive
    description:
      name: io
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.3.4"
  js:
    dependency: transitive
    description:
      name: js
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.6.1+1"
  logging:
    dependency: transitive
    description:
      name: logging
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.11.4"
  matcher:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: b7f571dcd2d95fc98c03b1a27fdcd1f28380242c
      url: "git://github.com/dart-lang/matcher.git"
    source: git
    version: "0.12.7"
  meta:
    dependency: "direct overridden"
    description:
      path: "pkg/meta"
      ref: null_safety-pkgs
      resolved-ref: e8ee60ee958aa7082d5aca17b27208a73012ea03
      url: "git://github.com/dart-lang/sdk.git"
    source: git
    version: "1.2.0-dev"
  mime:
    dependency: transitive
    description:
      name: mime
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.9.6+3"
  multi_server_socket:
    dependency: transitive
    description:
      name: multi_server_socket
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.2"
  node_interop:
    dependency: transitive
    description:
      name: node_interop
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.1"
  node_io:
    dependency: transitive
    description:
      name: node_io
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.1"
  node_preamble:
    dependency: transitive
    description:
      name: node_preamble
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.4.9"
  package_config:
    dependency: transitive
    description:
      name: package_config
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.9.3"
  path:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: "34d0cb2a7e312ad28db7ecdfe48c84def2eaf4e8"
      url: "git://github.com/dart-lang/path.git"
    source: git
    version: "1.7.1-dev"
  pedantic:
    dependency: "direct dev"
    description:
      name: pedantic
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.9.0"
  pool:
    dependency: transitive
    description:
      name: pool
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.4.0"
  pub_semver:
    dependency: transitive
    description:
      name: pub_semver
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.4.4"
  shelf:
    dependency: transitive
    description:
      name: shelf
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.7.5"
  shelf_packages_handler:
    dependency: transitive
    description:
      name: shelf_packages_handler
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.0.0"
  shelf_static:
    dependency: transitive
    description:
      name: shelf_static
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.2.8"
  shelf_web_socket:
    dependency: transitive
    description:
      name: shelf_web_socket
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.2.3"
  source_map_stack_trace:
    dependency: transitive
    description:
      name: source_map_stack_trace
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.0.0"
  source_maps:
    dependency: transitive
    description:
      name: source_maps
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.10.9"
  source_span:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: e012c14e49294dc8e478624dfc95d87c63500b0e
      url: "git://github.com/dart-lang/source_span.git"
    source: git
    version: "1.6.1-dev"
  stack_trace:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: "1e3883ba8bce7d50d01d972bb3a1db5675edc487"
      url: "git://github.com/dart-lang/stack_trace.git"
    source: git
    version: "1.10.0-dev"
  stream_channel:
    dependency: transitive
    description:
      name: stream_channel
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.0.0"
  string_scanner:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: bde700a90b9ff22828c393a434599856f0073d0f
      url: "git://github.com/dart-lang/string_scanner.git"
    source: git
    version: "1.0.5"
  term_glyph:
    dependency: "direct overridden"
    description:
      path: "."
      ref: null_safety
      resolved-ref: e1f7d191d197c2acdb16f556f18b9d767899018a
      url: "git://github.com/dart-lang/term_glyph.git"
    source: git
    version: "1.1.1-dev"
  test:
    dependency: "direct dev"
    description:
      path: "pkgs/test"
      ref: null_safety
      resolved-ref: "22ffc0a2e2798ca461d745fdc5079a03d58736ce"
      url: "git://github.com/dart-lang/test.git"
    source: git
    version: "1.14.5-dev"
  test_api:
    dependency: "direct overridden"
    description:
      path: "pkgs/test_api"
      ref: null_safety
      resolved-ref: "22ffc0a2e2798ca461d745fdc5079a03d58736ce"
      url: "git://github.com/dart-lang/test.git"
    source: git
    version: "0.3.0-dev"
  test_core:
    dependency: "direct overridden"
    description:
      path: "pkgs/test_core"
      ref: null_safety
      resolved-ref: "22ffc0a2e2798ca461d745fdc5079a03d58736ce"
      url: "git://github.com/dart-lang/test.git"
    source: git
    version: "0.3.5-dev"
  typed_data:
    dependency: transitive
    description:
      name: typed_data
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.6"
  vm_service:
    dependency: transitive
    description:
      name: vm_service
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.0.4"
  watcher:
    dependency: transitive
    description:
      name: watcher
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.9.7+15"
  web_socket_channel:
    dependency: transitive
    description:
      name: web_socket_channel
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.1.0"
  webkit_inspection_protocol:
    dependency: transitive
    description:
      name: webkit_inspection_protocol
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.7.3"
  yaml:
    dependency: transitive
    description:
      name: yaml
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.2.1"
sdks:
  dart: ">=2.9.0-1 <3.0.0"
@kevmoo
Copy link
Member Author

kevmoo commented May 27, 2020

FYI: adding a path override to a local copy of test_core at the same SHA allows tests to pass w/ vector_math 🤷

CC @jakemac53

@kevmoo kevmoo changed the title null-safety: several packages cannot run with experiment enabled null-safety: several packages cannot run tests with experiment enabled May 27, 2020
@kevmoo
Copy link
Member Author

kevmoo commented May 27, 2020

FYI: given the change in behavior w/ path vs git deps, I'm guessing this is an SDK bug. But we can wait until we get the investigation finished before we make a call!

@jakemac53 jakemac53 transferred this issue from dart-lang/test May 27, 2020
@jakemac53
Copy link
Contributor

Moving to the pub repo - this is an issue with precompiling of scripts not respecting the DART_VM_OPTIONS environment variable.

We need some mechanism for enabling pre-compilation of package executables that require experiments to be enabled - whether that is through the environment variable or some other mechanism.

The reason you don't see this on some packages, or when adding a path dependency, is it doesn't attempt to precompile executables if the package it comes from depends on any path dependency (including the current package). So it works for any dependency of package:test.

@jakemac53 jakemac53 changed the title null-safety: several packages cannot run tests with experiment enabled null-safety: Need the ability to precompile executables that require experiments to be enabled May 27, 2020
@kevmoo
Copy link
Member Author

kevmoo commented May 27, 2020

CC @sigurdm @jonasfj @mit-mit – looks like a pub issue

@jakemac53
Copy link
Contributor

Actually now that I think about it this will likely be resolved by #2492. Feel free to close as a dupe if that is indeed the case.

@kevmoo
Copy link
Member Author

kevmoo commented May 27, 2020

Closing this as a duplicate of dart-lang/sdk#41355 (which should probably be in the pub repo)

I confirmed that the current commit for the (draft) PR #2493 does indeed fix the issue.

I can run pub run --enable-experiment=non-nullable test and it "just works"

@kevmoo kevmoo closed this as completed May 27, 2020
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

No branches or pull requests

2 participants