Skip to main content

gn-dist

Binary distributions of GN (generate-ninja) for Linux (glibc and musl).

Other systems are out of scope for this project. For Windows and macOS builds, please refer to Google CIPD.

Installation

python3 -m pip install gn-dist

# convenience wrapper script
GN_WRAPPER=$(which gn)
$GN_WRAPPER --version

# actual binary
GN_EXE=$(python3 -c "from gn_dist import GN; print(str(GN))")
$GN_EXE --version

# to add the actual binary to PATH, you can do e.g.:
GN_DIR="$(dirname $GN_EXE)"  # or use GN.parent above
export PATH="$GN_DIR:$PATH"
# ^ add this to your ~/.bashrc if you want

Building

./build_gn.py automates the build process (run with --help for options, as usual).

gn-dist's setup implies building GN. Run e.g. pip install -v . or pyproject-build -wxn.
Set $BUILD_PARAMS to pass options to build_gn.py through the setup layer.

Versioning

gn-dist (and GN itself) use git to infer version info.

This is known to cause issues with shallow checkouts. We recommend that you configure your clone of gn-dist in a way that allows git describe to do its job.

Where that is not possible (e.g. when installing from a tarball that does not contain the git repository) a src/gn_dist/VERSION file must be provided.
This is just a plain text file containing the version string that will be passed to gn-dist's PEP 517 build backend. The version should be provided as a PEP 440 / PyPA specs compatible normalization of what would otherwise be returned by git describe.
The VERSION file is included in sdists and will be auto-generated where possible.

GN checkout is typically managed by gn-dist itself (which does a full clone), but if you insist on bringing your own copy of GN, you may need to provide a //out/last_commit_position.h file (relative to //sbuild/gn), in the following format:

#ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_

#define LAST_COMMIT_POSITION_NUM %(num)s
#define LAST_COMMIT_POSITION "%(num)s (%(commit_id)s)"

#endif  // OUT_LAST_COMMIT_POSITION_H_

where %(num)s is the commit number (counted from the initial commit), and %(commit_id)s the commit hash (truncated to the first 12 digits), as in

git describe HEAD --abbrev=12 --match initial-commit

Then edit build_gn.py to pass --no-last-commit-position to GN's build/gen.py.

Containerization

To manually build gn-dist in a manylinux2014 container, you can do e.g.:

docker run -v "${PWD}:/projects/gn-dist" --security-opt label=disable -it quay.io/pypa/manylinux2014_x86_64 bash
# this would test python 3.6 compatibility - to use a contemporary version of python, comment in the lines below instead
yum install -y python3
#manylinux-interpreters ensure cp314-cp314
#export PATH="/opt/python/cp314-cp314/bin:${PATH}"
manylinux-install-clang -v latest
python3 -m venv /projects/.venv
export PATH="$/projects/.venv/bin:${PATH}"
python3 -m pip install -U pip
python3 -m pip install -U setuptools wheel build auditwheel
python3 -m pip install -U ninja  # scikit-build/ninja-python-distributions
cd /projects/gn-dist
./build_gn.py --help  # informational
BUILD_PARAMS="-c clang --clang-path /opt/clang" python3 -m build -wxn
#auditwheel repair dist/gn_dist-*.whl

Updating (for maintainers)

To make a new release, first update the GN_REV in build_gn.py and rebuild locally.
Commit and push the changes. Then run src/gn_dist/gn --version to determine the version, and create a matching tag (add a minor cipher if it's a rebuild):

git tag -a VERSION -m "Release"

Once you're positive, push the tag. For maintainer convenience, pushing a tag that points to the HEAD of main will automatically trigger the build workflow with publish options enabled.

Once a release has been successfully published to GitHub, tag protection from immutable releases will lock the tag in place. However, if anything goes wrong before that, you may just revoke the tag as usual:

git tag -d VERSION
git push --delete origin VERSION

Then you can fix things up and eventually re-create the tag on another commit.

History

See below for some background why gn-dist was created:

Related work

If you are looking for PyPI builds of ninja, scikit-build/ninja-python-distributions is somewhat equivalent to this project. Note though, it uses Kitware's fork of ninja, not the original version.

There is also loong64/gn, but for some reason refers to a little-known fork of GN, is not regularly updated, does not include musllinux builds, and is not Python packaged.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gn_dist-2407.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gn_dist-2407.2-py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

gn_dist-2407.2-py3-none-musllinux_1_2_s390x.whl (2.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ s390x

gn_dist-2407.2-py3-none-musllinux_1_2_riscv64.whl (2.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ riscv64

gn_dist-2407.2-py3-none-musllinux_1_2_ppc64le.whl (2.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ppc64le

gn_dist-2407.2-py3-none-musllinux_1_2_i686.whl (3.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

gn_dist-2407.2-py3-none-musllinux_1_2_armv7l.whl (2.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

gn_dist-2407.2-py3-none-musllinux_1_2_aarch64.whl (2.5 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

gn_dist-2407.2-py3-none-manylinux_2_39_riscv64.whl (990.2 kB view details)

Uploaded Python 3manylinux: glibc 2.39+ riscv64

gn_dist-2407.2-py3-none-manylinux_2_35_armv7l.whl (1.1 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARMv7l

gn_dist-2407.2-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

gn_dist-2407.2-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl (1.1 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ s390xmanylinux: glibc 2.28+ s390x

gn_dist-2407.2-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl (1.2 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ ppc64lemanylinux: glibc 2.28+ ppc64le

gn_dist-2407.2-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file gn_dist-2407.2.tar.gz.

File metadata

  • Download URL: gn_dist-2407.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gn_dist-2407.2.tar.gz
Algorithm Hash digest
SHA256 0392b26d1e259105319042bb8b5682b010600df2312208a951d3acc9a7237dd6
MD5 0a1a0dadbde74b1dc3f52751c98f7057
BLAKE2b-256 65c82e5f375aee24651845b53553cb2a13bf5a80e192bdb395e2bcd01662b2bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2.tar.gz:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c74c0ff2ea84bda870136cadae414735cab0ae4c738ea6764b2cd18eca907353
MD5 49cd154325675233108e8626516d38b5
BLAKE2b-256 64ed98d6100c27f7225449ef78092a3624236c2c0422c0fc51561d9279748a92

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_x86_64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_s390x.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 47f734def9e41610835077ff461392120f41d5fdd0b668123131644addc676a9
MD5 6796da183af23bef4e73c4f74dc05d99
BLAKE2b-256 f5043884e4e0bfb359d0d4a046b83a67905c48ab62e731493c711f548c533382

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_s390x.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_riscv64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_riscv64.whl
Algorithm Hash digest
SHA256 3a31d46485a46f6ecf48322b0715cce323cbb59028051444fb3a3a6df0f6d2a7
MD5 e3c956175c7595a831008830a7575143
BLAKE2b-256 194ea29dfa1bd75ea258c3b675bf026e209ebb75170b8be7bd1c47837e48d208

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_riscv64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 e808fa3e3c251158874e89cedbf104fbe7ddbb5104159daa51dd52ba31cd159f
MD5 9f47708e889c719f8272681fe2eb37cb
BLAKE2b-256 a1f8caaa2e44f7df9f199c4986ca58cbe99605ad69a4dc01b3979e5973d60d2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_ppc64le.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7187abc9660013012dca75444f98c9e2a85d2fd442775771c399ea8779b5b522
MD5 344ec35f83e9a6db17c1ef5e86326289
BLAKE2b-256 ca695bd915d3b533b485a6617c20ec336450ff18968d9e6211dea83fbad8b28c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_i686.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 659a72fde5460eae0354cdf5197cc4a68751eeb57ba67409ab77865bb342fd53
MD5 45701d474e98fadc49aef3cb0e0425ea
BLAKE2b-256 199fcfc698d33229428dafe644f3e318c4ab597c7b4a261a99092f841a1a4947

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_armv7l.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 30f0c7e42faae7c0737a3fe22741df3c696764b8802e44d558a7299b0db4d055
MD5 878a746137cbbb55a655658f3cc6a7d4
BLAKE2b-256 dcf6e30efe8a9af4ac044f4d68892de55954f98d7fcaf636e610fc2ff207e24a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-musllinux_1_2_aarch64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_39_riscv64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_39_riscv64.whl
Algorithm Hash digest
SHA256 06bd4782f6411b7962a70c2b212e129789e0f784c43f2558689bb7cde119961d
MD5 38fefb6183d8ed2a848b84c5e7307500
BLAKE2b-256 77cd5ed2000b890acbe3aca3034eaeb58a321a83df19a7e681dbe2b83b095798

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_39_riscv64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_35_armv7l.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_35_armv7l.whl
Algorithm Hash digest
SHA256 23506454dcbadc8701b7d3b49094d73aa34138f81028472b47b2700181a41d6d
MD5 b25ad11e5246643bab0a392066eeadf4
BLAKE2b-256 b8c5f8457f0fed5830672c96c4d526c963da96862e632abed48ecf325b58f972

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_35_armv7l.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 48a28071089c05eb52720369646cfbf13d647ee72d348208ebaf54b9cc1446ce
MD5 a836019f1301784e4068ac5c3222ae0a
BLAKE2b-256 15f7ebca12c1ac55845dd38dbd37e1929ac80921cc33bc43bbe65410c1b2495c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 4e2c2ce735a7f264e01b248112ca108c4a597499caddc5243148cc4a8b644835
MD5 d5a80c2477d88fc3331ab7ed8909a069
BLAKE2b-256 937ae59aba5b4453730e222dd37412b49cc6a3324f43ccbfecddec36d149f388

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 1b4c0b6fe5163c971a894440867e2a3db4211d9314c25b697cf8509771b29da0
MD5 8d1cfa482d8c7324580a42bd13b63482
BLAKE2b-256 8d9a0696734228c8bf7e52aa18e78b456667e2ae2681ca40ff453be083639ea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gn_dist-2407.2-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for gn_dist-2407.2-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 30d7c33dc315dd1ea5ba656833626baec579e5b3d99d05c869d173cfe0376bcb
MD5 cb8a5eca2d7d326f6b9018aa42dd5920
BLAKE2b-256 9ccffaccfa503a164cb85c5f3bd2f9b02c684b88f03622d1270e149d4de1a0df

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2407.2-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: build.yaml on pypdfium2-team/gn-dist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2501

15 files

2407.3

15 files

This release

2407.2 This release

14 files

2407.1

15 files

2407

15 files

2385.1

15 files

2385

15 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page