This is an archive of the discontinued LLVM Phabricator instance.

Add a Bazel build file for mlir/python.
ClosedPublic

Authored by phawkins on Oct 29 2021, 1:16 PM.

Details

Summary

This BUILD file:

  • generates machine-generated Python files using tblgen, and
  • exports both generated and handwritten Python files via filegroup() rules.

This allows downstream users to use Bazel to build Python wheels that incorporate the MLIR Python bindings.

Diff Detail

Event Timeline

phawkins created this revision.Oct 29 2021, 1:16 PM
phawkins requested review of this revision.Oct 29 2021, 1:16 PM
GMNGeoffrey accepted this revision.Oct 29 2021, 2:02 PM

The state Bazel Python is weird... but this seems better than nothing :-)

utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel
2

Please add the license header (you can copy from other BUILD files)

This revision is now accepted and ready to land.Oct 29 2021, 2:02 PM
phawkins updated this revision to Diff 383499.Oct 29 2021, 2:22 PM

Added license header.

To fix a buildkite failure, added a minimal build file for mlir/test/python as well that exports a .td file used by the mlir/python build file.

GMNGeoffrey added a subscriber: stellaraccident.EditedOct 29 2021, 2:31 PM

To fix a buildkite failure, added a minimal build file for mlir/test/python as well that exports a .td file used by the mlir/python build file.

Oh I think @stellaraccident was disentangling that. Stella did you get it to a place you're happy with or were you planning to do more work? I don't really think that anything in mlir/python should depend on mlir/test/python

Edit clarification: I mean in general. This patch is fine

This revision was automatically updated to reflect the committed changes.