From c23b753a746caf611cdc3d3950bd57756211bc29 Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Sun, 16 Apr 2017 16:04:59 -0400 Subject: [PATCH 1/2] Test packaging during normal builds --- etc/ci/buildbot_steps.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index 74f999a7ce5..f3ff1077473 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -17,6 +17,7 @@ mac-rel-wpt2: mac-dev-unit: - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit + - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --dev - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef - ./mach build-geckolib - bash ./etc/ci/lockfile_changed.sh @@ -49,6 +50,7 @@ linux-dev: - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-compiletest - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit + - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --dev - env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef - ./mach build-geckolib - ./mach test-stylo @@ -103,6 +105,7 @@ arm64: windows-msvc-dev: - mach.bat build --dev - mach.bat test-unit + - mach.bat package --dev - mach.bat build-geckolib windows-msvc-nightly: From 0730888fbe26c133c3c9e8b013a46c2cd5e59a8c Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Mon, 17 Apr 2017 20:39:41 -0400 Subject: [PATCH 2/2] Stop segfaulting at the end of mach bootstrap `mach bootstrap` will finish succesfully, but then segfault inside glibc while exiting. It seems to have to do with the MarkupSafe library used by Mako; delaying the Mako import from the top level to inside functions where it is used avoids the problem. (It seems to interact with the call to pip to install the Salt requirements in the virtualenv, as commenting that pip call out separately will also fix the segfault.) Also, use the Mako installed in the Python virtualenv while running packaging commands (instead of the one from the bundled zip file), and cleanup imports in the package_commands.py file. --- python/servo/package_commands.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 2551844e4b5..68569838c4c 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -9,36 +9,30 @@ from __future__ import print_function, unicode_literals -import sys -import os.path as path -sys.path.append(path.join(path.dirname(sys.argv[0]), "components", "style", "properties", "Mako-0.9.1.zip")) - import json import os +import os.path as path import shutil import subprocess -import mako.template - -from mach.registrar import Registrar from mach.decorators import ( CommandArgument, CommandProvider, Command, ) - -from mako.template import Template +from mach.registrar import Registrar +# Note: mako cannot be imported at the top level because it breaks mach bootstrap from servo.command_base import ( archive_deterministically, BuildNotFound, cd, CommandBase, + find_dep_path_newest, is_macosx, is_windows, get_browserhtml_path, ) -from servo.command_base import find_dep_path_newest def delete(path): @@ -221,6 +215,7 @@ class PackageCommands(CommandBase): raise Exception("Error occurred when getting Servo version: " + stderr) version = "Nightly version: " + version + import mako.template template_path = path.join(dir_to_resources, 'Credits.rtf.mako') credits_path = path.join(dir_to_resources, 'Credits.rtf') with open(template_path) as template_file: @@ -299,8 +294,9 @@ class PackageCommands(CommandBase): change_prefs(dir_to_resources, "windows") # generate Servo.wxs + import mako.template template_path = path.join(dir_to_root, "support", "windows", "Servo.wxs.mako") - template = Template(open(template_path).read()) + template = mako.template.Template(open(template_path).read()) wxs_path = path.join(dir_to_msi, "Servo.wxs") open(wxs_path, "w").write(template.render( exe_path=target_dir,