Commit aa14b13f authored by Marco Clemencic's avatar Marco Clemencic
Browse files

lb-dev: add support for configured platform to "run" script

and fixed CMT support
parent 01eba2d3
Pipeline #1508649 passed with stages
in 3 minutes and 1 second
......@@ -145,7 +145,7 @@ def main():
localNightlyHelp(
parser.prog or os.path.basename(sys.argv[0]), args.nightly,
project, args.platform
if args.platform not in ('best', None) else '$CMTCONFIG',
if args.platform not in ('best', None) else '$BINARY_TAG',
sys.argv[1:]))
sys.exit(64)
if args.help_nightly_local:
......@@ -158,8 +158,8 @@ def main():
InvalidNightlySlotError(args.nightly[0], args.nightly[1],
[]),
project,
args.platform
if args.platform not in ('best', None) else '$CMTCONFIG', [
args.platform if args.platform not in ('best', None) else
'$BINARY_TAG', [
a for a in sys.argv[1:]
if not '--help-nightly-local'.startswith(a)
],
......@@ -229,7 +229,7 @@ def main():
if not use_cmake and not use_cmt:
logging.error('neither CMake nor CMT configuration found '
'(are you using the right CMTCONFIG?)')
'(are you using the right BINARY_TAG?)')
exit(1)
except SystemExit as err:
if args.nightly:
......@@ -242,7 +242,7 @@ def main():
InvalidNightlySlotError(args.nightly[0],
args.nightly[1], []), project,
args.platform if args.platform not in ('best', None)
else '$CMTCONFIG', sys.argv[1:]))
else '$BINARY_TAG', sys.argv[1:]))
except ImportError:
# old version of LbEnv
# (before https://gitlab.cern.ch/lhcb-core/LbEnv/merge_requests/19)
......
#!/bin/sh
build_tool=${build_tool}
root_dir=$$(dirname $$0)
if [ -z "$$CMTCONFIG" ] ; then
echo "error: CMTCONFIG not defined"
# Get build configuration parameters
. $${root_dir}/build.conf
if [ -z "$${BINARY_TAG}" ] ; then
export BINARY_TAG=$${CMTCONFIG:-$${platform}}
fi
if [ -z "$${CMTCONFIG}" ] ; then
export CMTCONFIG=$${BINARY_TAG:-$${platform}}
fi
if [ "$${BINARY_TAG}" != "$${CMTCONFIG}" ] ; then
echo "error: invalid environment: inconsistent values for BINARY_TAG and CMTCONFIG"
exit 1
fi
if [ "$build_tool" = "cmake" ] ; then
run_cmd=$$(dirname $$0)/build.$$CMTCONFIG/run
if [ -e "$$run_cmd" ] ; then
exec $$run_cmd "$$@"
else
echo "error: cannot find build.$$CMTCONFIG/run, did you build?"
if [ "$$build_tool" = "cmake" ] ; then
run_cmd=$${root_dir}/build.$$BINARY_TAG/run
if [ ! -e "$$run_cmd" ] ; then
echo "error: cannot find build.$$BINARY_TAG/run, did you build?"
exit 1
fi
else
curdir=$$(pwd)
cd $$(dirname $$0)
. ./build_env.sh
cd $$curdir
. SetupProject.sh --keep-CMTPROJECTPATH --user $$(cd $$(dirname $$0)/.. ; pwd) ${cmt_project}
if [ "$$SetupProjectStatus" = 0 ] ; then
[ "$$#" = 0 ] && (printenv | sort) || exec "$$@"
else
exit $$SetupProjectStatus
cd $${root_dir}
if [ -r ./build_env.sh ] ; then
. ./build_env.sh
fi
cd $$curdir
run_cmd="lb-run --user-area $$(cd $${root_dir}/.. ; pwd) ${cmt_project}"
fi
exec $$run_cmd "$$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment