-
Notifications
You must be signed in to change notification settings - Fork 6k
fix gclient runhooks for windows #20014
Conversation
f236415
to
ccc65e0
Compare
tools/run_third_party_dart.py
Outdated
subprocess.call(["src/third_party/dart/tools/sdks/dart-sdk/bin/pub", "global", "run", "generate_package_config:generate_from_legacy", "src/flutter/tools/const_finder/.packages"]) | ||
pub = "src/third_party/dart/tools/sdks/dart-sdk/bin/pub" | ||
if os.name == "nt": | ||
pub = "src/third_party/dart/tools/sdks/dart-sdk/bin/pub.bat" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I just tried this on my local Windows box and it only seems to work with backslashes, like:
subprocess.call(["bin\\cache\\dart-sdk\\bin\\pub.bat"])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was working for several weeks when I was using dart pub
on windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switched to backslashes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use os.path.join
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then you can just conditionally define a string called BAT
based on whether it's nt and append that to the output of path.join.
tools/run_third_party_dart.py
Outdated
pub = "src/third_party/dart/tools/sdks/dart-sdk/bin/pub" | ||
if os.name == "nt": | ||
pub = "src/third_party/dart/tools/sdks/dart-sdk/bin/pub.bat" | ||
subprocess.call([pub, "global", "activate", "-spath", "./src/flutter/tools/generate_package_config"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use subprocess.check_call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit
runhooks passed on windows, landing |
Description
pub is pub.bat on windows