Convert python-2.7.15.amd64.msi to a ZIP file, for generic-worker mount

This commit is contained in:
Simon Sapin 2018-09-30 23:54:51 +02:00
parent f9038a78df
commit 522445f609
2 changed files with 101 additions and 2 deletions

View file

@ -30,6 +30,7 @@ def main():
ping_on_daily_task_failure = "SimonSapin, nox, emilio"
build_artifacts_expiry = "1 week"
build_dependencies_artifacts_expiry = "1 month"
log_artifacts_expiry = "1 year"
build_env = {
@ -96,12 +97,20 @@ def android_arm32():
def windows_dev():
python27_task = extract_msi(
"https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi",
sha256="5e85f3c4c209de98480acbf2ba2e71a907fd5567a838ad4b6748c76deb286ad7",
)
return decision.create_task(
task_name="Windows x86_64: clone only",
task_name="Windows x86_64: clone only (for now)",
worker_type="servo-win2016",
# script="""
# python mach --help
# """,
script="""
dir
python -c "import sys; print(sys.path)"
""",
with_repo=False,
mounts=[
{
"directory": "git",
@ -112,10 +121,20 @@ def windows_dev():
"sha256": "424d24b5fc185a9c5488d7872262464f2facab4f1d4693ea8008196f14a3c19b",
}
},
{
"directory": "python2",
"format": "tar.gz",
"content": {
"artifact": "public/extracted.tar.gz",
"taskId": python27_task,
}
},
],
homedir_path=[
"git\\cmd",
"python2",
],
dependencies=[python27_task],
**build_kwargs
)
@ -238,6 +257,38 @@ def daily_tasks_setup():
decision.task_name_template = "Servo daily: %s. On failure, ping: " + ping_on_daily_task_failure
def extract_msi(url, sha256):
return decision.find_or_create_task(
index_bucket="extract-msi.v4",
index_key=sha256,
index_expiry=build_dependencies_artifacts_expiry,
task_name="Extracting MSI file " + url,
dockerfile=dockerfile_path("msiextract"),
script="""
curl --retry 5 --connect-timeout 10 --location --fail "$MSI_URL" -o input.msi
echo "$EXPECTED_SHA256 input.msi" | sha256sum --check
msiextract input.msi -C output
# May contains directories with names too long for Windows to even create:
# https://gitlab.gnome.org/GNOME/msitools/issues/5
rm -rf output/Windows/winsxs
ls output/
tar -czf /extracted.tar.gz -C output .
""",
env={
"MSI_URL": url,
"EXPECTED_SHA256": sha256,
},
artifacts=[
"/extracted.tar.gz"
],
max_run_time_minutes=20,
with_repo=False,
)
def dockerfile_path(name):
return os.path.join(os.path.dirname(__file__), "docker", name + ".dockerfile")
@ -246,6 +297,7 @@ decision = DecisionTask(
task_name_template="Servo: %s",
index_prefix="project.servo.servo",
default_worker_type="servo-docker-worker",
docker_image_cache_expiry=build_dependencies_artifacts_expiry,
)
# https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/caches

View file

@ -0,0 +1,47 @@
# Build a version of libgcal that includes commit
# https://gitlab.gnome.org/GNOME/gcab/commit/3365b4bd58dd7f13e786caf3c7234cf8116263d9
# which fixes "Invalid cabinet chunk" errors:
# https://gitlab.gnome.org/GNOME/msitools/issues/4#note_336695
FROM ubuntu:bionic-20180821
RUN \
apt-get update -q && \
apt-get install -qy --no-install-recommends \
curl \
ca-certificates \
#
# Build dependencies for libgcab
meson \
git \
pkg-config \
libc6-dev \
libglib2.0-dev \
libgirepository1.0-dev \
gobject-introspection \
valac \
intltool \
&& \
export REV=3365b4bd58dd7f13e786caf3c7234cf8116263d9 && \
curl -L https://gitlab.gnome.org/GNOME/gcab/-/archive/$REV/gcab-$REV.tar.gz | tar -xz && \
mv gcab-$REV gcab && \
cd gcab && \
meson build && \
cd build && \
# UTF-8 locale to work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870310
export LANG=C.UTF-8 && \
ninja && \
cp -v libgcab/libgcab* /usr/local/lib
# FIXME: uncomment this after we upgrade docker-worker
# to a version of Docker that supports multi-stage builds:
# # Start a new image without the build dependencies, only the compiled library
# FROM ubuntu:bionic-20180821
# COPY --from=0 /usr/local/lib/libgcab* /usr/local/lib/
RUN \
apt-get update -q && \
apt-get install -qy --no-install-recommends \
curl \
ca-certificates \
msitools