opensource.google.com

Menu

Docs

MOE Support

In general, //third_party holds libraries for Google-internal use by google3 projects. But some google3 projects define in blaze an open source subset of their code, via a tool like go/javamoe or an export script. These projects/teams would like to “blaze {build,test}” their open source export from CL to CL, to ensure that their changes don’t break a to-be-public ant or maven or make (or whatever…) build. Such build and test targets also have third-party dependencies (most likely the same ones as their google3-internal code), but it’s not appropriate for them to link in the same //third_party libraries as their internal code.

Why not?:

  • Libraries in //third_party used by internal Google code may contain Google-specific modifications. Open source builds shouldn’t depend on those modifications, and certainly shouldn’t package them.
  • Libraries in //third_party are packaged as blaze *_library targets. Open source builds shouldn’t package outputs of blaze’s particular logic.

So we’ve set up a special location for third-party dependencies of open source builds: //third_party/moe_support/DO_NOT_USE/libraries. The name is an intentional deterrent: libraries here have restricted visibility and are not intended for use by Google-internal projects.

Adding a library to //piper/third_party/moe_support/DO_NOT_USE/libraries

If your MOE/open source build requires a library that’s not already there, feel free to add it:

  • Follow the example of existing packages there. It’s like any other third_party check-in: BUILD, LICENSE, METADATA, OWNERS, and the library itself.
  • Define your library as a filegroup in BUILD, not a *_library. These are plain files for use by your build script, i.e. they are not to be passed through blaze’s manipulations.
  • Check in only a pristine, unmodified version of the library.
  • Restrict the visibility of the package to an “opensource_users” package group.
  • Put only one version of your library! Like third_party proper, we want to avoid a jumble of multiple versions. Updating a library to a new version requires a coordinated transition of all of google3’s open source builds, as with libraries in third_party proper.

Send the CL adding your library to an owner in //piper/third_party/moe_support/OWNERS, and CC emailremoved@. A regular third-party reviewer will also be automatically assigned.

Except as otherwise noted, the content of this page is licensed under CC-BY-4.0 license. Third-party product names and logos may be the trademarks of their respective owners.