New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 732518 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Should gn write a ninja_required_version= line?

Project Member Reported by thakis@chromium.org, Jun 12 2017

Issue description

In a recent chromium-dev thread ([chromium-dev] Ninja Error while building ChromePublic APK on ToT !) someone had an older ninja binary on their path in front of the new one in depot_tools.

If gn wrote a ninja_required_version line (https://ninja-build.org/manual.html#ref_versioning) the error would've maybe been a bit less cryptic.

Should we add this?

If not, please WontFix. Else, I'll try to get around to adding it eventually. (Or someone else can.)
 
Components: Build
Status: Available (was: Untriaged)
Seems like a good thing to add.
Cc: tfarina@chromium.org
Do we make this a special variable in GN or a function (like cmake_minimum_required in CMake)?


Comment 4 by thakis@chromium.org, Jun 23 2017

cmake_minimium_version controls the min cmake version, not the min ninja version.

gn should just hardcode the ninja version it requires (1.5 or when pools were added).
The simplest (and bad) way seems to hard code it (like Meson, but the fact it does is irrelevant).

https://chromium-review.googlesource.com/546475
The reference to cmake_minimu_version was just about the syntax. I know it controls the version of CMake :)
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/188307cee04070a6164db1c31aa06de7d0290ae6

commit 188307cee04070a6164db1c31aa06de7d0290ae6
Author: Thiago Farina <tfarina@chromium.org>
Date: Mon Jun 26 23:49:23 2017

tools/gn: write out the required version of ninja

Write to the build.ninja file the required version of Ninja
to avoid problems like the one that happended in
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiFsmWqyHnriH3eFB%2BmQ_CXs1qSTKSaP4fv3GQYf3Zr63Q%40mail.gmail.com?utm_medium=email&utm_source=footer

BUG= 732518 

Change-Id: Ief55a93798de15fa5fae0b74db6ab7c4c844e5aa
Reviewed-on: https://chromium-review.googlesource.com/546475
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Thiago Farina <tfarina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482469}
[modify] https://crrev.com/188307cee04070a6164db1c31aa06de7d0290ae6/tools/gn/ninja_build_writer.cc

Comment 8 by thakis@chromium.org, Jun 26 2017

Thanks for the fix. However, the person on the thread was using 1.3.4, so requiring 1.1.0 probably isn't enough; gn must depend on something newer.
I was thinking the same thing and waiting for you to comment on the review, but you didn't.
Cc: -tfarina@chromium.org
Owner: tfarina@chromium.org
Status: Started (was: Available)
Pools were added at 1.1.0. 1.5 is fine by you Nico? Otherwise let me know which version you want to be picked.
I was neither cc'd nor listed as reviewer on the review, so I wonder how you think I should've commented on it :-)

The mail mentions "ninja: error: toolchain.ninja:1292: unknown pool name". Looking at around that line in my local toolchain.ninja, it has

  pool = console

Console pools were added in 1.5.1 (https://groups.google.com/forum/#!topic/ninja-build/3DLt4mC4e1Y/discussion), so at least that.

Other options: Pools didn't work quite right before 1.6.0 (https://github.com/ninja-build/ninja/issues/959), so maybe 1.6.0.

And since using anything older than what's in depot_tools is incorrect, using 1.7.2 would be an option too.
Because I posted a link to the review at comment #5, but let's move on :)

I will copy it there this time, so you can comment/review if you want.

The mail mentions "ninja: error: toolchain.ninja:1292: unknown pool name".

My preference is for 1.7.2, for the reasons you outlined here, so I picked
that.

https://chromium-review.googlesource.com/550077
Project Member

Comment 14 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4a581dfb4b77eda8fb98b6434a325dec7ff00417

commit 4a581dfb4b77eda8fb98b6434a325dec7ff00417
Author: Thiago Farina <tfarina@chromium.org>
Date: Fri Jun 30 02:45:41 2017

tools/gn: require a newer version of ninja

Requiring 1.1.0 is not enough because console pools are needed,
and it was added only in 1.5.1.

But pools did not work quite right until 1.6.0, but since using
anything other than what is in depot_tools currently is not
correct, and the current version of ninja binary there is 1.7.2,
picked that one now.

BUG= 732518 

Change-Id: I7b4af6f16166145fb88255d2ad6018a07d0569c8
Reviewed-on: https://chromium-review.googlesource.com/550077
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Thiago Farina <tfarina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483600}
[modify] https://crrev.com/4a581dfb4b77eda8fb98b6434a325dec7ff00417/tools/gn/ninja_build_writer.cc

Status: Fixed (was: Started)

Sign in to add a comment