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

Issue 661054 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

gn should warn on multiple toolchains with the same root_out_dir

Project Member Reported by thakis@chromium.org, Nov 1 2016

Issue description

In  bug 660857 , two different gn toolchains ended up with the same name. gn wrote both to the same directory, clobbering the files of one with the files of the other. ninja's -w dupbuild did warn and, on some bots, error about this, which allowed us to find this. It'd be nicer if gn could check if two toolchains it writes out have the same name at gn time though.
 
Cc: brettw@chromium.org
Components: Build
Labels: OS-All
Status: Available (was: Untriaged)
Summary: gn should warn on multiple toolchains with the same root_out_dir (was: gn should warn on multiple toolchains with the same name)
The toolchains have different GN labels, but they end up writing into the same root_out_dir, since the root_out_dir is based off of just the label name and doesn't include the dir. Changing the subject from "same name" to "same root_out_dir" accordingly.
Owner: thakis@chromium.org
Status: Started (was: Available)
https://codereview.chromium.org/2483713003/
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 8 2016

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

commit eab6e2d58dc3b71e094ff58d822980ca3473caf8
Author: thakis <thakis@chromium.org>
Date: Tue Nov 08 01:44:32 2016

gn: Diag on distinct toolchains with the same name.

Previously, toolchains with the same name used to silently write to the same output
directory and clobber each others generated .ninja files.  After this patch, this still
happens, but gn writes an error message while writing the final build.ninja file.

Example output:
ERROR at //build/toolchain/mac2/BUILD.gn:51:3: Duplicate toolchain.
  toolchain(target_name) {
  ^-----------------------
Two or more toolchains write to the same directory:
  //out/gn1/clang_x64/

This can be fixed by making sure that distinct toolchains have
distinct names.

See //build/toolchain/mac3/BUILD.gn:51:3: Previous toolchain.
  toolchain(target_name) {
  ^-----------------------

Depends on https://codereview.chromium.org/2485523002/

BUG= 661054 

Review-Url: https://codereview.chromium.org/2483713003
Cr-Commit-Position: refs/heads/master@{#430473}

[modify] https://crrev.com/eab6e2d58dc3b71e094ff58d822980ca3473caf8/tools/gn/ninja_build_writer.cc
[modify] https://crrev.com/eab6e2d58dc3b71e094ff58d822980ca3473caf8/tools/gn/ninja_build_writer.h

Status: Fixed (was: Started)

Sign in to add a comment