Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1294417 - add gyp builds to linux64-debug TC, r=ttaubert
--HG--
extra : rebase_source : bbd85cbfd718a53c0b69c73c16418f104c532f13
extra : amend_source : ecf4fbc7177e58a4b172cd414eb8752c50a16b64
  • Loading branch information
franziskuskiefer committed Oct 12, 2016
1 parent 9f99504 commit ce56d93
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 31 deletions.
12 changes: 12 additions & 0 deletions Makefile
Expand Up @@ -116,17 +116,29 @@ else
NSPR_PREFIX = $$(topsrcdir)/../dist/$(OBJDIR_NAME)
endif

ifndef NSS_GYP
$(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
$(NSPR_CONFIGURE_ENV) sh ../configure \
$(NSPR_CONFIGURE_OPTS) \
--with-dist-prefix='$(NSPR_PREFIX)' \
--with-dist-includedir='$(NSPR_PREFIX)/include'
else
$(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
$(NSPR_CONFIGURE_ENV) sh ../configure \
$(NSPR_CONFIGURE_OPTS) \
--prefix='$(NSPR_PREFIX)'
endif

build_nspr: $(NSPR_CONFIG_STATUS)
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)

install_nspr: build_nspr
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install

clobber_nspr: $(NSPR_CONFIG_STATUS)
$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber

Expand Down
16 changes: 14 additions & 2 deletions automation/taskcluster/graph/src/extend.js
Expand Up @@ -98,6 +98,18 @@ export default async function main() {
image: LINUX_IMAGE
});

await scheduleLinux("Linux 64 (debug, gyp)", {
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh"
],
env: {USE_64: "1"},
platform: "linux64",
collection: "gyp",
image: LINUX_IMAGE
});

await scheduleLinux("Linux 64 (ASan, debug)", {
env: {
NSS_DISABLE_ARENA_FREE_LIST: "1",
Expand Down Expand Up @@ -137,7 +149,7 @@ export default async function main() {

async function scheduleLinux(name, base) {
// Build base definition.
let build_base = merge(base, {
let build_base = merge({
command: [
"/bin/bash",
"-c",
Expand All @@ -152,7 +164,7 @@ async function scheduleLinux(name, base) {
},
kind: "build",
symbol: "B"
});
}, base);

// The task that builds NSPR+NSS.
let task_build = queue.scheduleTask(merge(build_base, {name}));
Expand Down
7 changes: 5 additions & 2 deletions automation/taskcluster/graph/src/try_syntax.js
Expand Up @@ -22,7 +22,7 @@ function parseOptions(opts) {
}

// Parse platforms.
let allPlatforms = ["linux", "linux64", "linux64-asan", "win64", "arm"];
let allPlatforms = ["linux", "linux64", "linux64-asan", "win64", "arm", "linux64-gyp"];
let platforms = intersect(opts.platform.split(/\s*,\s*/), allPlatforms);

// If the given value is nonsense or "none" default to all platforms.
Expand Down Expand Up @@ -101,6 +101,7 @@ function filter(opts) {
let aliases = {
"linux": "linux32",
"linux64-asan": "linux64",
"linux64-gyp": "linux64",
"win64": "windows2012-64",
"arm": "linux32"
};
Expand All @@ -113,6 +114,8 @@ function filter(opts) {
keep &= coll("asan");
} else if (platform == "arm") {
keep &= coll("arm-opt") || coll("arm-debug");
} else if (platform == "linux64-gyp") {
keep &= coll("gyp");
} else {
keep &= coll("opt") || coll("debug");
}
Expand All @@ -125,7 +128,7 @@ function filter(opts) {
}

// Finally, filter by build type.
let isDebug = coll("debug") || coll("asan") || coll("arm-debug");
let isDebug = coll("debug") || coll("asan") || coll("arm-debug") || coll("gyp");
return (isDebug && opts.builds.includes("d")) ||
(!isDebug && opts.builds.includes("o"));
}
Expand Down
24 changes: 24 additions & 0 deletions automation/taskcluster/scripts/build_gyp.sh
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

source $(dirname $0)/tools.sh

if [[ $(id -u) -eq 0 ]]; then
# Set compiler.
switch_compilers

# Drop privileges by re-running this script.
exec su worker $0
fi

# Clone NSPR if needed.
hg_clone https://hg.mozilla.org/projects/nspr nspr default

# Build.
cd nss && NSS_GYP_GEN=1 ./build.sh
if [ $? != 0 ]; then
exit 1
fi

# Package.
cd .. && mkdir artifacts
tar cvfjh artifacts/dist.tar.bz2 dist
36 changes: 36 additions & 0 deletions build.sh
@@ -0,0 +1,36 @@
#!/bin/bash

CWD="$PWD/$(dirname $0)"
OBJ_DIR="$(make platform)"
DIST_DIR="$CWD/../dist/$OBJ_DIR"

# do NSPR things
NSS_GYP=1 make install_nspr

if [ -z "${USE_64}" ]; then
GYP_PARAMS="-Dtarget_arch=ia32"
fi

# generate NSS build files only if asked for it
if [ -n "${NSS_GYP_GEN}" -o ! -d out/Debug ]; then
PKG_CONFIG_PATH="$CWD/../nspr/$OBJ_DIR/config" gyp -f ninja $GYP_PARAMS --depth=. nss.gyp
fi
# build NSS
# TODO: only doing this for debug build for now
ninja -C out/Debug/
if [ $? != 0 ]; then
exit 1
fi

# sign libs
# TODO: this is done every time at the moment.
cd out/Debug/
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libfreebl3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libfreeblpriv3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libnssdbm3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libsoftokn3.so

# copy files over to the right directory
cp * "$DIST_DIR/bin/"
cp lib/* "$DIST_DIR/lib/"
find . -name "*.a" | xargs cp -t "$DIST_DIR/lib/"
2 changes: 1 addition & 1 deletion external_tests/ssl_gtest/ssl_auth_unittest.cc
Expand Up @@ -201,7 +201,7 @@ TEST_P(TlsConnectTls12, SignatureSchemeCurveMismatch12) {
ssl_sig_ecdsa_secp384r1_sha384);
}

#ifdef NSS_ENABLE_TLS_1_3
#ifndef NSS_DISABLE_TLS_1_3
TEST_P(TlsConnectTls13, SignatureAlgorithmServerUnsupported) {
Reset(TlsAgent::kServerEcdsa256); // P-256 cert
server_->SetSignatureAlgorithms(SignatureEcdsaSha384,
Expand Down
26 changes: 0 additions & 26 deletions tests/all.sh
Expand Up @@ -294,32 +294,6 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ]; then
. ./init.sh
fi

# NOTE:
# Since in make at the top level, modutil is the last file
# created, we check for modutil to know whether the build
# is complete. If a new file is created after that, the
# following test for modutil should check for that instead.
# Exception: when building softoken only, shlibsign is the
# last file created.
if [ "${NSS_BUILD_SOFTOKEN_ONLY}" = "1" ]; then
LAST_FILE_BUILT=shlibsign
else
LAST_FILE_BUILT=modutil
fi

if [ ! -f ${DIST}/${OBJDIR}/bin/${LAST_FILE_BUILT}${PROG_SUFFIX} ]; then
if [ "${NSS_BUILD_UTIL_ONLY}" = "1" ]; then
# Currently no tests are run or built when building util only.
# This may change in the future, atob and bota are
# possible candidates.
echo "No tests were built"
else
echo "Build Incomplete. Aborting test." >> ${LOGFILE}
html_head "Testing Initialization"
Exit "Checking for build"
fi
fi

# NOTE:
# Lists of enabled tests and other settings are stored to ${ENV_BACKUP}
# file and are are restored after every test cycle.
Expand Down

0 comments on commit ce56d93

Please sign in to comment.