Skip to main content

runfiles 0.9.0 copy "runfiles: ^0.9.0" to clipboard
runfiles: ^0.9.0 copied to clipboard

Bazel runfiles library for Dart. Locates data files at runtime.

Changelog #

0.9.0 #

Breaking #

  • dart_binary resolves relative imports when its own srcs include a generated file
  • Removed colocate_entrypoint from utils.bzl
  • Runfiles.rlocation throws on .. and . path segments, as Bazel's runfiles libraries do
  • Runfiles.rlocation returns absolute paths unchanged and reads escaped manifest lines
  • Runfiles.rlocation finds files inside tree artifacts and in a MANIFEST in RUNFILES_DIR
  • Codegen rules make dependencies' resources visible to generators in a sandbox and on RBE
  • Codegen shims read the pubspec.yaml and analysis_options.yaml a target passes in asset_deps
  • Codegen generators in a persistent worker cannot read files their dependencies did not declare
  • pub.from_lock() and pub.package() refuse a hosted package without a sha256
  • pub.from_lock() and pub.package() refuse a sha256 that is not 64 lowercase hex digits
  • pub.from_lock() fails when two locks give one version different digests
  • pub.package() fetches pub.dev archives that have padding after the gzip stream
  • Pub packages drop symlinks that point outside the package, as pub does
  • Fetched pub packages are reused across output bases from the repository cache
  • dart_library checks its imports in its own _validation output group
  • Imports by file:, other schemes, ../lib/ paths or escaping paths fail the import check
  • A part its dart_library does not hold fails the import check
  • $(location) of a kernel or aot-snapshot dart_binary names a launcher, not the output
  • kernel and aot-snapshot dart_binarys run with bazel run and as another target's data
  • bazel run @rules_dart//dart works on Windows and writes no analytics into your home
  • Removed DartInfo.package_name and DartInfo.lib_root; read DartInfo.packages
  • DartInfo.deps maps each dependency to a tuple of its package names
  • dart_test runfiles hold only the Dart VM; a test running SDK commands adds @rules_dart//dart
  • Compile, analyze, format, codegen and web actions take only the SDK files their tool reads
  • Removed dart_toolchain.sdk_root; dart_toolchain.sdk takes a dart_sdk_files, the SDK by use
  • Removed DartSdkInfo.sdk_root and DartSdkInfo.tool_files; read DartSdkInfo.files
  • dart_info() takes packages, each built by the new DartPackageInfo(...)
  • dart/pub:pub_library.bzl exports DartPackageMemberInfo for other rule sets' pub package kinds
  • dart/pub:pub_graph.bzl exports the dependency-cycle planning pub.from_lock() uses
  • Pub package repositories read pubspec.yaml with package:yaml and refuse what pub refuses
  • Added read_pubspec in //dart/pub:pubspec.bzl for other rule sets' repository rules
  • Removed parse_pubspec_deps and parse_pubspec_sdk_constraint; use read_pubspec
  • dart_analyze runs analysis and fixes in persistent workers, which keep an analysis server
  • Removed //dart:analysis_shutdown_workaround; //dart:analysis_worker=false runs dart analyze
  • dart_test recompiles only the edited library's modules after an edit inside a function body
  • --@rules_dart//dart:outline_kernel=false compiles dependents against full kernels
  • pub.from_lock() fetches git packages at their locked resolved-ref, refusing any other ref
  • fetch_pub_git fetches a locked git package for other rule sets' repository rules
  • dart_link_hook hooks see their package's generated sources and only its declared files
  • Rules calling dart_link_hook_actions declare COPY_TO_DIRECTORY_TOOLCHAINS
  • A root dart.toolchain pin is used exactly; a dependency requesting a newer SDK fails the build
  • dart.toolchain(allow_upgrade_by_dependencies = True) lets dependencies raise the root's SDK pin
  • executable_defines_config lets a rule add defines derived from its attributes to its modules
  • Removed module_defines_transition; use executable_defines_config
  • dart_entry_kernel_action takes no defines; it compiles in executable_defines(ctx)
  • Codegen and code assets below dart_tests with different defines are built once
  • Gazelle copies a test file's @Tags([...]) into its dart_test tags
  • Gazelle removes hand-written dart_test tags not marked # keep, logging each
  • dart_test takes include_tags/exclude_tags; DART_TEST_TAGS narrows one run
  • dart_test no longer reads dart_test.yaml; its settings go on the target
  • pub.from_lock(resolve = ...) serves a locked package from your own target, everywhere
  • pub.from_lock() fails on a path package not in its resolve, build_from_pubspec or ignored
  • dart_library in a directory under a package's lib/ builds as part of that package
  • A dart_library under lib/ that names no package is named for its package root, not lib
  • A target whose package root is ambiguous (a lib inside a lib/) fails, naming the fix
  • dart_codegen in or under lib/ finds its package root without a same-package dep
  • Gazelle resolves each imported file, relative imports included, to the rule listing it
  • Gazelle emits dart_binary and dart_test for bin/ and test/ of a package below the root
  • A pub package's language version is the lower bound of its environment.sdk, as pub computes it
  • Removed derive_language_version; read_pubspec returns language_version
  • dart_whole_program_kernel_action compiles a whole program for any DartKernelSdkInfo platform
  • DartKernelSdkInfo.runtimes (from dart_kernel_runtime) replaces platform and defines
  • dart_binary refuses --resolve-dwarf-paths, which gen_snapshot cannot apply to its kernels
  • The Gazelle plugin is @rules_dart_gazelle_plugin//dart, from module rules_dart_gazelle_plugin
  • Removed @rules_dart//gazelle/dart; rules_dart no longer depends on gazelle or rules_go
  • Removed Dart SDKs 3.11.x and 3.12.x; the oldest dart.toolchain version is 3.13.2
  • Removed pub.package(deps = ...); a package's dependencies come from its pubspec
  • pub.package() fails at fetch when its pubspec depends on a package nothing supplies
  • Gazelle generates dart_binary and dart_test in bin/ and test/ with no pubspec.yaml
  • Gazelle reads a package's name and version only from the pubspec.yaml at its root
  • Gazelle fails where dart_package_metadata, directives and pubspec.yaml disagree
  • A first-party hook/build.dart stated as build_hook fails the build unless code assets replace it
  • Removed dart_library.has_unreplaced_hook; state the hook as dart_package_metadata.build_hook
  • pub.package() packages with an unreplaced hook/build.dart fail; ignore_hook = True opts out
  • Gazelle no longer writes a dart_library for a package's hook/ directory
  • Gazelle writes a builder's build.yaml options into its codegen targets' config
  • Gazelle fails, naming each, on the parts of build.yaml it cannot carry into the build
  • Renamed DartKernelSdkInfo.runtime to aot_runtime
  • Moved dart/pub/pub_lock_hub.bzl to dart/pub/private/
  • Renamed DartPackageInfo.lib_root to package_root
  • Renamed derive_lib_root to derive_package_root
  • Renamed DartPackageInfo.has_unreplaced_hook to unreplaced_hook
  • Removed dart_format; bazel run @rules_dart//dart/format -- <patterns> formats as the check does
  • Removed dart_fix; bazel run @rules_dart//dart/fix -- <patterns> fixes any number of targets
  • Removed dart_binary compile_mode "jit-snapshot"; use "kernel", "aot-snapshot" or "exe"
  • Removed //dart/ext/tools:check_dual_build_collisions
  • pub.package() and pub.from_lock() build the highest version any module or lock asks for
  • A root request another module raises warns; pub.settings(check_direct_dependencies) sets that
  • Removed pub.from_lock.on_version_conflict; the highest version is always built
  • ignore_hooks and ignore_hook in a module other than the root fail the build
  • @rules_dart//dart/pub:pub_versions.bzl exports select_pub_version for other rule sets
  • A package the root's lock lists from git overrides another module's lock entry for it
  • Renamed dart_analyzable_info to dart_analyzable_info_no_package, srcs now entry_srcs
  • Renamed dart_analyzable_info_with_package to dart_analyzable_info; it takes packages
  • Renamed DartAnalyzableInfo.srcs to entry_srcs; removed package_srcs, use dart_info.srcs
  • dart_analyzable_info refuses an entry_srcs file under a package's lib/
  • Gazelle writes one dart_library per package, at its root, holding all of its lib/
  • Gazelle names an annotated source's targets for its path under lib/
  • Gazelle deletes the BUILD files it wrote under lib/ and fails on one holding more
  • Gazelle keeps in srcs a .g.dart or similar file that no codegen target produces
  • Removed json_serializable_library and the other *_library codegen macros
  • <builder>_codegen macros write a builder's codegen targets, for a dart_library's srcs
  • Gazelle puts annotated sources and what they generate in the package's one dart_library
  • Gazelle builds plain and annotated sources of a package that import each other
  • dart_package_metadata also states a package's version, license_file, hooks and code_assets
  • Removed the package facts from dart_library; name a dart_package_metadata with package
  • Removed package_name and language_version from the codegen rules
  • Removed package_name and language_version from dart_binary, dart_test and the web binaries
  • An executable naming a dart_package_metadata is in its package wherever its BUILD file is
  • Targets of one package that name different dart_package_metadata, or one none, fail the build
  • A package's build hook, license and code assets reach programs through any of its targets
  • Added package_info_from_metadata(), the package record of a target naming dart_package_metadata
  • A program's own package ships its code assets and runs its link hook, as a dependency's
  • Added program_packages(): a program's own package and those its deps reach
  • Gazelle writes a dart_package_metadata at each package root, named by every rule it writes
  • Gazelle states hooks and license_file (NOTICES, else LICENSE) on the metadata
  • Gazelle drops inline package facts from rules and moves a library's code_assets to the metadata
  • Gazelle rewrites the metadata's name and language version unless marked # keep
  • Removed go_router_library and Gazelle's @TypedGoRoute; a Flutter rule set ships that codegen
  • The codegen builder API moved from dart/ext/_shared:defs.bzl to @rules_dart//dart/ext:defs.bzl
  • The combining shim moved to @rules_dart//dart/ext/combining_shim:bin
  • Gazelle puts every directory below a pubspec.yaml in that package, tool/ and example/ included
  • Gazelle treats a dart_package_metadata with no pubspec as a package root
  • # gazelle:dart_package_name and dart_language_version no longer apply inside a nested package
  • Targets naming two dart_package_metadata for one package root fail where they meet
  • Gazelle names the dart_package_metadata it writes pubspec-metadata, and fails on two
  • A pub package's dart_package_metadata is //:pubspec-metadata in its repository
  • utils.bzl exports package_identity_attrs() and resolve_package_identity
  • resolve_package_identity takes a declaration from another target and returns its root
  • utils.bzl exports executable_package_record() for an executable in a declared package
  • library_package() builds a library's package record, as dart_library does, from its package
  • dart_analyze reads dependencies from analyzer summaries; off with dart:analysis_summaries=false
  • dart_analyzer_source and dart_analyzer_toolchain build a Dart SDK's summary analyzer
  • dart_info() takes the rule's ctx, and its rule merges in SUMMARY_ATTRS
  • dart_info(analysis_deps = ...) names libraries only the analyzer reads, such as sky_engine
  • dart_test runs a test in its package's root inside runfiles, as dart test does
  • Renamed dart_binary.code_assets_from_deps to code_assets_from_packages; no alias
  • MODULAR_KERNEL_ATTR and modular_kernel(ctx) in utils.bzl read //dart:modular_kernel
  • dart_entry_kernel_action requires MODULAR_KERNEL_ATTR and fails when it is off
  • .bzl files under dart/private and dart/pub/private can be loaded only from rules_dart
  • overhead-release.yaml releases only a commit CI passed on; callers grant actions: read
  • Renamed dart_code_asset.shared_library to file and dart_code_asset.system_uri to uri
  • Renamed DartCodeAssetInfo.dynamic_library to file and DartCodeAssetInfo.system_uri to uri
  • Removed dart_source_set; use bazel_lib's copy_to_directory with dart_library.srcs_dir
  • Renamed generator_bin to generator on dart_codegen and dart_aggregate_codegen
  • Renamed dart_sqlcodegen.generator_bin to generator
  • Removed .dart script generators and generator_script; use a dart_binary Builder shim
  • Removed dart_link_hook; use dart_program_assets, linked when it has recorded_uses
  • Removed dart_link_hook_actions; use dart_program_assets_actions
  • Removed link_hook_runner_attr; use program_assets_attrs and PROGRAM_ASSETS_TOOLCHAINS
  • Added DartProgramAssetsInfo: the assets a program ships, by id, and what each link hook emits
  • A link hook may emit whatever data assets of its package the program needs
  • dart_package_metadata.link_hook_assets promises data assets a hook always emits
  • Added program_asset_file(), one asset of a program by id, known at analysis time
  • dart_binary and dart_test load the libraries of their packages' linked_code_assets
  • Removed collect_transitive_code_assets; use program_kernel_code_assets
  • Removed resolve_code_assets and code_asset_identity; use program_kernel_code_assets
  • A dart_library, dart_test or dart_binary dep that none of its files imports fails the build
  • features = ["-dart_unused_deps"] turns the unused-dependency check off
  • A rule returns DartUsedWithoutImportInfo for a dep its dependents need not import
  • library_import_check and LIBRARY_IMPORT_CHECKER_ATTRS let a library rule check its own imports
  • import_check_output_groups takes generated, files the rule writes whose imports are uses
  • bazel run @rules_dart//dart/unused_deps removes deps that none of a target's files imports
  • Removed import_check_validation; use import_check_output_groups

Added #

  • dart_js_binary and dart_wasm_binary build deps for the platform in their platform
  • A library can select() per web compiler on @rules_dart//dart/constraints:js and :wasm
  • dart_analysis_test.web_platforms checks web-only code on each web platform
  • web_platform_config_settings configures an analysis test's target as a web binary does
  • Runfiles.environment gives the variables a child process needs to find the runfiles
  • pub_test_runner in @rules_dart//dart/pub:pub_library.bzl declares package:test with its runner
  • --@rules_dart//dart:track_creation_locations records creation locations in VM builds and tests
  • non_dart_transition builds a non-Dart target once across runtimes, defines and creation tracking
  • dart_binary passes define values containing commas through whole
  • dart_binary's kernel is compiled by frontend_server and is about 3.6% smaller
  • @rules_dart//dart/kernel_list reads, rewrites and joins kernel lists for test launchers
  • dart_test runs from a kernel list instead of storing its own copy of the program
  • --@rules_dart//dart:kernel_list=false restores joined test kernels
  • dart_link_kernel_action takes kernel_list and returns the files a list names
  • --@rules_dart//dart:runner_snapshot halves a short test's start-up with a cached runner snapshot
  • --test_env=RULES_DART_RUNNER_SNAPSHOT_DIR=<dir> puts the runner snapshot cache in <dir>
  • DartPackageInfo.license_file names a package's license file, read by package_license_file()
  • dart_package_info() takes a license_file
  • pub.from_lock() and pub.package() packages name their root NOTICES, else LICENSE
  • pub_lock_package.bzl exports is_relative_git_url for rule authors
  • bazel run @rules_dart//dart/pub -- get|upgrade runs pub from the pinned Dart SDK
  • pub.from_lock() errors give the @rules_dart//dart/pub command that re-resolves each lock
  • package:runfiles reads the MANIFEST in a runfiles directory found beside the executable
  • pub.from_lock(build_from_pubspec = [...]) builds a lock's path package from its directory
  • pub.from_lock(ignored = {...}) names path packages nothing may depend on, with the reason
  • fetch_pub_path in //dart/pub:pub_lock_package.bzl serves a path package to other rule sets
  • The outline stripper is built from the source of the Dart toolchain's own SDK version
  • dart_kernel_source builds a Dart release's outline stripper, for another platform's kernels
  • dart_outline_toolchain registers the outline stripper of a Dart SDK of your own
  • Codegen rules give generators a pubspec.yaml with the package's name, language version and deps
  • A codegen asset_deps pubspec whose name or language version differs from the target's fails
  • dart_kernel_source builds the outline stripper from a Dart SDK checkout given as path
  • fetch_dart_kernel_source serves a Dart checkout's pkg/kernel and outline stripper below a prefix
  • Gazelle puts a test helper from another test/ directory in the test's srcs
  • Drift's codegen config reaches its discover, analyzer and part stages
  • Gazelle writes drift_dev's build.yaml options into drift's codegen config
  • dart_compile_action is exported from @rules_dart//dart:utils.bzl
  • merged_package_record builds the record of a target that is itself a package
  • //dart:utils.bzl exports package_lib_prefix
  • pub.cycle() declares pub packages that depend on each other, which then build as one library
  • Pub packages in an undeclared cycle fail when built, giving the pub.cycle() to add
  • A root pub.cycle() that is not exactly a cycle at the fetched versions fails
  • pub.package() packages can be members of a pub.cycle(), as locked ones can
  • The dio and dio_web_adapter cycle is curated, so it needs no pub.cycle()
  • bazel coverage reports the line coverage of dart_test targets as LCOV
  • @rules_dart//dart:coverage_converter and test_coverage give test rules LCOV coverage
  • bazel coverage leaves out lines and files marked // coverage:ignore-*
  • Gazelle writes a test's @TestOn as target_compatible_with
  • builder_shim_library builds the codegen shim runner against a caller's pub hub
  • # gazelle:dart_builder registers a builder another module ships, from the root BUILD file
  • # gazelle:dart_build_yaml_ignore <path> has Gazelle build without one part of build.yaml
  • dart_data_asset and dart_package_metadata.data_assets declare a build hook's data assets
  • --test_env=DART_TEST_ORDERING_SEED=<seed> shuffles a dart_test's cases
  • dart_code_asset.shared_library takes a prebuilt .so, .dylib or .dll file
  • --@rules_dart//dart:split_debug_info puts dart_binary debug info in a debug_info group
  • dart_binary.dart_compile_flags refuses --save-debugging-info; use split_debug_info
  • utils.bzl exports SPLIT_DEBUG_INFO_ATTR and split_debug_info(ctx)
  • dart_library.data files reach the runfiles of every binary and test that depends on it
  • dart_info() takes data, carried as DartInfo.runfiles
  • utils.bzl exports collect_transitive_runfiles(ctx, deps)
  • Pub package repositories state a pkg:pub purl in package_metadata for SBOM tools
  • Dart SDK repositories state a pkg:generic/dart-sdk purl in package_metadata
  • //dart/ext/sqlite3 and //dart/ext/webcrypto state SQLite's and BoringSSL's package_metadata
  • pub_hosted_purl, pub_git_purl and pub_package_identity build a pub spoke's identity
  • Link hooks receive their packages' code assets; only those they keep, as declared, ship
  • Added vm_code_config() and dart_program_assets_actions(code_config): the target hooks see
  • Added dart_linked_code_asset and dart_package_metadata.linked_code_assets
  • A linked program's library for a linked_code_asset exports only the symbols its uses reach
  • Added program_assets_action_args(): a program's assets for an action, in a param file
  • program_assets_action_args(data, code) hands only the data, or the code by name
  • Added program_kernel_code_assets(): every code asset a program's kernel maps
  • Added @rules_dart//dart/program_assets, whose ProgramAssets.read reads what ships
  • dart_program_assets writes <name>.program_assets, which a test reads from runfiles
  • A link hook emitting names that differ only in case, or a file and its directory, fails
  • The pub extension reports every unpinned package and lock disagreement in one failure
  • dart_package_cycle builds workspace packages that import each other as one target
  • dart_package_member holds one package of a dart_package_cycle
  • The import check's missing-package error points at dart_package_cycle
  • # gazelle:dart_cycle declares packages that import each other, which Gazelle builds as one
  • Gazelle fails on packages that import each other with no dart_cycle, naming the directive
  • pub.from_lock() names the fix for a cycle between a resolve package and pub packages
  • Codegen rules take the dart_package_members of a cycle in deps and read their sources
  • dart_package_cycle.srcs holds what generators write for the members' sources
  • Gazelle writes the codegen targets of packages a dart_cycle directive declares

Changed #

  • The dart_analyze format check no longer re-runs when only a target's dependencies change
  • Analysis, dart_binary and dart_test re-analyze faster in workspaces with many packages
  • dart_test no longer recompiles its entrypoint when only libraries it does not import change
  • The Dart SDK is downloaded and extracted once per machine, not once per output base
  • A body edit in a library no longer reruns the import check of every library above it
  • DartInfo has transitive_src_dirs, the directories among transitive_srcs
  • The code generators' pub packages are on their latest versions (analyzer 14.7.0)
  • Without a runfiles tree, dart_test no longer copies its own program and kernels
  • Without a runfiles tree, a dart_test finds other repositories' runfiles beside its own
  • pub extension results are no longer written to MODULE.bazel.lock
  • dart_test without a runfiles tree (Windows) lays out only its own data, sources and resources

Fixed #

  • dart_compile_flags accepts a -D, --define or --enable-experiment value as a separate item
  • --verbosity in dart_compile_flags filters front-end messages too
  • COPY_TO_DIRECTORY_TOOLCHAINS works in modules that do not depend on bazel_lib
  • A dart_test started from another target's data runs its own test
  • @hub//:<name> resolves for a locked package that is also declared with pub.package()
  • A fetched pub package depending on a package nothing in the build supplies fails, naming both
  • bazel query @rules_dart//... works from a module that depends on rules_dart
  • dart_test and dart_binary build when the target name has a /, such as sub/x_test
  • dart_codegen output for bin/ and test/ sources imports them by relative path
  • dart_codegen fails when a generator writes its temporary staging path into the output
  • dart_test module compiles in a persistent worker read only their declared inputs
  • Gazelle writes the deps of a dart_binary or dart_test named for its own package
  • Gazelle no longer gives a dart_library a pub dep on the package it provides
  • Codegen actions fail with an error when the analyzer or a builder resource cannot be released
  • pub.from_lock() fails on a lock with a duplicate package or key, or a second YAML document
  • Pub packages are extracted with a hermetic bsdtar from tar.bzl, never the host tar
  • A pub archive with an absolute or .. entry name is refused, as pub refuses it
  • dart_binary no longer runs pub get on the workspace's pubspec in unsandboxed builds
  • Codegen for a package that states no language version runs at the SDK's version, not 3.0
  • Codegen warnings show for every action a persistent worker runs, not only its first
  • Gazelle adds json_serializable for a freezed class with a fromJson factory
  • Gazelle's multi-builder codegen chains build: each stage gets its source's deps and parts
  • Gazelle sets a macro's annotation_dep when its runtime package is not in @pub_deps
  • Codegen macros accept deps that already list their annotation_dep
  • Gazelle puts a test/ helper in the srcs of each test importing it, not a dart_test
  • Gazelle deletes the dart_test an earlier version made of a test helper
  • Gazelle ignores import and export lines inside string literals and comments
  • Gazelle writes codegen for an annotated source with no BUILD file above it
  • pub.package() without a sha256 names the pub.dev API URL whose archive_sha256 gives it
  • dart_analyze workers on Windows stop their analysis server when the worker is killed
  • Gazelle writes a dart_binary for each file with a main in tool/, example/ and the like
  • A dart_builder_runtime_dep override replaces the builder's default runtime library in deps
  • --@rules_dart//dart:extra_dart_defines no longer reaches build tools in the exec configuration
  • Flipping a test or analysis flag of @rules_dart//dart no longer rebuilds build tools
  • dart_library module compiles no longer hang after one of their modules fails to compile
  • dart_analyze and dart_fix reserve more memory for large programs analyzed from source
  • A web binary's platform error names :vm for a platform that carries no web compiler
  • dart_js_binary produces the <name>.js.map its script points at
  • dart_wasm_binary's source map names sources relative to itself, not by sandbox path
  • The highest of several requests for a package now counts +build metadata, as pub does
  • pub.from_lock() refuses a malformed lock instead of skipping its packages
  • The import check accepts import '' as self;, as ffigen writes it
  • The import check refuses an import with a query or fragment, which loads a second copy
  • dart_test and kernel/aot-snapshot dart_binary no longer read the workspace's .dart_tool
  • utils.bzl exports EMPTY_PACKAGE_CONFIG_ATTR and empty_package_config(ctx)
  • Codegen fails on a source with syntax errors, naming them, unless the builder allows them
  • Releases attach API docs for the public .bzl files
  • Depends on rules_cc 0.2.28
  • The module's package_metadata states its Apache-2.0 license
  • dart_test without a runfiles tree (Windows) lays out runfiles that are symlinks

Full Changelog: https://github.com/aran/rules_dart/compare/v0.8.1...v0.9.0

0
likes
0
points
5.11k
downloads

Publisher

unverified uploader

Weekly Downloads

Bazel runfiles library for Dart. Locates data files at runtime.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on runfiles