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

Issue 623237 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Mac: Use unique output path for compile_xibs template in GN

Project Member Reported by marshall@chromium.org, Jun 24 2016

Issue description

Version: Chromium master revision 318e6f54 (#400326)
OS: Mac

What steps will reproduce the problem?
(1) As part of defining multiple mac_app_bundle targets in the same BUILD.gn file define multiple mac_xib_bundle_data targets that use the same xib file name (see below).

What is the expected output?
The `gn gen` should succeed.

What do you see instead?
The `gn gen` fails due to multiple targets with the same output.

Please use labels and text to provide additional information.

The compile_xibs template currently uses an output path of "$target_gen_dir/{{source_name_part}}.nib". This means the following in the same BUILD.gn file will fail:

mac_xib_bundle_data("app1_xibs") {
  sources = [
    "app1/English.lproj/MainMenu.xib",
  ]

  output_path = "{{bundle_resources_dir}}/English.lproj"
}

mac_xib_bundle_data("app2_xibs") {
  sources = [
    "app2/English.lproj/MainMenu.xib",
  ]

  output_path = "{{bundle_resources_dir}}/English.lproj"
}

The compile_xibs template should probably be modified to use a unique output path. For example:

diff --git a/build/config/mac/base_rules.gni b/build/config/mac/base_rules.gni
index 76610cc..7d17aba 100644
--- a/build/config/mac/base_rules.gni
+++ b/build/config/mac/base_rules.gni
@@ -366,13 +366,13 @@ template("compile_xibs") {
     script = "//build/config/mac/compile_xib.py"
     sources = invoker.sources
     outputs = [
-      "$target_gen_dir/{{source_name_part}}.nib",
+      "$target_gen_dir/$target_name/{{source_name_part}}.nib",
     ]
     args = [
              "--input",
              "{{source}}",
              "--output",
-             rebase_path("$target_gen_dir/{{source_name_part}}.nib"),
+             rebase_path("$target_gen_dir/$target_name/{{source_name_part}}.nib"),
            ] + ibtool_flags
   }
 }
 

Comment 1 by rsesek@chromium.org, Jun 27 2016

Status: Available (was: Untriaged)
That seems reasonable to me. Want to push that up as a CL?
Owner: marshall@chromium.org
Status: Started (was: Available)
CL: https://codereview.chromium.org/2130793003
Project Member

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

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

commit 2b273ced692cd454d1d2b9b6ff8ac9bf97754ce2
Author: marshall <marshall@chromium.org>
Date: Fri Jul 08 16:49:16 2016

Mac: Use unique output path for compile_xibs template in GN

BUG= 623237 
R=rsesek@chromium.org

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

[modify] https://crrev.com/2b273ced692cd454d1d2b9b6ff8ac9bf97754ce2/build/config/mac/base_rules.gni

Comment 4 by rsesek@chromium.org, Jul 11 2016

Status: Fixed (was: Started)

Sign in to add a comment