• Elly Fong-Jones's avatar
    depot_tools: bail out if $PATH contains tildes · 7b294392
    Elly Fong-Jones authored
    Bash and its descendants allow having $PATH entries containing literal tildes,
    like:
      ...:~/depot_tools:...
    If the user has their shell configured this way, their shell will be able to
    invoke `fetch` and other depot_tools commands, but depot_tools will not in turn
    be able to invoke subcommands via popen because popen does not have this
    bash-specific behavior when not in shell mode.
    
    This change has gclient detect this configuration problem and error out with a
    descriptive error message. Not doing so leads to a puzzling condition where
    gclient complains about being unable to find a program that (from the user's
    perspective) is in their $PATH and invokable interactively.
    
    It also has 'fetch' suppress its own failure stack trace if it runs gclient and
    gclient fails; the 'fetch' stack trace pushes the messages from gclient (which
    are actually diagnostic) off the screen.
    
    Bug: chromium:952865
    Change-Id: Ibba4d2fccee405aa68392ce141493f1de21ec018
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1573204
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
    7b294392
fetch.py 10 KB