Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Issue 569343003: Make 'tools/build.py -h' warn the user to run it from the repo root. (Closed)

Created:
6 years, 3 months ago by Nathan Collins
Modified:
6 years, 3 months ago
Reviewers:
ricow1, zra, jwren, Ivan Posva
CC:
reviews_dartlang.org, ricow1, zra
Visibility:
Public.

Description

Make 'tools/build.py -h' warn the user to run it from the repo root. The script by default runs 'make all' in the current directory. Since it's common to have a Makefile with an 'all' rule, this can lead to silent failure when a user runs the script from outside the repo root while intending to do a default build. That behavior is error prone: in my case it made my regression tests pass when they should fail, because I was not actually rebuilding when I thought I was. It turns out that the build script is sometimes run outside the repo root on purpose, so we can't simply require it be run from the repo root. So, we document the relative nature of the build script. R=ricow@google.com, jwren@google.com BUG= https://code.google.com/p/dart/issues/detail?id=20958 Committed: https://code.google.com/p/dart/source/detail?r=40465

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use simpler solution suggested by @zra. #

Total comments: 2

Patch Set 3 : Make fix more conservative: simply fail on wrong cwd. #

Total comments: 1

Patch Set 4 : Revert "quit on wrong CWD" and add warning to help output. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -1 line) Patch
M tools/build.py View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download

Messages

Total messages: 14 (3 generated)
Nathan Collins
6 years, 3 months ago (2014-09-15 20:14:42 UTC) #1
Nathan Collins
Added @zra and @ricow as reviewers per 'git blame' and @jwren suggestion.
6 years, 3 months ago (2014-09-15 20:23:26 UTC) #2
zra
https://codereview.chromium.org/569343003/diff/1/tools/build.py File tools/build.py (right): https://codereview.chromium.org/569343003/diff/1/tools/build.py#newcode519 tools/build.py:519: os.chdir(repo_root) instead maybe: if os.getcwd() != utils.DART_DIR: os.chdir(utils.DART_DIR)
6 years, 3 months ago (2014-09-15 20:31:40 UTC) #4
Nathan Collins
PTAL. https://codereview.chromium.org/569343003/diff/1/tools/build.py File tools/build.py (right): https://codereview.chromium.org/569343003/diff/1/tools/build.py#newcode519 tools/build.py:519: os.chdir(repo_root) On 2014/09/15 20:31:40, zra wrote: > instead ...
6 years, 3 months ago (2014-09-16 01:05:08 UTC) #5
ricow1
https://codereview.chromium.org/569343003/diff/20001/tools/build.py File tools/build.py (right): https://codereview.chromium.org/569343003/diff/20001/tools/build.py#newcode516 tools/build.py:516: os.chdir(utils.DART_DIR) to be nice and change back you could ...
6 years, 3 months ago (2014-09-16 08:11:29 UTC) #7
Nathan Collins
PTAL. Commit message for latest patch set: Make fix more conservative: simply fail on wrong ...
6 years, 3 months ago (2014-09-16 17:38:57 UTC) #8
Ivan Posva
-Ivan https://codereview.chromium.org/569343003/diff/40001/tools/build.py File tools/build.py (right): https://codereview.chromium.org/569343003/diff/40001/tools/build.py#newcode518 tools/build.py:518: if os.path.abspath(utils.DART_DIR) != os.path.abspath(os.getcwd()): This is not entirely ...
6 years, 3 months ago (2014-09-17 03:48:55 UTC) #10
Nathan Collins
On 2014/09/17 03:48:55, Ivan Posva wrote: > -Ivan > > https://codereview.chromium.org/569343003/diff/40001/tools/build.py > File tools/build.py (right): ...
6 years, 3 months ago (2014-09-17 19:31:02 UTC) #11
Nathan Collins
PTAL. I reverted the forced-repo-root-cwd and added a help message.
6 years, 3 months ago (2014-09-17 19:54:23 UTC) #12
ricow1
lgtm
6 years, 3 months ago (2014-09-18 05:45:14 UTC) #13
Nathan Collins
6 years, 3 months ago (2014-09-18 21:22:47 UTC) #14
Message was sent while issue was closed.
Committed patchset #4 manually as 40465 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698