Skip to content

Conversation

@aignas
Copy link

@aignas aignas commented Mar 29, 2024

The newly added host package in platforms cannot be used
in libraries that need doc generation for them. This changes
the srcs target to include the sources generated by the
extension and this makes everything work again as seen in
bazel-contrib/rules_python#1827.

With this fix I think we should be able to build stardoc
@Wyverald
Copy link
Member

@tetromino do you have any recommendations for such scenarios (before we move bzl_library into bazel_tools, anyhow)? Should we expose the .bzl files in a filegroup (in this case even including a generated .bzl file from another repo), or I guess let the users create filegroups themselves?

@tetromino
Copy link

IMHO the right solution would be to define a bzl_library target (let's say @host_platform//:constraints_lib) with the new constraints.bzl file in srcs.

And if any other .bzl file in platforms is loading @host_platform//:constraints.bzl, then that file's corresponding bzl_library target needs to depend on @host_platform//:constraints_lib

@Wyverald
Copy link
Member

That's the ideal solution, but we didn't want to use bzl_library before it's moved out of bazel_skylib.

@Wyverald
Copy link
Member

Wyverald commented Apr 1, 2024

Chatted to @tetromino offline; using a filegroup for now is the the only choice we have, really.

@aignas could you create a separate filegroup target called bzl_srcs that only includes these .bzl files, and use that instead?

@aignas
Copy link
Author

aignas commented Apr 5, 2024

I decided to not use this in rules_python yet, so this has dropped in my priority queue. If somebody is blocked by this, feel free to create a new PR and close this one.

@Wyverald
Copy link
Member

With skylib 1.6.0, bzl_library can now depend on filegroup targets. I've sent #90 to add the appropriate filegroup targets for the new .bzl files, which should unblock downstream users of Stardoc.

When bzl_library gets moved to bazel_tools, these targets can simply be converted into bzl_library targets backwards-compatibly.

@Wyverald Wyverald closed this in #90 Apr 25, 2024
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.

3 participants