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, assuming an editable install, run gn --version to determine the new 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-2501.tar.gz (8.1 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-2501-py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

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

Uploaded Python 3musllinux: musl 1.2+ s390x

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

Uploaded Python 3musllinux: musl 1.2+ riscv64

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

Uploaded Python 3musllinux: musl 1.2+ ppc64le

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

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

gn_dist-2501-py3-none-manylinux_2_39_riscv64.whl (995.3 kB view details)

Uploaded Python 3manylinux: glibc 2.39+ riscv64

gn_dist-2501-py3-none-manylinux_2_35_armv7l.whl (1.2 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARMv7l

gn_dist-2501-py3-none-manylinux_2_26_i686.manylinux_2_28_i686.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.26+ i686manylinux: glibc 2.28+ i686

gn_dist-2501-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-2501-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-2501-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-2501-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-2501.tar.gz.

File metadata

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

File hashes

Hashes for gn_dist-2501.tar.gz
Algorithm Hash digest
SHA256 9f85dfdc4d843037a697acc50baa06e2fc5ac2076ee3b7dbe5625a50c4c76b78
MD5 fe9c37a7a6ee7d8bfe0c45e445160bb0
BLAKE2b-256 170ef0ebccc2fe114641f8720207106a97474f20d0a76800b82dc2d4ae927b75

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501.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-2501-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cc3a3d9da3b06d47a2af350a31ffd741e2145b5f831bba117a1baa246d51a8f6
MD5 78d920d5137821c5135fe5fa1651dd2a
BLAKE2b-256 b939f1582e31d578ed752bc730258c2b959004227ea927b2ef4e40ec1d2df4c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_s390x.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 135b5bf442f1fadf818fa1202f03edfa5b199e9f052cb49172ddf86f44bd3f6f
MD5 77735235df77d83c73c64e5324ed9d50
BLAKE2b-256 8c4aa3dcf72418360004422046ba770879b829238693160fdfe104779886b529

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_riscv64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_riscv64.whl
Algorithm Hash digest
SHA256 94df418b24432e6128efef8b9f63a4a3da67ae86dd77f4cf6d0e0f435a53d552
MD5 7556b801871373053080f90c32d6d352
BLAKE2b-256 38d5b329088b961bf657c76be3ea395b60e22a372c5d50b7ad4cf5629abe9159

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 0f4f33fa279bdea2322cde8c82bd105ac3baa65126abd527cdaa65907d916cc1
MD5 e6fbddf7e8c80fe46719ec3dd9102f3a
BLAKE2b-256 d38880ea0bb502f4a714e734faa029a30a137c5be405a28b64368e24b239c1e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_i686.whl.

File metadata

  • Download URL: gn_dist-2501-py3-none-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3, musllinux: musl 1.2+ i686
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5dc82c85b7fa405d4490b3953134630e7908ba2c46a2b9ae79d2903f7f7c0f9a
MD5 310a0f7a2cf5baf2251b6ec241907267
BLAKE2b-256 991a3549820fce1b1942a7ad94c6cd20131a8793b635b7b64ddf4664bdd263b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 4d2721b9b7be504df6e226bc1a76706c7344b1f0d3afc288b3a54a7fec475a97
MD5 a425e9d6f1745ea36d9bead3af86026c
BLAKE2b-256 c83fe92066c79c8eae24c0d9c62a7fd2837cc8274f37895363e4a309a67aac6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 66c6cc1a85f5afac1b620d90bdcf3cf90cb4c259ad933d365bd877e49aade4ef
MD5 c44647759d375ec2e603e07c57f90e06
BLAKE2b-256 f712eb5ce0e31c07e17a2380918be9642231ed7e367d1b02c6cd69b7a7f08a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_39_riscv64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_39_riscv64.whl
Algorithm Hash digest
SHA256 d65833579b04acc66338c9ef33b818c7285a85a473966f1eeab3624997f70137
MD5 90fe7c0df73d5f00b53bff8841f166a6
BLAKE2b-256 27405779caf0d894b9eece5c2d4c581547b9e8794e8c306b5b105afd61c0361b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_35_armv7l.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_35_armv7l.whl
Algorithm Hash digest
SHA256 dd8b6c2790120f65dc23c88d62914f8d6d9ad23aa8a9324bd983c511c8494d70
MD5 9b133a254df5b0f13c2e186596e5d38b
BLAKE2b-256 e7df136cbd54ca2b1c21fa1b95e6f4c50a0cdc4266ed7900fc77c67f5abc489d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_26_i686.manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_26_i686.manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 860d9e7aa0d534d7e3048230053274f3e05ff27f23961ee92426a6607259949c
MD5 bd445382d7911cc1fb506c6279e32ba9
BLAKE2b-256 007b434c37ba5fe20b5bc93eb4ca003e6c0f7650528f04253905c4585ddea918

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-py3-none-manylinux_2_26_i686.manylinux_2_28_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-2501-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 737e322cfebce39cb5a2a352308d9cbedc5381fc6f93bd52b9ed79bced6586cc
MD5 3c0809bd1e29f5690ea795a1948fc3c5
BLAKE2b-256 503b9ea5e7ae20ac98d5eafe1359955dadfecd419fd0c4b2c24f7ced4a33624a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_24_s390x.manylinux_2_28_s390x.whl
Algorithm Hash digest
SHA256 6b32ffce95a871f87900dff7c3f0dfd9317a1a629dab01a29ad04d0eec71913d
MD5 83e716242d864a2ec482db1cecbbe011
BLAKE2b-256 9d43000dddf689454b8ee33f08ef81dc779104846ce3da91267c7f3a38ab9afb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 3535a67cfc77c9c304e6b9a94aae188f05d722bf0612b9e9c0e92531010e5614
MD5 8a8e5f94cfc0da69ddd157b7c1f1a53b
BLAKE2b-256 58fb6538410bfb6e8fdf216649695c6369d4014006d3a23e936f574a4cbfb8ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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-2501-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for gn_dist-2501-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0b6d3c66bcada5ef4cc9a794351b93a450212fe0799bd6a9baf08b77c69f2cc1
MD5 ae8790b679ee4ac27f86ec5334526d7d
BLAKE2b-256 a106d1cc7d4f9a125ffccf08678ddd7f3efc785e666695831c26820bd0b5d6ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for gn_dist-2501-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

This release

2501 This release

15 files

2407.3

15 files

2407.2

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