This is an archive of the discontinued LLVM Phabricator instance.

[Bazel] Provide filegroups for `@rules_pkg`
Needs ReviewPublic

Authored by chapuni on Jan 14 2023, 4:01 AM.

Details

Reviewers
GMNGeoffrey
MaskRay
rupprecht
Group Reviewers
Restricted Project
Summary

For now, I have created four filegroups.
They are sufficient for the Clang toolchain.

  • @llvm-project//clang:pkg-clang
  • @llvm-project//clang:pkg-clang-resources
  • @llvm-project//lld:pkg-lld
  • @llvm-project//llvm:pkg-llvm-ar

They are available for pkg_tar etc.

Diff Detail

Event Timeline

chapuni created this revision.Jan 14 2023, 4:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2023, 4:01 AM
chapuni requested review of this revision.Jan 14 2023, 4:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2023, 4:01 AM

This looks reasonable, but I'm not familiar with @rules_pkg. Could you add more explanation to the patch description about the goals of this change?

@GMNGeoffrey Thanks for the comment.

I could add actual tar rules as an example to use files, in utils/bazel/BUILD.bazel or other directory like //pkg outside @llvm-project.
I didn't do since I was afraid if they were less useful to everyone.
Do you think the commit log would satisfy an explanation of this? (I think so since I often use git-blame)

FYI, pkg_files can be used for bootstrapping clang if also toolchain files are supplied.

I would like to ask you. Is the location of pkg_files reasonable? I tried locating them to other places in @llvm-project,

  • //: (BUILD.bazel) -- It requires modifying the repository rule for llvm-raw
  • //pkg: or //{clang|lld|llvm}: -- Seems the overlay script doesn't accept new directories defined in llvm-project-mirror.

Since I suppose pkg_files rules would not affect wildcard target specifications from command line,
I have taken an option to locate pkg_files into existing BUILD.bazel.
Other options?

MaskRay added a reviewer: Restricted Project.Aug 30 2023, 11:17 PM