Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gn: 20190403 -> 2020-03-09 #83290

Merged
merged 2 commits into from Mar 26, 2020
Merged

gn: 20190403 -> 2020-03-09 #83290

merged 2 commits into from Mar 26, 2020

Conversation

primeos
Copy link
Member

@primeos primeos commented Mar 24, 2020

This updates gn to the required version for chromiumDev (the recommended
version for the stable release of Chromium isn't sufficient [0]).

[0]: The Chromium build fails during the configuration phase:
ERROR at //mojo/public/tools/bindings/mojom.gni:393:16: Undefined identifier
"cpp_typemaps",
^-------------

Testing

I only verified it with the configuration phase of chromium and chromiumDev (which both work),e.g.:

./content/renderer/PRESUBMIT_test.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/vplvkrddlj3fia6m79x0czgnchag5mbs-python-2.7.17/bin/python"
configuring
Done. Made 11223 targets from 2053 files in 27168ms
building
ninja: Entering directory `out/Release'
[1/1378] STAMP obj/build/win/default_exe_manifest.stamp

Update: I've verified additional configuration phases:

v8
configuring
gn flags: use_custom_libcxx=false is_clang=false use_sysroot=false is_component_build=false v8_use_external_startup_data=false v8_monolithic=true is_debug=true is_official_build=false treat_warnings_as_errors=false v8_enable_i18n_support=true use_gold=false use_system_xcode=true host_toolchain="//build/toolchain/linux/unbundle:default" v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"
WARNING at the command-line "--args":1:266: Build argument has no effect.
use_custom_libcxx=false is_clang=false use_sysroot=false is_component_build=false v8_use_external_startup_data=false v8_monolithic=true is_debug=true is_official_build=false treat_warnings_as_errors=false v8_enable_i18n_support=true use_gold=false use_system_xcode=true host_toolchain="//build/toolchain/linux/unbundle:default" v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"

                                                     ^---
The variable "use_system_xcode" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <out_dir>"

The build continued as if that argument was unspecified.

Done. Made 145 targets from 77 files in 4901ms
qt5.qtwebengine
( test -e Makefile.gn_run || /nix/store/ra0c9zj9arbp4cw9d8g0bixnh4hqqrdf-qtbase-5.12.7-dev/bin/qmake -o Makefile.gn_run /build/qtwebengine-everywhere-src-5.12.7/src/core/gn_run.pro PREFIX=/nix/store/1k7zrr72cvmwwy7wcmbphifdjjybz3a2-qtwebengine-5.12.7 NIX_OUTPUT_OUT=/nix/store/1k7zrr72cvmwwy7wcmbphifdjjybz3a2-qtwebengine-5.12.7 NIX_OUTPUT_DEV=/nix/store/cgg01ghmalpc1scw2sx0jy65vr43xb7h-qtwebengine-5.12.7-dev NIX_OUTPUT_BIN=/nix/store/l9kagvcayl3yf0ybfqfzlq8cz96xrmiq-qtwebengine-5.12.7-bin NIX_OUTPUT_DOC=/nix/store/cgg01ghmalpc1scw2sx0jy65vr43xb7h-qtwebengine-5.12.7-dev/share/doc/qt-5.12.7 NIX_OUTPUT_QML=/nix/store/l9kagvcayl3yf0ybfqfzlq8cz96xrmiq-qtwebengine-5.12.7-bin/lib/qt-5.12.7/qml NIX_OUTPUT_PLUGIN=/nix/store/l9kagvcayl3yf0ybfqfzlq8cz96xrmiq-qtwebengine-5.12.7-bin/lib/qt-5.12.7/plugins CONFIG+=release ) && make -f Makefile.gn_run
Project MESSAGE: Running: /build/qtwebengine-everywhere-src-5.12.7/src/3rdparty/gn/out/Release/gn gen /build/qtwebengine-everywhere-src-5.12.7/src/core/release --script-executable=/nix/store/vplvkrddlj3fia6m79x0czgnchag5mbs-python-2.7.17/bin/python2 --args='use_qt=true is_component_build=false is_shared=true enable_message_center=false enable_mus=false enable_nacl=false enable_remoting=false enable_reporting=false enable_web_speech=false enable_widevine=true has_native_accessibility=false use_allocator_shim=false use_allocator="none" v8_use_external_startup_data=false treat_warnings_as_errors=false enable_swiftshader=false use_custom_libcxx=false use_jumbo_build=true jumbo_file_merge_limit=8 jumbo_build_excluded=["browser"] enable_basic_printing=true enable_print_preview=true enable_pdf=true enable_plugins=true enable_spellcheck=true enable_webrtc=true proprietary_codecs=true ffmpeg_branding="Chrome" enable_precompiled_headers=true is_official_build=true is_debug=false symbol_level=0 remove_webcore_debug_symbols=true remove_v8base_debug_symbols=true v8_use_snapshot=true use_kerberos=false enable_iterator_debugging=false use_cups=false use_gio=false use_gnome_keyring=false linux_use_bundled_binutils=false use_udev=true use_bundled_fontconfig=false use_sysroot=false enable_session_service=false is_cfi=false toolkit_views=false use_ozone=true ozone_auto_platforms=false ozone_platform_headless=false ozone_platform_external=true ozone_platform="qt" is_clang=false custom_toolchain="/build/qtwebengine-everywhere-src-5.12.7/src/toolchain:target" host_toolchain="/build/qtwebengine-everywhere-src-5.12.7/src/toolchain:host" host_cpu="x64" pkg_config="pkg-config" host_pkg_config="/nix/store/f6dakip9hyywfvwd23wnrh41fxl9p4yi-pkg-config-0.29.2/bin/pkg-config" use_system_zlib=true use_system_minizip=true pdfium_use_system_zlib=true use_system_libpng=true pdfium_use_system_libpng=true use_system_libjpeg=true use_system_freetype=true use_system_harfbuzz=true use_pulseaudio=false use_alsa=true ozone_platform_x11=true use_xscrnsaver=true use_system_libevent=true use_system_libwebp=true use_system_opus=true use_system_snappy=true qtwebengine_target="/build/qtwebengine-everywhere-src-5.12.7/src/core/release:QtWebEngineCore"' --root=/build/qtwebengine-everywhere-src-5.12.7/src/3rdparty/chromium
Done. Made 9697 targets from 1582 files in 21653ms
aseprite.skia
configuring
Done. Made 42 targets from 28 files in 121ms
building

Motivation

This fixes the build of chromiumDev and is possibly required for other builds too (or will be soon).
I've also added some extra notes and did a minor refactoring.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc maintainers: @stesie @matthewbauer

This updates gn to the required version for chromiumDev (the recommended
version for the stable release of Chromium isn't sufficient [0]).

[0]: The Chromium build fails during the configuration phase:
ERROR at //mojo/public/tools/bindings/mojom.gni:393:16: Undefined identifier
               "cpp_typemaps",
               ^-------------
With NixOS#83290 merged the build would fail during the configuration phase:
```
configuring
ERROR at //gn/BUILDCONFIG.gn:85:14: Script returned non-zero exit code.
  is_clang = exec_script("gn/is_clang.py",
             ^----------
Current dir: /build/source/out/Release/
Command: python /build/source/gn/gn/is_clang.py cc c++
Returned 2.
stderr:

python: can't open file '/build/source/gn/gn/is_clang.py': [Errno 2] No such file or directory
```
@primeos
Copy link
Member Author

primeos commented Mar 26, 2020

I did some additional manual testing and fixed one regression. Assuming I didn't miss anything with my minimal testing approach, the rest of the rebuilds should be fine.

@primeos primeos merged commit 7525624 into NixOS:staging Mar 26, 2020
@primeos
Copy link
Member Author

primeos commented Apr 6, 2020

@NixOS/backports I just realized that I'll need this change on 20.03 as well to update Chromium (version 83 should be released on May 19). Should I backport this PR or write a specific patch for 20.03 to override gn for chromium?

primeos added a commit to primeos/nixpkgs that referenced this pull request Apr 14, 2020
With NixOS#83290 merged the build would fail during the configuration phase:
```
configuring
ERROR at //gn/BUILDCONFIG.gn:85:14: Script returned non-zero exit code.
  is_clang = exec_script("gn/is_clang.py",
             ^----------
Current dir: /build/source/out/Release/
Command: python /build/source/gn/gn/is_clang.py cc c++
Returned 2.
stderr:

python: can't open file '/build/source/gn/gn/is_clang.py': [Errno 2] No such file or directory
```

(cherry picked from commit ad66bbd)
@primeos
Copy link
Member Author

primeos commented Apr 17, 2020

We shouldn't use ${pkgs.gn} to build chromium.

I don't necessarily disagree (would e.g. be easier to maintain), but why does this apply to Chromium specifically? There aren't any tagged releases for gn so IMO this applies to any package that depends on gn. And due to the lack of any tagged release it would IMO make the most sense to base the gn version on the current Chromium release (stable channel). Otherwise, how would we decided when to update gn and to which version?

First, it breaks other software

Did this PR break anything?

and second, it is not always possible: one day pkgs.chromium and pkgs.chromiumBeta will require different gn

This is currently the case due to breaking gn changes. We therefore simply override gn for the beta and dev channels.

@primeos
Copy link
Member Author

primeos commented Apr 17, 2020

I've opened #85457 to further track this discussion (as this PR is already merged) ;)

stigok pushed a commit to stigok/nixpkgs that referenced this pull request Jun 12, 2020
With NixOS#83290 merged the build would fail during the configuration phase:
```
configuring
ERROR at //gn/BUILDCONFIG.gn:85:14: Script returned non-zero exit code.
  is_clang = exec_script("gn/is_clang.py",
             ^----------
Current dir: /build/source/out/Release/
Command: python /build/source/gn/gn/is_clang.py cc c++
Returned 2.
stderr:

python: can't open file '/build/source/gn/gn/is_clang.py': [Errno 2] No such file or directory
```

(cherry picked from commit ad66bbd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant