Skip to content

Conversation

@rdesgroppes
Copy link
Contributor

@rdesgroppes rdesgroppes commented Jan 19, 2026

When no explicit strip_prefix is specified, pkg_files now automatically preserves package-relative paths in two cases:

  1. cross-workspace references: when an external workspace references files from the main workspace (e.g. @external_repo//pkg:rule using @//tests:my_file),
  2. direct cross-package target references: when a target from a different package is directly referenced (i.e. not via a local filegroup) within the same workspace.
    The key is that the target being referenced must be from a different package, ensuring local filegroups that aggregate files from other packages continue to use basename-only paths.

This eliminates the need for explicit strip_prefix configurations in these pretty common cross-workspace and cross-package scenarios.

@rdesgroppes rdesgroppes force-pushed the make-pkg_files-auto-strip-prefix branch 6 times, most recently from 488745b to ce924b0 Compare January 19, 2026 11:37
When no explicit `strip_prefix` is specified, `pkg_files` now
automatically preserves package-relative paths in two cases:
1. cross-workspace references: when an external workspace references
   files from the main workspace (e.g. `@external_repo//pkg:rule` using
   `@//tests:my_file`),
2. direct cross-package target references: when a target from a
   different package is directly referenced (i.e. not via a local
   `filegroup`) within the same workspace.
   The key is that the target being referenced must be from a
   different package, ensuring local `filegroup`s that aggregate files
   from other packages continue to use `basename`-only paths.

This eliminates the need for explicit `strip_prefix` configurations in
these pretty common cross-workspace and cross-package scenarios.
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 this pull request may close these issues.

1 participant