Skip to content

[mlgo] bazel rules for mlgo-utils #79217

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

Merged
merged 1 commit into from
Jan 24, 2024
Merged

[mlgo] bazel rules for mlgo-utils #79217

merged 1 commit into from
Jan 24, 2024

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Jan 23, 2024

Akin the py_binary rules for lit, these are scoped to binaries, rather than exposing the library - binary split. The latter is available to the package (pip package) users.

Tested:

cd utils/bazel
bazel build @llvm-project//llvm:extract_ir
bazel-bin/external/llvm-project/llvm/extract_ir --help

...and observed expected output (rather than import not found errors)

(Same for the other 2 targets).

Akin the `py_binary` rules for `lit`, these are scoped to binaries,
rather than exposing the library - binary split. The latter is available
to the package (pip package) users.
Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming the point of this PR is to just expose the binaries so they can be used with Bazel and there isn't a (current) need to expose any of the libraries as Python libraries?

@mtrofin
Copy link
Member Author

mtrofin commented Jan 23, 2024

I'm assuming the point of this PR is to just expose the binaries so they can be used with Bazel and there isn't a (current) need to expose any of the libraries as Python libraries?

correct.

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If we ever need to support use as a library in the future, it should be easy to refactor. Not sure py_library is a good fit right now just for this use case, not really familiar with the canonical way to do things in bazel however.

@GMNGeoffrey GMNGeoffrey requested a review from aeubanks January 24, 2024 03:26
@GMNGeoffrey
Copy link
Member

I no longer work with LLVM (or on compilers, or at Google, or with Bazel), so am not the right reviewer for this. Added @aeubanks

@mtrofin mtrofin merged commit 123c83d into llvm:main Jan 24, 2024
@mtrofin mtrofin deleted the bazel branch January 24, 2024 19:04
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.

4 participants