|
|
Created:
6 years, 8 months ago by Primiano Tucci (use gerrit) Modified:
6 years, 8 months ago CC:
chromium-reviews, himanshu.mistri Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionCall install-build-deps.sh from install-build-deps-android.sh
install-build-deps-android.sh relies on the assumption that
install-build-deps.sh has been previously invoked. At this point,
is makes sense for the Android script itself invoking its parent
dependency.
See chromium-dev discussion: http://goo.gl/dKDX3R
BUG=
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261535
Patch Set 1 #Patch Set 2 : Actually, just invoke the full linux deps script #
Total comments: 4
Messages
Total messages: 14 (0 generated)
This shouldn't be necessary, no? It's already in install-build-deps.sh and I don't think it's expected that install-build-deps-android.sh is run *instead* of that. As far as I know Android builds presuppose you are already set up to do LInux builds, and the top of https://code.google.com/p/chromium/wiki/AndroidBuildInstructions says so.
On 2014/04/02 13:45:43, Torne wrote: > This shouldn't be necessary, no? It's already in install-build-deps.sh and I > don't think it's expected that install-build-deps-android.sh is run *instead* of > that. As far as I know Android builds presuppose you are already set up to do > LInux builds, and the top of > https://code.google.com/p/chromium/wiki/AndroidBuildInstructions says so. Yes you may be right that it cover in install-build-deps.sh but if some one follow only https://sites.google.com/a/chromium.org/dev/developers/how-tos/get-the-code and then for android : fetch android --nosvn=True so in that guide there may be happen that we will not run ./build/install-build-deps.sh.
Right, Torne and I just had a discussion offline. Uploaded a 2nd patchset to just invoke the Linux script from the Android one.
Nico, would you mind taking a look to this 2-lines CL? It is to strive to make the Android 1st build smoother. Thanks
lgtm, makes sense, thanks! https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... File build/install-build-deps-android.sh (right): https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... build/install-build-deps-android.sh:21: "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ Is `$(dirname "${0}") enough? It's not like there's several levels of sourcing here.
(maybe reference the chromium-dev thread somewhere in the cl description)
https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... File build/install-build-deps-android.sh (right): https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... build/install-build-deps-android.sh:21: "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ On 2014/04/03 20:19:56, Nico wrote: > Is `$(dirname "${0}") enough? It's not like there's several levels of sourcing > here. I think the difference between $0 vs $BASH_SOURCE is that $BASH_SOURCE is safer, in the sense that it should behave like __file__in python. Essentially, I fear that if you run the script trhough ". install-build-deps.sh" oppposite to "./install... or ./build/install...." that might fail.
https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... File build/install-build-deps-android.sh (right): https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... build/install-build-deps-android.sh:21: "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ On 2014/04/03 20:54:10, Primiano Tucci wrote: > On 2014/04/03 20:19:56, Nico wrote: > > Is `$(dirname "${0}") enough? It's not like there's several levels of sourcing > > here. > > I think the difference between $0 vs $BASH_SOURCE is that $BASH_SOURCE is safer, > in the sense that it should behave like __file__in python. > Essentially, I fear that if you run the script trhough ". install-build-deps.sh" > oppposite to "./install... or ./build/install...." that might fail. We use $0 in a bunch of places, and I never heard of problems like this.
https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... File build/install-build-deps-android.sh (right): https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... build/install-build-deps-android.sh:21: "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ On 2014/04/03 20:58:36, Nico wrote: > On 2014/04/03 20:54:10, Primiano Tucci wrote: > > On 2014/04/03 20:19:56, Nico wrote: > > > Is `$(dirname "${0}") enough? It's not like there's several levels of > sourcing > > > here. > > > > I think the difference between $0 vs $BASH_SOURCE is that $BASH_SOURCE is > safer, > > in the sense that it should behave like __file__in python. > > Essentially, I fear that if you run the script trhough ". > install-build-deps.sh" > > oppposite to "./install... or ./build/install...." that might fail. > > We use $0 in a bunch of places, and I never heard of problems like this. ~ $ cat foo #!/bin/bash echo My dir-1 is $(dirname "${BASH_SOURCE[0]}")/ echo My dir-2 is $(dirname "$0")/ /tmp $ ./foo My dir-1 is ./ My dir-2 is ./ /tmp $ . foo My dir-1 is ./ My dir-2 is /bin/ #Ha wrong /tmp $ /tmp/foo My dir-1 is /tmp/ My dir-2 is /tmp/ /tmp $ . /tmp/foo My dir-1 is /tmp/ My dir-2 is /bin/ # Ha wrong again!!! /tmp $ That's it! I think just nobody complained, but BASH_SOURCE is IMHO actually more reliable. The real question is why we keep writing bash scripts, but that's another story :)
The CQ bit was checked by primiano@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/primiano@chromium.org/222183002/20001
Message was sent while issue was closed.
Change committed as 261535
Message was sent while issue was closed.
On 2014/04/03 21:30:31, Primiano Tucci wrote: > https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... > File build/install-build-deps-android.sh (right): > > https://codereview.chromium.org/222183002/diff/20001/build/install-build-deps... > build/install-build-deps-android.sh:21: "$(dirname > "${BASH_SOURCE[0]}")/install-build-deps.sh" \ > On 2014/04/03 20:58:36, Nico wrote: > > On 2014/04/03 20:54:10, Primiano Tucci wrote: > > > On 2014/04/03 20:19:56, Nico wrote: > > > > Is `$(dirname "${0}") enough? It's not like there's several levels of > > sourcing > > > > here. > > > > > > I think the difference between $0 vs $BASH_SOURCE is that $BASH_SOURCE is > > safer, > > > in the sense that it should behave like __file__in python. > > > Essentially, I fear that if you run the script trhough ". > > install-build-deps.sh" > > > oppposite to "./install... or ./build/install...." that might fail. > > > > We use $0 in a bunch of places, and I never heard of problems like this. > > ~ $ cat foo > #!/bin/bash > echo My dir-1 is $(dirname "${BASH_SOURCE[0]}")/ > echo My dir-2 is $(dirname "$0")/ > > /tmp $ ./foo > My dir-1 is ./ > My dir-2 is ./ > > /tmp $ . foo > My dir-1 is ./ > My dir-2 is /bin/ #Ha wrong > > /tmp $ /tmp/foo > My dir-1 is /tmp/ > My dir-2 is /tmp/ > > /tmp $ . /tmp/foo > My dir-1 is /tmp/ > My dir-2 is /bin/ # Ha wrong again!!! > /tmp $ > > That's it! I think just nobody complained, but BASH_SOURCE is IMHO actually more > reliable. No, that's exactly my point: This script isn't intended to be sourced. > The real question is why we keep writing bash scripts, but that's another story > :) Agreed, but the Real Evil are bash scripts that have to be sourced instead of run (runnable bash scripts can be replaced with python once they get longer). BASH_SOURCE is only useful for sourceable scripts from what I understand. |