Compare commits
39 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f0b645626 | ||
|
|
ad614f006d | ||
|
|
68cbfd4064 | ||
|
|
f6707e13ab | ||
|
|
0108a0f658 | ||
|
|
fb9146ea2d | ||
|
|
36652e2ea2 | ||
|
|
7a57f7d9af | ||
|
|
ba3f822d33 | ||
|
|
2b16d1f8f7 | ||
|
|
b8d1d3596d | ||
|
|
edf73c6d2d | ||
|
|
8ff9c3ade9 | ||
|
|
7460a44773 | ||
|
|
8b564bf8a7 | ||
|
|
b8fc72be50 | ||
|
|
18abf5b279 | ||
|
|
95234a4bca | ||
|
|
eafbd08dda | ||
|
|
601622654e | ||
|
|
0f6d5d5a84 | ||
|
|
1544f92b9d | ||
|
|
4664c7a8a2 | ||
|
|
3425867c4e | ||
|
|
28c91cc020 | ||
|
|
3e970dcf79 | ||
|
|
cc1dab33ee | ||
|
|
7e3efc3614 | ||
|
|
d6f5a952ba | ||
|
|
c17a3ab19c | ||
|
|
3699a2dfd5 | ||
|
|
c7da1af2f0 | ||
|
|
f72c4c9da3 | ||
|
|
1a65072edf | ||
|
|
12568d0f86 | ||
|
|
447673bd57 | ||
|
|
26f49118d5 | ||
|
|
3ed8363d33 | ||
|
|
6a676fbdc3 |
9 changed files with 406 additions and 136 deletions
200
.gitignore
vendored
200
.gitignore
vendored
|
|
@ -1,101 +1,99 @@
|
|||
/64b3b9401c1c3ed5f3c43c1cac00b91f83597ab8.tar.gz
|
||||
/gn-64b3b940.tar.gz
|
||||
/gn-b2e3d862.tar.gz
|
||||
/gn-a95c8a3c.tar.gz
|
||||
/gn-dba01723.tar.gz
|
||||
/gn-6771ce56.tar.gz
|
||||
/gn-39a87c0b.tar.gz
|
||||
/gn-d2dce752.tar.gz
|
||||
/gn-e9b84332.tar.gz
|
||||
/gn-d924640c.tar.gz
|
||||
/gn-4d207c94.tar.gz
|
||||
/gn-24e2f7df.tar.gz
|
||||
/gn-d565aa3e.tar.gz
|
||||
/gn-eea3906f.tar.gz
|
||||
/gn-69ec4fca.tar.gz
|
||||
/gn-46b572ce.tar.gz
|
||||
/gn-07e2e1b9.tar.gz
|
||||
/gn-de86ec41.tar.gz
|
||||
/gn-0153d369.tar.gz
|
||||
/gn-693f9fb8.tar.gz
|
||||
/gn-8926696a.tar.gz
|
||||
/gn-90294ccd.tar.gz
|
||||
/gn-18512455.tar.gz
|
||||
/gn-4aa9bdfa.tar.gz
|
||||
/gn-b7903130.tar.gz
|
||||
/gn-e0afadf7.tar.gz
|
||||
/gn-d417bc7e.tar.gz
|
||||
/gn-2e56c317.tar.gz
|
||||
/gn-281ba2c9.tar.gz
|
||||
/gn-f1b14125.tar.gz
|
||||
/gn-80a40b07.tar.gz
|
||||
/gn-4b613b10.tar.gz
|
||||
/gn-377f566a.tar.gz
|
||||
/gn-6109f626.tar.gz
|
||||
/gn-d7c2209c.tar.gz
|
||||
/gn-f27bae88.tar.gz
|
||||
/gn-bd99dbf9.tar.gz
|
||||
/gn-93f0d7a7.tar.gz
|
||||
/gn-ae110f8b.tar.gz
|
||||
/gn-c114b7e0.tar.gz
|
||||
/gn-fd6cae41.tar.gz
|
||||
/gn-2ecd43a1.tar.gz
|
||||
/gn-e62d4e19.tar.gz
|
||||
/gn-29accf5a.tar.gz
|
||||
/gn-03ce92df.tar.gz
|
||||
/gn-9ef32177.tar.gz
|
||||
/gn-9ef321772ecc.tar.gz
|
||||
/gn-c8c63300ac8e.tar.gz
|
||||
/gn-0bcd37bd2b83.tar.gz
|
||||
/gn-5705e56a0e58.tar.gz
|
||||
/gn-00b741b1568d.tar.gz
|
||||
/gn-b4851eb2062f.tar.gz
|
||||
/gn-cc28efe62ef0.tar.gz
|
||||
/gn-b9c6c19be95a.tar.gz
|
||||
/gn-57c352b2b034.tar.gz
|
||||
/gn-27b90626701a.tar.gz
|
||||
/gn-a4d67be044b4.tar.gz
|
||||
/gn-1c4151ff5c1d.tar.gz
|
||||
/gn-70d6c60823c0.tar.gz
|
||||
/gn-5e19d2fb166f.tar.gz
|
||||
/gn-84c8431f3e03.tar.gz
|
||||
/gn-edf6ef4b06b4.tar.gz
|
||||
/gn-b25a2f8c2d33.tar.gz
|
||||
/gn-fe330c0ae1ec.tar.gz
|
||||
/gn-41fef642de70.tar.gz
|
||||
/gn-61da8bdce622.tar.gz
|
||||
/gn-ffeea1b1fd07.tar.gz
|
||||
/gn-5a004f9427a0.tar.gz
|
||||
/gn-26aa46c283e4.tar.gz
|
||||
/gn-6975103d9f59.tar.gz
|
||||
/gn-e9e83d9095d3.tar.gz
|
||||
/gn-e3978de3e8da.tar.gz
|
||||
/gn-4bd1a77e6795.tar.gz
|
||||
/gn-11e12b0ef870.tar.gz
|
||||
/gn-fae280eabe5d.tar.gz
|
||||
/gn-1029a3b50873.tar.gz
|
||||
/gn-3fccef9033b9.tar.gz
|
||||
/gn-811d332bd905.tar.gz
|
||||
/gn-cc56a0f98bb3.tar.gz
|
||||
/gn-991530ce394e.tar.gz
|
||||
/gn-182a6eb05d15.tar.gz
|
||||
/gn-5d8727f3fbf4.tar.gz
|
||||
/gn-e4702d740906.tar.gz
|
||||
/gn-85bd0a62938b.tar.gz
|
||||
/gn-bc5744174d9e.tar.gz
|
||||
/gn-c7b223bfb225.tar.gz
|
||||
/gn-92e63272dc04.tar.gz
|
||||
/gn-7367b0df0a0a.tar.gz
|
||||
/gn-85944ebc24a9.tar.gz
|
||||
/gn-5fd939de8a66.tar.gz
|
||||
/gn-b8562a4abd95.tar.gz
|
||||
/gn-5d76868385b8.tar.gz
|
||||
/gn-b5adfe5f574d.tar.gz
|
||||
/gn-f99e015ac35f.tar.gz
|
||||
/gn-a2e2717ea670.tar.gz
|
||||
/gn-a3dcd7a7ad86.tar.gz
|
||||
/gn-8b973aa51d02.tar.gz
|
||||
/gn-0a2b8eac80f1.tar.gz
|
||||
/gn-03d10f1657b4.tar.gz
|
||||
/gn-5787e994aa4c.tar.gz
|
||||
/gn-88e8054aff7b.tar.gz
|
||||
*.bak
|
||||
*.gypcmd
|
||||
*.mk
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.orig
|
||||
*.pdb
|
||||
*.props
|
||||
*.pyc
|
||||
*.pyproj
|
||||
*.rules
|
||||
*.sdf
|
||||
*.sln
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
*.suo
|
||||
*.targets
|
||||
*.user
|
||||
*.vc.opendb
|
||||
*.vcproj
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vpj
|
||||
*.vpw
|
||||
*.vpwhistu
|
||||
*.vtg
|
||||
*.xcodeproj
|
||||
*.xcworkspace
|
||||
*.VC.db
|
||||
*_proto.xml
|
||||
*_proto_cpp.xml
|
||||
*~
|
||||
!Android.mk
|
||||
.*.sw?
|
||||
.DS_Store
|
||||
.cache
|
||||
.cipd
|
||||
.classpath
|
||||
.cproject
|
||||
.gdb_history
|
||||
.gdbinit
|
||||
.landmines
|
||||
.metadata
|
||||
.project
|
||||
.pydevproject
|
||||
.recipe_deps
|
||||
.checkstyle
|
||||
/clang
|
||||
compile_commands.json
|
||||
cscope.*
|
||||
out/
|
||||
GPATH
|
||||
GRTAGS
|
||||
GSYMS
|
||||
GTAGS
|
||||
Session.vim
|
||||
tags
|
||||
Thumbs.db
|
||||
# Settings directories for eclipse
|
||||
/.externalToolBuilders/
|
||||
/.settings/
|
||||
/.vs/
|
||||
# Visual Studio Code
|
||||
/.vscode/
|
||||
/_out
|
||||
# VSChromium configuration file
|
||||
vs-chromium-project.txt
|
||||
/gn-22581fb46c0c.tar.gz
|
||||
/gn-cfddfffb7913.tar.gz
|
||||
/gn-93ee9b91423c.tar.gz
|
||||
/gn-415b3b19e094.tar.gz
|
||||
/gn-d823fd85da3f.tar.gz
|
||||
/gn-155c53952ec2.tar.gz
|
||||
/gn-b0c2742896b6.tar.gz
|
||||
/gn-df98b86690c8.tar.gz
|
||||
/gn-d010969ecc31.tar.gz
|
||||
/gn-b3a0bff47dd8.tar.gz
|
||||
/gn-b2afae122eeb.tar.gz
|
||||
/gn-0ee833e823f2.tar.gz
|
||||
/gn-8f2193f70793.tar.gz
|
||||
/gn-05eed8f6252e.tar.gz
|
||||
/gn-449f3e4dfb45.tar.gz
|
||||
/gn-54f5b539df8c.tar.gz
|
||||
/gn-32f63e70484f.tar.gz
|
||||
/gn-d010e218ca70.tar.gz
|
||||
/gn-225e90c5025b.tar.gz
|
||||
/gn-20806f79c6b4.tar.gz
|
||||
/gn-95b0f8fe31a9.tar.gz
|
||||
/gn-feafd1012a32.tar.gz
|
||||
/gn-468c6128db7f.tar.gz
|
||||
/gn-c97a86a72105.tar.gz
|
||||
/gn-ed1abc107815.tar.gz
|
||||
/gn-4a8016dc3915.tar.gz
|
||||
/gn-3d0d3445f67d.tar.gz
|
||||
/gn-7a8aa3a08a13.tar.gz
|
||||
/gn-18602f6cf116.tar.gz
|
||||
/gn-6e8e0d6d4a15.tar.gz
|
||||
/gn-90478db6b59b.tar.gz
|
||||
/gn-487f8353f154.tar.gz
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
From 8969bb39cc827bd36a9fd5b5742eb645fb2c4bf6 Mon Sep 17 00:00:00 2001
|
||||
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||
Date: Thu, 30 May 2024 08:49:32 -0400
|
||||
Subject: [PATCH 1/2] Downstream-only: do not override optimization flags
|
||||
|
||||
Stop overriding optimization flags; not sent upstream because this is
|
||||
intentional on their part.
|
||||
|
||||
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_flags
|
||||
---
|
||||
build/gen.py | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/build/gen.py b/build/gen.py
|
||||
index 6f3652ee..2cb433bc 100755
|
||||
--- a/build/gen.py
|
||||
+++ b/build/gen.py
|
||||
@@ -432,10 +432,8 @@ def WriteGNNinja(path, platform, host, options, args_list):
|
||||
cflags.extend(['-D_LIBCPP_DEBUG=1', '-D_GLIBCXX_DEBUG=1'])
|
||||
else:
|
||||
cflags.append('-DNDEBUG')
|
||||
- cflags.append('-O3')
|
||||
if options.no_strip:
|
||||
cflags.append('-g')
|
||||
- ldflags.append('-O3')
|
||||
# Use -fdata-sections and -ffunction-sections to place each function
|
||||
# or data item into its own section so --gc-sections can eliminate any
|
||||
# unused functions and data items.
|
||||
--
|
||||
2.44.0
|
||||
|
||||
25
0002-Downstream-only-do-not-build-with-Wno-format.patch
Normal file
25
0002-Downstream-only-do-not-build-with-Wno-format.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From 8bbbd89be97178be941bd11071c009145d3caf4b Mon Sep 17 00:00:00 2001
|
||||
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||
Date: Thu, 30 May 2024 08:56:58 -0400
|
||||
Subject: [PATCH 2/2] Downstream-only: do not build with -Wno-format
|
||||
|
||||
This conflicts with -Werror=format-security.
|
||||
---
|
||||
build/gen.py | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/build/gen.py b/build/gen.py
|
||||
index 2cb433bc..155c579f 100755
|
||||
--- a/build/gen.py
|
||||
+++ b/build/gen.py
|
||||
@@ -513,7 +513,6 @@ def WriteGNNinja(path, platform, host, options, args_list):
|
||||
'-Wno-implicit-fallthrough',
|
||||
'-Wno-redundant-move',
|
||||
'-Wno-unused-variable',
|
||||
- '-Wno-format', # Use of %llx, which is supported by _UCRT, false positive
|
||||
'-Wno-strict-aliasing', # Dereferencing punned pointer
|
||||
'-Wno-cast-function-type', # Casting FARPROC to RegDeleteKeyExPtr
|
||||
])
|
||||
--
|
||||
2.44.0
|
||||
|
||||
219
README.md
219
README.md
|
|
@ -1,3 +1,218 @@
|
|||
# gn
|
||||
# GN
|
||||
|
||||
The gn package
|
||||
GN is a meta-build system that generates build files for
|
||||
[Ninja](https://ninja-build.org).
|
||||
|
||||
Related resources:
|
||||
|
||||
* Documentation in [docs/](https://gn.googlesource.com/gn/+/main/docs/). In
|
||||
particular:
|
||||
* [GN quick start guide](https://gn.googlesource.com/gn/+/main/docs/quick_start.md).
|
||||
* [Frequently asked questions](https://gn.googlesource.com/gn/+/main/docs/faq.md)
|
||||
* [Reference](https://gn.googlesource.com/gn/+/main/docs/reference.md)
|
||||
(all builtin help converted to a single file).
|
||||
* An introductory [presentation](https://docs.google.com/presentation/d/15Zwb53JcncHfEwHpnG_PoIbbzQ3GQi_cpujYwbpcbZo/edit?usp=sharing).
|
||||
* The [mailing list](https://groups.google.com/a/chromium.org/forum/#!forum/gn-dev).
|
||||
* The [bug database](https://bugs.chromium.org/p/gn/issues/list).
|
||||
|
||||
## What GN is for
|
||||
|
||||
GN is currently used as the build system for Chromium, Fuchsia, and related
|
||||
projects. Some strengths of GN are:
|
||||
|
||||
* It is designed for large projects and large teams. It scales efficiently to
|
||||
many thousands of build files and tens of thousands of source files.
|
||||
|
||||
* It has a readable, clean syntax. Once a build is set-up, it is generally
|
||||
easy for people with no backround in GN to make basic edits to the build.
|
||||
|
||||
* It is designed for multi-platform projects. It can cleanly express many
|
||||
complicated build variants across different platforms. A single build
|
||||
invocation can target multiple platforms.
|
||||
|
||||
* It supports multiple parallel output directories, each with their own
|
||||
configuration. This allows a developer to maintain builds targeting debug,
|
||||
release, or different platforms in parallel without forced rebuilds when
|
||||
switching.
|
||||
|
||||
* It has a focus on correctness. GN checks for the correct dependencies,
|
||||
inputs, and outputs to the extent possible, and has a number of tools to
|
||||
allow developers to ensure the build evolves as desired (for example, `gn
|
||||
check`, `testonly`, `assert_no_deps`).
|
||||
|
||||
* It has comprehensive build-in help available from the command-line.
|
||||
|
||||
Although small projects successfully use GN, the focus on large projects has
|
||||
some disadvanages:
|
||||
|
||||
* GN has the goal of being minimally expressive. Although it can be quite
|
||||
flexible, a design goal is to direct members of a large team (who may not
|
||||
have much knowledge about the build) down an easy-to-understand, well-lit
|
||||
path. This isn't necessarily the correct trade-off for smaller projects.
|
||||
|
||||
* The minimal build configuration is relatively heavyweight. There are several
|
||||
files required and the exact way all compilers and linkers are run must be
|
||||
specified in the configuration (see "Examples" below). There is no default
|
||||
compiler configuration.
|
||||
|
||||
* It is not easily composable. GN is designed to compile a single large
|
||||
project with relatively uniform settings and rules. Projects like Chromium
|
||||
do bring together multiple repositories from multiple teams, but the
|
||||
projects must agree on some conventions in the build files to allow this to
|
||||
work.
|
||||
|
||||
* GN is designed with the expectation that the developers building a project
|
||||
want to compile an identical configuration. So while builds can integrate
|
||||
with the user's environment like the CXX and CFLAGS variables if they want,
|
||||
this is not the default and most project's builds do not do this. The result
|
||||
is that many GN projects do not integrate well with other systems like
|
||||
ebuild.
|
||||
|
||||
* There is no simple release scheme (see "Versioning and distribution" below).
|
||||
Projects are expected to manage the version of GN they require. Getting an
|
||||
appropriate GN binary can be a hurdle for new contributors to a project.
|
||||
Since GN is relatively uncommon, it can be more difficult to find
|
||||
information and examples.
|
||||
|
||||
GN can generate Ninja build files for C, C++, Rust, Objective C, and Swift
|
||||
source on most popular platforms. Other languages can be compiled using the
|
||||
general "action" rules which are executed by Python or another scripting
|
||||
language (Google does this to compile Java and Go). But because this is not as
|
||||
clean, generally GN is only used when the bulk of the build is in one of the
|
||||
main built-in languages.
|
||||
|
||||
## Getting a binary
|
||||
|
||||
You can download the latest version of GN binary for
|
||||
[Linux](https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/latest),
|
||||
[macOS](https://chrome-infra-packages.appspot.com/dl/gn/gn/mac-amd64/+/latest) and
|
||||
[Windows](https://chrome-infra-packages.appspot.com/dl/gn/gn/windows-amd64/+/latest)
|
||||
from Google's build infrastructure (see "Versioning and distribution" below for
|
||||
how this is expected to work).
|
||||
|
||||
Alternatively, you can build GN from source with a C++17 compiler:
|
||||
|
||||
git clone https://gn.googlesource.com/gn
|
||||
cd gn
|
||||
python build/gen.py # --allow-warning if you want to build with warnings.
|
||||
ninja -C out
|
||||
# To run tests:
|
||||
out/gn_unittests
|
||||
|
||||
On Windows, it is expected that `cl.exe`, `link.exe`, and `lib.exe` can be found
|
||||
in `PATH`, so you'll want to run from a Visual Studio command prompt, or
|
||||
similar.
|
||||
|
||||
On Linux, Mac and z/OS, the default compiler is `clang++`, a recent version is
|
||||
expected to be found in `PATH`. This can be overridden by setting the `CC`, `CXX`,
|
||||
and `AR` environment variables.
|
||||
|
||||
On z/OS, building GN requires [ZOSLIB](https://github.com/ibmruntimes/zoslib) to be
|
||||
installed, as described at that URL. When building with `build/gen.py`, use the option
|
||||
`--zoslib-dir` to specify the path to [ZOSLIB](https://github.com/ibmruntimes/zoslib):
|
||||
|
||||
cd gn
|
||||
python build/gen.py --zoslib-dir /path/to/zoslib
|
||||
|
||||
By default, if you don't specify `--zoslib-dir`, `gn/build/gen.py` expects to find
|
||||
`zoslib` directory under `gn/third_party/`.
|
||||
|
||||
## Examples
|
||||
|
||||
There is a simple example in [examples/simple_build](examples/simple_build)
|
||||
directory that is a good place to get started with the minimal configuration.
|
||||
|
||||
To build and run the simple example with the default gcc compiler:
|
||||
|
||||
cd examples/simple_build
|
||||
../../out/gn gen -C out
|
||||
ninja -C out
|
||||
./out/hello
|
||||
|
||||
For a maximal configuration see the Chromium setup:
|
||||
* [.gn](https://cs.chromium.org/chromium/src/.gn)
|
||||
* [BUILDCONFIG.gn](https://cs.chromium.org/chromium/src/build/config/BUILDCONFIG.gn)
|
||||
* [Toolchain setup](https://cs.chromium.org/chromium/src/build/toolchain/)
|
||||
* [Compiler setup](https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn)
|
||||
|
||||
and the Fuchsia setup:
|
||||
* [.gn](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/.gn)
|
||||
* [BUILDCONFIG.gn](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/build/config/BUILDCONFIG.gn)
|
||||
* [Toolchain setup](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/build/toolchain/)
|
||||
* [Compiler setup](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/build/config/BUILD.gn)
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
If you find a bug, you can see if it is known or report it in the [bug
|
||||
database](https://bugs.chromium.org/p/gn/issues/list).
|
||||
|
||||
## Sending patches
|
||||
|
||||
GN uses [Gerrit](https://www.gerritcodereview.com/) for code review hosted at
|
||||
[gn-review.googlesource.com](https://gn-review.googlesource.com/). The short
|
||||
version of how to patch is:
|
||||
|
||||
Register at https://gn-review.googlesource.com.
|
||||
|
||||
... edit code ...
|
||||
ninja -C out && out/gn_unittests
|
||||
|
||||
Then, to upload a change for review:
|
||||
|
||||
git commit
|
||||
git push origin HEAD:refs/for/main
|
||||
|
||||
The first time you do this you'll get an error from the server about a missing
|
||||
change-ID. Follow the directions in the error message to install the change-ID
|
||||
hook and run `git commit --amend` to apply the hook to the current commit.
|
||||
|
||||
When revising a change, use:
|
||||
|
||||
git commit --amend
|
||||
git push origin HEAD:refs/for/main
|
||||
|
||||
which will add the new changes to the existing code review, rather than creating
|
||||
a new one.
|
||||
|
||||
We ask that all contributors
|
||||
[sign Google's Contributor License Agreement](https://cla.developers.google.com/)
|
||||
(either individual or corporate as appropriate, select 'any other Google
|
||||
project').
|
||||
|
||||
## Community
|
||||
|
||||
You may ask questions and follow along with GN's development on Chromium's
|
||||
[gn-dev@](https://groups.google.com/a/chromium.org/forum/#!forum/gn-dev)
|
||||
Google Group.
|
||||
|
||||
## Versioning and distribution
|
||||
|
||||
Most open-source projects are designed to use the developer's computer's current
|
||||
toolchain such as compiler, linker, and build tool. But the large
|
||||
centrally controlled projects that GN is designed for typically want a more
|
||||
hermetic environment. They will ensure that developers are using a specific
|
||||
compatible toolchain that is versioned with the code.
|
||||
|
||||
As a result, GN expects that the project choose the appropriate version of GN
|
||||
that will work with each version of the project. There is no "current stable
|
||||
version" of GN that is expected to work for all projects.
|
||||
|
||||
As a result, the GN developers do not maintain any packages in any of the
|
||||
various packaging systems (Debian, RedHat, HomeBrew, etc.). Some of these
|
||||
systems to have GN packages, but they are maintained by third parties and you
|
||||
should use them at your own risk. Instead, we recommend you refer your checkout
|
||||
tooling to download binaries for a specific hash from [Google's build
|
||||
infrastructure](https://chrome-infra-packages.appspot.com/p/gn/gn) or compile
|
||||
your own.
|
||||
|
||||
GN does not guarantee the backwards-compatibility of new versions and has no
|
||||
branches or versioning scheme beyond the sequence of commits to the main git
|
||||
branch (which is expected to be stable).
|
||||
|
||||
In practice, however, GN is very backwards-compatible. The core functionality
|
||||
has been stable for many years and there is enough GN code at Google alone to
|
||||
make non-backwards-compatible changes very difficult, even if they were
|
||||
desirable.
|
||||
|
||||
There have been discussions about adding a versioning scheme with some
|
||||
guarantees about backwards-compatibility, but nothing has yet been implemented.
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
diff -Naur gn-03d10f1657b4-original/build/gen.py gn-03d10f1657b4/build/gen.py
|
||||
--- gn-03d10f1657b4-original/build/gen.py 2024-02-22 16:27:50.129000000 -0500
|
||||
+++ gn-03d10f1657b4/build/gen.py 2024-02-22 16:30:14.595100970 -0500
|
||||
@@ -416,10 +416,8 @@
|
||||
cflags.extend(['-D_LIBCPP_DEBUG=1', '-D_GLIBCXX_DEBUG=1'])
|
||||
else:
|
||||
cflags.append('-DNDEBUG')
|
||||
- cflags.append('-O3')
|
||||
if options.no_strip:
|
||||
cflags.append('-g')
|
||||
- ldflags.append('-O3')
|
||||
# Use -fdata-sections and -ffunction-sections to place each function
|
||||
# or data item into its own section so --gc-sections can eliminate any
|
||||
# unused functions and data items.
|
||||
19
gn.rpmlintrc
19
gn.rpmlintrc
|
|
@ -1,8 +1,11 @@
|
|||
# This is a maintainer script, so it should indeed be executable:
|
||||
addFilter(r' strange-permission update-version 775$')
|
||||
# The source URL exports a tarball directly from git; while the contents are
|
||||
# stable since it references a particular commit, the tarball checksum and even
|
||||
# file size are different every time. I haven’t looked too closely, but I
|
||||
# suspect this is due to timestamps in the tar stream being based on the access
|
||||
# time rather than the time of the commit.
|
||||
addFilter(r' file-size-mismatch gn-[0-9A-Fa-f]{8}\.tar\.gz = ')
|
||||
# Hardinking duplicates is not worthwhile because these files are small and few
|
||||
# in number.
|
||||
addFilter(r"gn-doc\..*: files-duplicate /.*\.json")
|
||||
# This script is for documentation only; it has a weird polyglot self-exec
|
||||
# trick.
|
||||
addFilter(r"gn-doc\..*: (potential-bashisms|bin-sh-syntax-error) /.*/infra/recipes\.py")
|
||||
# These are all acceptable in the context of sample projects in the docs:
|
||||
addFilter(r"gn-doc\..*: (zero-length|version-control-internal-file) /.*/examples/")
|
||||
addFilter(r"gn-doc\..*: hidden-file-or-dir /.*/examples/.*/\.(gitignore|gn)")
|
||||
# This script is for looking at, not for executing:
|
||||
addFilter(r"gn-doc\..*: env-script-interpreter /.*/infra/config/main\.star .*")
|
||||
|
|
|
|||
28
gn.spec
28
gn.spec
|
|
@ -24,16 +24,16 @@ Name: gn
|
|||
# 7. Commit the changes
|
||||
#
|
||||
# See https://gn.googlesource.com/gn/+log for the latest changes.
|
||||
%global commit 88e8054aff7bd0cb2295c7d9361d2be0b7355f27
|
||||
%global access 20240301
|
||||
%global commit 487f8353f15456474437df32bb186187b0940b45
|
||||
%global access 20250502
|
||||
%global shortcommit %{sub %{commit} 1 12}
|
||||
%global position 2154
|
||||
%global position 2234
|
||||
Version: %{position}^%{access}git%{shortcommit}
|
||||
Release: %autorelease
|
||||
Summary: Meta-build system that generates build files for Ninja
|
||||
|
||||
# The entire source is BSD-3-Clause, except:
|
||||
# - src/base/third_party/icu/ is (Unicode AND ICU); see
|
||||
# - src/base/third_party/icu/ is (Unicode-DFS-2016 AND ICU); see
|
||||
# src/base/third_party/icu/LICENSE and also the header comment in
|
||||
# src/base/third_party/icu/icu_utf.h.
|
||||
#
|
||||
|
|
@ -41,16 +41,25 @@ Summary: Meta-build system that generates build files for Ninja
|
|||
# contribute to the binary RPMs, only to the gn_unittests executable, which is
|
||||
# not installed; you may verify this with:
|
||||
# gdb -ex 'set pagination off' -ex 'info sources' gn | grep -F gn_test.cc
|
||||
License: BSD-3-Clause AND Unicode AND ICU
|
||||
License: BSD-3-Clause AND Unicode-DFS-2016 AND ICU
|
||||
SourceLicense: %{license} AND Apache-2.0
|
||||
URL: https://gn.googlesource.com/gn
|
||||
Source0: %{url}/+archive/%{commit}.tar.gz#/gn-%{shortcommit}.tar.gz
|
||||
# Generated using script update-version:
|
||||
Source1: last_commit_position.h
|
||||
Source2: update-version
|
||||
|
||||
# Downstream-only: do not override optimization flags
|
||||
#
|
||||
# Stop overriding optimization flags; not sent upstream because this is
|
||||
# intentional on their part
|
||||
Patch: gn-03d10f1657b4-no-O3.patch
|
||||
# intentional on their part.
|
||||
#
|
||||
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_flags
|
||||
Patch: 0001-Downstream-only-do-not-override-optimization-flags.patch
|
||||
# Downstream-only: do not build with -Wno-format
|
||||
#
|
||||
# This conflicts with -Werror=format-security.
|
||||
Patch: 0002-Downstream-only-do-not-build-with-Wno-format.patch
|
||||
|
||||
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
||||
ExcludeArch: %{ix86}
|
||||
|
|
@ -116,7 +125,7 @@ cp -vp misc/vim/README.md README-vim.md
|
|||
%py3_shebang_fix .
|
||||
|
||||
|
||||
%build
|
||||
%conf
|
||||
AR='gcc-ar'; export AR
|
||||
# Treating warnings as errors is too strict for downstream builds.
|
||||
#
|
||||
|
|
@ -128,6 +137,9 @@ AR='gcc-ar'; export AR
|
|||
--no-last-commit-position \
|
||||
--no-strip \
|
||||
--no-static-libstdc++
|
||||
|
||||
|
||||
%build
|
||||
ninja -j %{_smp_build_ncpus} -C out -v
|
||||
|
||||
%if %{with html_docs}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#ifndef OUT_LAST_COMMIT_POSITION_H_
|
||||
#define OUT_LAST_COMMIT_POSITION_H_
|
||||
|
||||
#define LAST_COMMIT_POSITION_NUM 2154
|
||||
#define LAST_COMMIT_POSITION "2154 (88e8054aff7b)"
|
||||
#define LAST_COMMIT_POSITION_NUM 2234
|
||||
#define LAST_COMMIT_POSITION "2234 (487f8353f154)"
|
||||
|
||||
#endif // OUT_LAST_COMMIT_POSITION_H_
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (gn-88e8054aff7b.tar.gz) = c07e5c990d0016f97530dfc9cb58b3459b8c71d77bdd91976e81e49df03407eec8c86a3ef179c3f9fe61fd0ca06e8bd55a9c674699876d3ef733f201ad6d57a3
|
||||
SHA512 (gn-487f8353f154.tar.gz) = fa7b2f2ff84f5bfccc774cd06a2c1fd8c25948b6162339d961412413508dd3a1cebe15f930461bd76b4fce16cf45ad276b1f5e0e7de6a13e4e1a0ed053eefc3e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue