Description
While writing my second Builder, I encountered the following:
$ dart run build_runner build
Building package executable...
Built build_runner:build_runner.
[INFO] Generating build script completed, took 235ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 4.6s
[SEVERE] Nothing can be built, yet a build was requested.
[INFO] Initializing inputs
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
FileSystemException: Directory listing failed, path = 'c:\<path to project>\not\*' (OS Error: The system cannot find the path specified.
, errno = 3)
Instance of '_StringStackTrace'
Steps to reproduce
- Create a new dart package (e.g. using
dart create -t package-simple bug_report
) - Add
build_runner:
todev_dependencies
inpubspec.yaml
- Add the
build.yaml
below - Invoke
build_runner
(e.g. usingdart run build_runner build
) on Windows
# build.yaml
targets:
$default:
sources:
include:
- $package$
- lib/$lib$
- not/exists/**
Expected Results
Nothing. <path to project>/not
doesn't exist and shouldn't cause anything. I.e. exactly what happens when include
ing just not/**
. Under WSL/Ubuntu, the same example package doesn't crash.
What builder(s) you are using (or writing yourself).
I'm writing a builder that is supposed to take data from a JSON file and turn it into dart classes at build time.
Context: We're looking for a way to turn ISO alpha-2 codes into localized country names using CLDR data without using a plugin (which limits platform choices) or one of the many packages with vendored lists (usually limited to english names). Essentially, something akin to how date_symbol_data_local is generated.
In practice I'm
npm install
ing https://www.npmjs.com/package/cldr-localenames-modern as a lightweight alternative to vendoring https://github.com/unicode-org/cldr-json/tree/main/cldr-json/cldr-localenames-modern as files or a git submodule.I'm currently debugging why the JSON files (located in
<path to project>/sub_package/node_modules/...
) are not passed to the builder instance created (it prints a log statement) for the$default
target insub_package
when runningbuild_runner build
on the root project. I still don't know why not, but that's a different issue (also hit dart-lang/build#2835 in the process).However,
include
ingsub_package/node_modules/**
as test on whether the working directory was somehow wrong is how I encountered this bug.
Dart SDK Version
$ flutter pub --version
Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c860cba910 (4 weeks ago) • 2022-03-25 00:23:12 -0500
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2
What package(s) from this repo you are using, and the version
build: 2.3.0
build_config: 1.0.0
build_runner: 2.1.10
Whether you are using Windows, MacOSX, or Linux
Windows 11