Skip to content
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

Break targets that define srcs as glob or filegroup into single-file targets #198

Open
angeloprobst opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
Future Work Required Used to mark tickets closed with `TODO` or `FIXME` in the merged code.
Milestone

Comments

@angeloprobst
Copy link
Collaborator

angeloprobst commented Jan 23, 2025

There are some cases like this:

filegroup(
    name = "py_files",
    srcs = glob(["*.py"]),
)

py_library(
    name = "hyperon_das",
    srcs = [":py_files"],
    deps = [...]
)

Where a single target globs all source files.

This does not help bazel to make the best decision about doing or not a re-build or a re-test of cached targets. Usually, this leads bazel to do more re-builds and re-tests than necessary.

Ideally, each source code file should have its own target and be listed in the deps parameter of who depends on it.

NOTE: same can be found in the CPP code, not only in Python targets.

@angeloprobst angeloprobst added the Future Work Required Used to mark tickets closed with `TODO` or `FIXME` in the merged code. label Jan 23, 2025
@angeloprobst angeloprobst added this to the Query Engine milestone Jan 23, 2025
@angeloprobst angeloprobst self-assigned this Jan 23, 2025
@angeloprobst angeloprobst changed the title Break targets that define srcs as glob or filegroup into single-file libraries Break targets that define srcs as glob or filegroup into single-file targets Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future Work Required Used to mark tickets closed with `TODO` or `FIXME` in the merged code.
Projects
None yet
Development

No branches or pull requests

1 participant