Skip to content

"dart --packages=.dart_tool/package_config.json test" does not work as expected #62074

@RossComputerGuy

Description

@RossComputerGuy

When running dart --packages=.dart_tool/package_config.json test in Nix, I get this error:

Got socket error trying to find package test at https://pub.dev.

Even though the packages are already loaded in. If I build outside of nix with it, I get this error:

Could not find an option named "--packages".

This sounds like the argument isn't accepted, this causes dart to fetch resources over the network inside of a sandboxed derivation. This is a problem since sandboxed derivations do not have network access because the output is not a fixed output. The fix would be to have dart test accept that flag, dart run seems to take it just fine and dart compile does not have this problem.

dart info:

#### General info

- Dart 3.9.4 (stable) (Tue Sep 30 12:08:50 2025 -0700) on "linux_arm64"
- on linux / Linux 6.12.58 #1-NixOS SMP Thu Nov 13 20:34:41 UTC 2025
- locale is ja_JP.UTF-8

#### Project info

- sdk constraint: '^3.9.3'
- dependencies:
- dev_dependencies:

#### Process info

No Dart processes found

Other pieces of the Dart ecosystem are maintained elsewhere; please file issues in their respective repositories:

If you have a question, instead of using this issue tracker, please refer to the community resources at: https://dart.dev/community#join-the-conversation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.dart-cli-testIssues related to the 'dart test' tool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions