mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 16:04:53 +00:00
Revert "[build] Don't combine stdout and stderr when consuming git output."
This reverts commit 1ac8b374a2
.
Reason for revert: Broken debianpackage bot https://ci.chromium.org/p/dart-internal/builders/ci/debianpackage-linux-main/4682
Original change's description:
> [build] Don't combine stdout and stderr when consuming git output.
>
> When the alternate objects path is broken, `git log -n1 --pretty=format:%cd` will output `error: unable to normalize alternate object path: .git/objects/no/such/path` to stderr, and we don't want this mixed into the version string.
>
> Bug: https://github.com/flutter/flutter/issues/123416
> Change-Id: Ief03e57febd5a42f5cbba2b14a736d949a90ae82
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291050
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
Bug: https://github.com/flutter/flutter/issues/123416
Change-Id: If100a66a7b94a2c540aa9e4f28902ce6f6ab8d64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291056
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
parent
755432f73e
commit
7aaad727fa
|
@ -500,13 +500,11 @@ def GetGitRevision(git_revision_file=None, repo_path=DART_DIR):
|
|||
pass
|
||||
p = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=IsWindows(),
|
||||
cwd=repo_path)
|
||||
out, err = p.communicate()
|
||||
if p.wait() != 0:
|
||||
raise Exception('git rev-parse failed: ' + str(err))
|
||||
revision = out.decode('utf-8').strip()
|
||||
output, _ = p.communicate()
|
||||
revision = output.decode('utf-8').strip()
|
||||
# We expect a full git hash
|
||||
if len(revision) != 40:
|
||||
print('Warning: Could not parse git commit, output was {}'.format(
|
||||
|
@ -519,13 +517,13 @@ def GetGitRevision(git_revision_file=None, repo_path=DART_DIR):
|
|||
def GetShortGitHash(repo_path=DART_DIR):
|
||||
p = subprocess.Popen(['git', 'rev-parse', '--short=10', 'HEAD'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=IsWindows(),
|
||||
cwd=repo_path)
|
||||
out, err = p.communicate()
|
||||
output, _ = p.communicate()
|
||||
revision = output.decode('utf-8').strip()
|
||||
if p.wait() != 0:
|
||||
raise Exception('git rev-parse failed: ' + str(err))
|
||||
revision = out.decode('utf-8').strip()
|
||||
return None
|
||||
return revision
|
||||
|
||||
|
||||
|
@ -542,16 +540,16 @@ def GetLatestDevTag(repo_path=DART_DIR):
|
|||
]
|
||||
p = subprocess.Popen(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=IsWindows(),
|
||||
cwd=repo_path)
|
||||
out, err = p.communicate()
|
||||
output, _ = p.communicate()
|
||||
tag = output.decode('utf-8').strip()
|
||||
if p.wait() != 0:
|
||||
print('Warning: Could not get the most recent dev branch tag {}'.format(
|
||||
tag),
|
||||
file=sys.stderr)
|
||||
return None
|
||||
tag = out.decode('utf-8').strip()
|
||||
return tag
|
||||
|
||||
|
||||
|
@ -566,26 +564,24 @@ def GetGitTimestamp(git_timestamp_file=None, repo_path=DART_DIR):
|
|||
pass
|
||||
p = subprocess.Popen(['git', 'log', '-n', '1', '--pretty=format:%cd'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=IsWindows(),
|
||||
cwd=repo_path)
|
||||
out, err = p.communicate()
|
||||
output, _ = p.communicate()
|
||||
timestamp = output.decode('utf-8').strip()
|
||||
if p.wait() != 0:
|
||||
raise Exception('git log failed: ' + str(err))
|
||||
timestamp = out.decode('utf-8').strip()
|
||||
return None
|
||||
return timestamp
|
||||
|
||||
|
||||
def GetGitNumber(repo_path=DART_DIR):
|
||||
p = subprocess.Popen(['git', 'rev-list', 'HEAD', '--count'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=IsWindows(),
|
||||
cwd=repo_path)
|
||||
out, err = p.communicate()
|
||||
if p.wait() != 0:
|
||||
raise Exception('git rev-list failed: ' + str(err))
|
||||
number = out.decode('utf-8').strip()
|
||||
output, _ = p.communicate()
|
||||
number = output.decode('utf-8').strip()
|
||||
try:
|
||||
number = int(number)
|
||||
return number + GIT_NUMBER_BASE
|
||||
|
|
Loading…
Reference in a new issue