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

legacy dependency macro fails to set up transitive dependencies #1286

Open
oliverlee opened this issue Sep 11, 2024 · 3 comments
Open

legacy dependency macro fails to set up transitive dependencies #1286

oliverlee opened this issue Sep 11, 2024 · 3 comments

Comments

@oliverlee
Copy link

ERROR: Skipping '@symengine': error loading package '@@symengine//': at /private/var/tmp/_bazel_oliver/e888b1acfe919fa909be3f7123974edb/external/rules_foreign_cc/foreign_cc/defs.bzl:3:6: at /private/var/tmp/_bazel_oliver/e888b1acfe919fa909be3f7123974edb/external/rules_foreign_cc/foreign_cc/boost_build.bzl:5:5: at /private/var/tmp/_bazel_oliver/e888b1acfe919fa909be3f7123974edb/external/rules_foreign_cc/foreign_cc/private/framework.bzl:5:6: at /private/var/tmp/_bazel_oliver/e888b1acfe919fa909be3f7123974edb/external/bazel_features/features.bzl:3:6: Unable to find package for @@bazel_features_globals//:globals.bzl: The repository '@@bazel_features_globals' could not be resolved: Repository '@@bazel_features_globals' is not defined.

bazel_features is pulled in here:
https://github.com/bazelbuild/rules_foreign_cc/blob/b25485b26d6ddf6be8bde2bc0c651b1a06ebe54c/foreign_cc/repositories.bzl#L86-L92

But I don't see (a second macro for) bazel_features_deps:
https://github.com/bazel-contrib/bazel_features/blob/main/deps.bzl
which in turn sets up these:
https://github.com/bazel-contrib/bazel_features/blob/main/private/repos.bzl

@aaron-michaux
Copy link
Contributor

The code below is a workaround; however, @oliverlee , do you think rules_foreign_cc_dependencies() itself should be calling bazel_feature_deps()?

load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

rules_foreign_cc_dependencies()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

@jsharpe
Copy link
Member

jsharpe commented Sep 12, 2024

rules_foreign_cc_dependencies() can't do it as it defines the repository; we'd have to add an additional workspace macro to do that setup.
I think the best we can do is update the documentation to include the bazel_features setup as I don't think we need to be introducing a new workspace macro at this point given the future is bzlmod.

@oliverlee
Copy link
Author

I think either two macros or a note in the README is fine.

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

No branches or pull requests

3 participants