diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | automation/taskcluster/graph/src/extend.js | 4 | ||||
-rwxr-xr-x | automation/taskcluster/scripts/run_tests.sh | 2 | ||||
-rwxr-xr-x | build.sh | 36 | ||||
-rw-r--r-- | coreconf/config.gypi | 6 | ||||
-rw-r--r-- | coreconf/pkg_config.py | 2 | ||||
-rwxr-xr-x | tests/run.sh | 9 |
7 files changed, 37 insertions, 26 deletions
@@ -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 @@ -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 |