tree: f7dce68bff0b0f1c0ab4e4e9ad667be72e0f2e8f [path history] [tgz]
  1. 7z/
  2. amd_rx_5500_xt_drivers/
  3. apr/
  4. apr-util/
  5. attr/
  6. autoconf/
  7. automake/
  8. bazel_bootstrap/
  9. bc/
  10. binutils/
  11. buf/
  12. buildifier/
  13. bzip2/
  14. cloud-tasks-emulator/
  15. cmake/
  16. cmake_bootstrap/
  17. codeql/
  18. cpython/
  19. cpython3/
  20. cpython310/
  21. cpython38/
  22. cpython_common/
  23. curl/
  24. devil/
  25. ed/
  26. esbuild/
  27. firebase-tools/
  28. flex/
  29. gae_go_sdk/
  30. gcloud/
  31. gettext/
  32. git/
  33. go/
  34. go121/
  35. gofmt/
  36. golangci-lint/
  37. govc/
  38. govet/
  39. gperf/
  40. gsutil/
  41. help2man/
  42. hiba/
  43. httpd/
  44. httpd-php/
  45. intel_arc_and_xe_drivers/
  46. intel_gen_6_to_12_drivers/
  47. intel_gen_7_to_10_drivers/
  48. ipxe-efi/
  49. kythe/
  50. lessmsi/
  51. libcap-ng/
  52. libexpat/
  53. libffi/
  54. libidn2/
  55. libnl/
  56. libtool/
  57. libuuid/
  58. libzstd/
  59. lldpd/
  60. mesa_drivers/
  61. mingw/
  62. mpich/
  63. mysqlclient/
  64. nasm/
  65. ncurses/
  66. ncursesw/
  67. ninja/
  68. nodejs/
  69. nodejs18/
  70. nodejs20/
  71. nsjail/
  72. nsl/
  73. nvidia_gtx_1660_drivers/
  74. openblas/
  75. openocd/
  76. opensshlibs/
  77. openssl/
  78. parted/
  79. pcre/
  80. pcre2/
  81. perl/
  82. pip_bootstrap/
  83. pixman/
  84. powershell/
  85. protobuf-cpp/
  86. protobuf-cpp-21/
  87. protoc/
  88. protoc-gen-go/
  89. protoc-gen-go-grpc/
  90. puppet-agent/
  91. qemu/
  92. re2/
  93. re2c/
  94. readline/
  95. renode/
  96. rr/
  97. rsync/
  98. sed/
  99. shfmt/
  100. sqlite/
  101. squashfs/
  102. swift-format/
  103. swig/
  104. texinfo/
  105. tflint/
  106. txtpbfmt/
  107. valgrind/
  108. virtualenv/
  109. vmwaretools/
  110. wasmtime/
  111. wazero/
  112. wimboot/
  113. win32-openssh/
  114. win_adk/
  115. win_adk_winpe/
  116. xzutils/
  117. yajl/
  118. zephyr_sdk/
  119. zlib/
  120. .vpython3
  121. cross_util.sh
  122. OWNERS
  123. README.md
  124. run_locally.sh
  125. run_remotely.sh
  126. run_remotely_extract_repo_ref.py
  127. run_remotely_slurp_cl.py
3pp/README.md

3pp package definitions

This is a collection of “third-party package” definitions.

See the support_3pp recipe module docs for the format of package definitions.

Writing and testing new package definitions

To go along with the support_3pp documentation above, this section will give some higher-level advice on writing package definitions.

Package requirements

3pp packages are designed to be hermetic, meaning that they should typically not depend on any other 3pp package at runtime. This means that any library dependencies other than the core system libraries (more on this below) should be statically linked. This may require giving appropriate options to a configure script, or in some more extreme cases, patching the build system.

3pp packages are also designed to be relocatable, meaning that they can be deployed to any location on disk. Be aware if the package hardcodes any paths into the compiled code or into configuration files; if so, you may need to patch it to avoid this.

System libraries

Packages may depend on system libraries. Currently, we target the following:

  • Linux: manylinux2014 for linux-amd64. For other Linux targets, we follow dockcross latest.
  • macOS: Version 10.11 (mac-amd64), Version 11.0 (mac-arm64)
  • Windows: Windows 7

Naming conventions

For infra 3pp, we use the static_libs prefix for static libraries, and the tools prefix for executables. build_support is used infrequently; this is for packages which are for consumption only by the 3pp build system itself.

Versioning

Package version tags in CIPD are immutable. Therefore, in order to trigger a new build of a package, the version number must change. If the upstream (source) version of a package is staying the same, but you are making a change to the build script/environment or applying patches, add (or increment) the patch_version field in the spec to give it a new version string.

Platforms

3pp supports multiple architectures of Windows, Mac, and Linux. It is generally best to use platform_re to only build packages on platforms where they are actually needed. This reduces the amount of time spent debugging failures, both now and later.

Testing

Try jobs

The preferred way to test package definitions is to upload your CL to Gerrit and do a CQ dry run. This will trigger the 3pp try builders which run on all platforms. The try jobs do not upload the built packages anywhere, but you can inspect the build status to see which files would be packaged, and any error messages.

Building stuff locally

See ./run_locally.sh. You can pass help as the first argument for the lowdown.

For Linux, run_locally.sh requires docker to be installed. For googlers, please refer to go/docker.

Building the package locally will allow you to actually inspect the package output, if needed, as well as upload it to the experimental/ prefix in CIPD.

run_remotely

./run_remotely.sh is another option which works similar to the try jobs, but gives you more control over the Swarming task definition. You may want to use run_remotely if you want to tweak recipe code or properties.

CIPD Sources

If possible, prefer to use git, url, or script methods. If none of these are workable for a package, cipd source may be used.

Some third-party packages distribute their releases via source tarballs or zips. Sometimes this is done via http or ftp.

To ingest a new tarball/zip:

  • Download the official tarball release from the software site.

    • pick one that is compressed with gzip, bzip2, xz, zstd, or is a zip file.
    • If there's no such tarball, consider expanding compression support in the recipe_engine/archive module.
  • Put the tarball in an empty directory by itself (don‘t unpack it). The name of the archive doesn’t matter. Your directory should now look like:

    some/dir/ pkgname-1.2.3.tar.gz

  • Now run:

    $ PKG_NAME=pkgname $ VERSION=1.2.3 $ cipd create
    -in some/dir
    -name infra/third_party/source/$PKG_NAME
    -tag version:$VERSION

  • You can now use the source in a 3pp package definition like:

    source { cipd { pkg: “infra/third_party/source/pkgname” default_version: “1.2.3” original_download_url: “https://original.source.url.example.com” } # Lets 3pp recipe know to expect a single tarball/zip unpack_archive: true }

  • By default the 3pp recipe also expects unpacked archives to unpack their actual contents (files) to a subdirectory (in the Unix world this is typical for tarballs to have all files under a folder named the same thing as the tarball itself). The 3pp recipe will remove these ‘single directories’ and move all contents to the top level directory. To avoid this behavior, see the no_archive_prune option.