commit | 2bce9a0360673151bc2db0fc67db200d610a5c03 | [log] [tgz] |
---|---|---|
author | Oliver Newman <olivernewman@google.com> | Thu Feb 04 09:40:36 2021 -0500 |
committer | Oliver Newman <olivernewman@google.com> | Thu Feb 04 09:43:03 2021 -0500 |
tree | 568f63315507ec984d7e930e55bcc3a783d3318b | |
parent | c4d44a075e0d510da9717fdcad66d6c9e8f2b2b3 [diff] |
Update pyoxidizer.bzl For compatibility with the latest version of Pyoxidizer. Unfortunately, Pyoxidizer is unable to produce a working executable for the latest version of Black, because Black recently started using multiprocessing to format multiple files in parallel, and Pyoxidizer doesn't currently work with code that uses multiprocessing: https://github.com/indygreg/PyOxidizer/issues/111 Change-Id: I6cdf729486efb4d367afa57efe068de534ea356b
This contains configuration useful in updating the black package in CIPD.
We want this to run in the following environments:
At time of writing, binaries built on gLinux did not work on our GCE Swarming bots. In order to work on both GCE and gLinux workstations, I found that the following procedure works when run from a GCE VM that is using the same image as our swarming bots. You can ask the foundation infra team how to create a VM for this if you don't know how.
In order to produce a binary that works on MacOS, I ran these commands on MacOS.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install pyoxidizer
BLACK_VERSION=$(pip3 install black== 2>&1 | grep versions: | sed -E 's/.*, ([a-z0-9\.]+)\)/\1/') # We have to specify a back-up to make this work on both Linux and MacOS: # https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux sed -E -e "s/black==[^\"]+\"/black==${BLACK_VERSION?}\"/" -i.bak ./pyoxidizer.bzl rm ./pyoxidizer.bzl.bak pyoxidizer build install OS=$(if [[ $(uname) == 'Darwin' ]]; then echo 'mac'; else echo 'linux'; fi) cipd create -tag version:${BLACK_VERSION?} -pkg-def ./cipd-${OS?}.yaml