summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2016-11-04 08:06:00 +0100
committerTim Taubert <ttaubert@mozilla.com>2016-11-04 08:06:00 +0100
commit405290410e43f58aa2011cb44d8202d76751cb31 (patch)
tree326f120774d357860b189ad632a6d26bb653ac4a
parent8fce37ee6ee6c3ef20af8444deb314e95616eff0 (diff)
downloadnss-hg-405290410e43f58aa2011cb44d8202d76751cb31.tar.gz
Bug 1312439 - Don't determine $OBJDIR using "make platform" r=franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D18
-rw-r--r--Makefile4
-rw-r--r--automation/taskcluster/graph/src/extend.js4
-rwxr-xr-xautomation/taskcluster/scripts/run_tests.sh2
-rwxr-xr-xbuild.sh36
-rw-r--r--coreconf/config.gypi6
-rw-r--r--coreconf/pkg_config.py2
-rwxr-xr-xtests/run.sh9
7 files changed, 37 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index 69b66368e..3c287286f 100644
--- a/Makefile
+++ b/Makefile
@@ -126,7 +126,7 @@ else
NSPR_PREFIX = $$(topsrcdir)/../dist/$(OBJDIR_NAME)
endif
-ifndef NSS_GYP
+ifndef NSS_GYP_PREFIX
$(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
@@ -140,7 +140,7 @@ $(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE)
cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \
$(NSPR_CONFIGURE_ENV) sh ../configure \
$(NSPR_CONFIGURE_OPTS) \
- --prefix='$(NSPR_PREFIX)'
+ --prefix='$(NSS_GYP_PREFIX)'
endif
build_nspr: $(NSPR_CONFIG_STATUS)
diff --git a/automation/taskcluster/graph/src/extend.js b/automation/taskcluster/graph/src/extend.js
index 38462030f..a33fb62a2 100644
--- a/automation/taskcluster/graph/src/extend.js
+++ b/automation/taskcluster/graph/src/extend.js
@@ -104,7 +104,6 @@ export default async function main() {
"-c",
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh"
],
- env: {USE_64: "1"}, // This is only necessary for tests to work.
platform: "linux64",
collection: "gyp",
image: LINUX_IMAGE
@@ -240,8 +239,7 @@ async function scheduleFuzzing() {
ASAN_OPTIONS: "allocator_may_return_null=1",
UBSAN_OPTIONS: "print_stacktrace=1",
CC: "clang",
- CCC: "clang++",
- USE_64: "1" // This is only necessary for tests to work.
+ CCC: "clang++"
},
platform: "linux64",
collection: "fuzz",
diff --git a/automation/taskcluster/scripts/run_tests.sh b/automation/taskcluster/scripts/run_tests.sh
index 4c87e7e32..fc0bb87ab 100755
--- a/automation/taskcluster/scripts/run_tests.sh
+++ b/automation/taskcluster/scripts/run_tests.sh
@@ -14,4 +14,4 @@ fi
fetch_dist
# Run tests.
-cd nss/tests && ./all.sh
+cd nss/tests && ./run.sh
diff --git a/build.sh b/build.sh
index 31b5d7b88..8bc55940c 100755
--- a/build.sh
+++ b/build.sh
@@ -73,17 +73,6 @@ while [ $# -gt 0 ]; do
shift
done
-# set paths
-cwd=$(cd $(dirname $0); pwd -P)
-obj_dir=$(USE_64=$build_64 make -s -C "$cwd" platform)
-dist_dir="$cwd/../dist/$obj_dir"
-
-# -c = clean first
-if [ "$clean" = 1 ]; then
- rm -rf "$cwd/out"
- rm -rf "$cwd/../nspr/$obj_dir"
-fi
-
if [ "$opt_build" = "1" ]; then
target=Release
else
@@ -95,8 +84,29 @@ if [ "$build_64" == "1" ]; then
else
gyp_params+=(-Dtarget_arch=ia32)
fi
+
+# set paths
+cwd=$(cd $(dirname $0); pwd -P)
+dist_dir="$cwd/../dist"
target_dir="$cwd/out/$target"
+# get the realpath of $dist_dir
+dist_dir=$(mkdir -p $dist_dir; cd $dist_dir; pwd -P)
+
+# save the chosen target
+echo $target > $dist_dir/latest
+
+# get object directory
+obj_dir="$dist_dir/$target"
+gyp_params+=(-Dnss_dist_dir=$dist_dir)
+gyp_params+=(-Dnss_dist_obj_dir=$obj_dir)
+
+# -c = clean first
+if [ "$clean" = 1 ]; then
+ rm -rf "$cwd/out"
+ rm -rf "$cwd/../nspr/$target"
+fi
+
# figure out the scan-build string
if [ "${#scanbuild[@]}" -gt 0 ]; then
if [ -n "$CC" ]; then
@@ -111,10 +121,10 @@ if [ "${#scanbuild[@]}" -gt 0 ]; then
# Force a redo with -g.
if [ "$rebuild_gyp" = 1 -o ! -d "$target_dir" ]; then
# Build NSPR.
- make "${nspr_env[@]}" -C "$cwd" NSS_GYP=1 install_nspr
+ make "${nspr_env[@]}" -C "$cwd" NSS_GYP_PREFIX=$obj_dir install_nspr
# Run gyp.
- PKG_CONFIG_PATH="$cwd/../nspr/$obj_dir/config" \
+ PKG_CONFIG_PATH="$obj_dir/lib/pkgconfig" \
"${scanbuild[@]}" gyp -f ninja "${gyp_params[@]}" --depth="$cwd" \
--generator-output="." "$cwd/nss.gyp"
fi
diff --git a/coreconf/config.gypi b/coreconf/config.gypi
index 3f0b16d51..b138776f2 100644
--- a/coreconf/config.gypi
+++ b/coreconf/config.gypi
@@ -30,8 +30,6 @@
#XXX: gyp breaks if these are empty!
'nspr_lib_dir%': ' ',
'nspr_include_dir%': ' ',
- 'nss_dist_obj_dir%': ' ',
- 'nss_dist_dir%': ' ',
'zlib_libs%': [],
#TODO
'moz_debug_flags%': '',
@@ -41,8 +39,6 @@
'nspr_libs%': ['-lplds4', '-lplc4', '-lnspr4'],
'nspr_lib_dir%': '<!(<(python) <(DEPTH)/coreconf/pkg_config.py . --libs nspr)',
'nspr_include_dir%': '<!(<(python) <(DEPTH)/coreconf/pkg_config.py . --cflags nspr)',
- 'nss_dist_obj_dir%': '<!(<(python) <(DEPTH)/coreconf/pkg_config.py ../.. --cflags nspr)',
- 'nss_dist_dir%': '<!(<(python) <(DEPTH)/coreconf/pkg_config.py ../../.. --cflags nspr)',
'use_system_zlib%': 1,
}],
['OS=="linux" or OS=="android"', {
@@ -84,8 +80,6 @@
'nspr_libs%': ['<@(nspr_libs)'],
'nspr_lib_dir%': '<(nspr_lib_dir)',
'nspr_include_dir%': '<(nspr_include_dir)',
- 'nss_dist_obj_dir%': '<(nss_dist_obj_dir)',
- 'nss_dist_dir%': '<(nss_dist_dir)',
'use_system_sqlite%': '<(use_system_sqlite)',
'sqlite_libs%': ['-lsqlite3'],
'dll_prefix': '<(dll_prefix)',
diff --git a/coreconf/pkg_config.py b/coreconf/pkg_config.py
index d718de011..66097422d 100644
--- a/coreconf/pkg_config.py
+++ b/coreconf/pkg_config.py
@@ -17,7 +17,7 @@ def main():
elif sys.argv[2] == '--cflags':
part_prefix = '-I'
else:
- raise 'Specify either --libs or --cflags as the second argument.'
+ raise Exception('Specify either --libs or --cflags as the second argument.')
try:
process = subprocess.Popen(['pkg-config'] + sys.argv[2:], stdout=stdout, stderr=open(os.devnull, 'wb'))
diff --git a/tests/run.sh b/tests/run.sh
new file mode 100755
index 000000000..cbe9c47ae
--- /dev/null
+++ b/tests/run.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+base=$(dirname $0)
+
+# Determine path to build target.
+obj_dir=$(cat $base/../../dist/latest 2>/dev/null)
+
+# Run tests.
+OBJDIR=$obj_dir $base/all.sh