Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1312439 - Don't determine $OBJDIR using "make platform" r=franziskus
  • Loading branch information
Tim Taubert committed Nov 4, 2016
1 parent 42da7fe commit bcb1a4c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -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) ; \
Expand All @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions automation/taskcluster/graph/src/extend.js
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion automation/taskcluster/scripts/run_tests.sh
Expand Up @@ -14,4 +14,4 @@ fi
fetch_dist

# Run tests.
cd nss/tests && ./all.sh
cd nss/tests && ./run.sh
36 changes: 23 additions & 13 deletions build.sh
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions coreconf/config.gypi
Expand Up @@ -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%': '',
Expand All @@ -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"', {
Expand Down Expand Up @@ -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)',
Expand Down
2 changes: 1 addition & 1 deletion coreconf/pkg_config.py
Expand Up @@ -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'))
Expand Down
9 changes: 9 additions & 0 deletions 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

0 comments on commit bcb1a4c

Please sign in to comment.