New issue
Advanced search Search tips

Issue 596072 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

rebase_path returns invalid path for some Windows-style absolute paths

Project Member Reported by tmonius...@opera.com, Mar 18 2016

Issue description

Running this GN code:

  rebased_path = rebase_path("/E:/foo/bar", root_build_dir)
  print(rebased_path)

gives following output:

  ../../../../../../E:/foo/bar

This path is not valid because "E:" cannot be placed in the middle of the path.

Above code doesn't work if gn is run from Git Bash. On the other hand rebase_path("/e:/foo/bar", root_build_dir) fails if gn is run from Windows cmd.exe (and surprisingly enough from Git Bash on some Windows 10 machines).

The root cause is that Setup::FillSourceDir() uses either capital ("E:") or non-capital ("e:") drive letter, depending on how gn is being run. It doesn't matter for the build unless rebase_path() with absolute-path input is used.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 22 2016

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

commit 01a402cd6fb6873e61d2faa269b6b991d307635e
Author: tmoniuszko <tmoniuszko@opera.com>
Date: Tue Mar 22 08:30:14 2016

Make rebase_path() aware of Windows drive letter capitalization

Make sure rebase_path() supports both capital and non-capital Windows path
drive letters. It's unable to find common path prefix otherwise.

BUG= 596072 

Review URL: https://codereview.chromium.org/1817533002

Cr-Commit-Position: refs/heads/master@{#382532}

[modify] https://crrev.com/01a402cd6fb6873e61d2faa269b6b991d307635e/tools/gn/filesystem_utils.cc
[modify] https://crrev.com/01a402cd6fb6873e61d2faa269b6b991d307635e/tools/gn/filesystem_utils_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment