Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cling-cpt] Fixed argument nomenclature [skip-ci] #10936

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions interpreter/cling/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ jobs:
fi
export CLING_BUILD_FLAGS="$CLING_BUILD_FLAGS -DCLANG_ENABLE_ARCMT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DLLVM_ENABLE_WARNINGS=OFF -DCLING_ENABLE_WARNINGS=ON"
if [[ ${{ matrix.name }} == *"compile"* ]]; then
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --cling-branch=${{ github.head_ref }}
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --with-cling-branch=${{ github.head_ref }}
elif [[ ${{ matrix.name }} == *"fromtar"* ]]; then
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --cling-branch=${{ github.head_ref }} --with-binary-llvm --with-llvm-tar
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --with-cling-branch=${{ github.head_ref }} --with-llvm-binary --with-llvm-tar
else
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --cling-branch=${{ github.head_ref }} --with-binary-llvm
python3 cpt.py -y --check-requirements --current-dev=tar --with-cmake-flags="$CLING_BUILD_FLAGS" --with-cling-url=https://github.com/$REPO --with-cling-branch=${{ github.head_ref }} --with-llvm-binary
fi
working-directory: tools/packaging/
- name: Setup tmate session
Expand Down
4 changes: 2 additions & 2 deletions interpreter/cling/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ script:
$TIMEOUTEXE -s SIGTERM $TIMEOUT tools/packaging/cpt.py -y \
--check-requirements \
--current-dev=tar \
--with-binary-llvm \
--with-llvm-binary \
--with-llvm-tar \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
--with-clang-url=http://root.cern.ch/git/clang.git \
Expand All @@ -158,7 +158,7 @@ script:
else
tools/packaging/cpt.py -y \
--check-requirements \
--with-binary-llvm \
--with-llvm-binary \
--with-llvm-tar \
--tarball-tag=$([[ $TRAVIS_TAG = cling-nightlies ]] && echo "master" || echo "$TRAVIS_TAG") \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
Expand Down
64 changes: 32 additions & 32 deletions interpreter/cling/tools/packaging/cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def download_llvm_binary():
llvm_config_path = llvm_config_path[:-1]
llvm_flags = llvm_flag_setter(llvm_dir, llvm_config_path)
else:
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-binary-llvm and --with-llvm-tar flags")
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-llvm-binary and --with-llvm-tar flags")
if tar_required:
llvm_flags = llvm_flag_setter(llvm_dir, llvm_config_path)
if DIST=="Ubuntu" and REV=='16.04' and is_os_64bit():
Expand All @@ -282,7 +282,7 @@ def download_llvm_binary():
exec_subprocess_call('tar xvf clang+llvm-5.0.2-x86_64-apple-darwin.tar.xz', workdir)
exec_subprocess_call('sudo mv clang+llvm-5.0.2-x86_64-apple-darwin %s' % srcdir, workdir)
else:
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-binary-llvm and --with-llvm-tar flags")
raise Exception("Building clang using LLVM binary not possible. Please invoke cpt without --with-llvm-binary and --with-llvm-tar flags")
# FIXME: Add Fedora and SUSE support

# TODO Refactor all fetch_ functions to use this class will remove a lot of dup
Expand Down Expand Up @@ -325,7 +325,7 @@ def fetch_clang(llvm_revision):
print()
return

if args["with_binary_llvm"]:
if args["with_llvm_binary"]:
dir = workdir
else:
dir = os.path.join(srcdir, 'tools')
Expand Down Expand Up @@ -357,7 +357,7 @@ def update_old_clang():

def fetch_cling(arg):

if args["with_binary_llvm"]:
if args["with_llvm_binary"]:
global CLING_SRC_DIR
CLING_SRC_DIR = os.path.join(clangdir, 'tools', 'cling')
dir = clangdir
Expand Down Expand Up @@ -625,7 +625,7 @@ def install_prefix():
if OS == 'Windows':
f = f.replace('\\', '/')
for regex in regex_array:
if args['verbose']: print ("Applying regex " + regex + " to file " + f)
if args['with_verbose_output']: print ("Applying regex " + regex + " to file " + f)
if re.search(regex, f):
print ("Adding to final binary " + f)
if not os.path.isdir(os.path.join(prefix, os.path.dirname(f))):
Expand Down Expand Up @@ -654,7 +654,7 @@ def install_prefix_for_binary():
if OS == 'Windows':
f = f.replace('\\', '/')
for regex in regex_array:
if args['verbose']: print ("Applying regex " + regex + " to file " + f)
if args['with_verbose_output']: print ("Applying regex " + regex + " to file " + f)
if re.search(regex, f):
print ("Adding to final binary " + f)
if not os.path.isdir(os.path.join(prefix, os.path.dirname(f))):
Expand Down Expand Up @@ -1793,9 +1793,9 @@ def make_dmg():
default='http://root.cern.ch/git/clang.git')
parser.add_argument('--with-cling-url', action='store', help='Specify an alternate URL of Cling repo',
default='https://github.com/root-project/cling.git')
parser.add_argument('--cling-branch', help='Specify a particular Cling branch')
parser.add_argument('--with-cling-branch', help='Specify a particular Cling branch')

parser.add_argument('--with-binary-llvm', help='Download LLVM binary and use it to build Cling in dev mode', action='store_true')
parser.add_argument('--with-llvm-binary', help='Download LLVM binary and use it to build Cling in dev mode', action='store_true')
parser.add_argument('--with-llvm-tar', help='Download and use LLVM binary release tar to build Cling for debugging', action='store_true')
parser.add_argument('--no-test', help='Do not run test suite of Cling', action='store_true')
parser.add_argument('--skip-cleanup', help='Do not clean up after a build', action='store_true')
Expand All @@ -1810,9 +1810,9 @@ def make_dmg():
default='C:\\ci\\build\\')

parser.add_argument('--make-proper', help='Internal option to support calls from build system')
parser.add_argument('--verbose', help='Tell CMake to build with verbosity', action='store_true')
parser.add_argument('--with-verbose-output', help='Tell CMake to build with verbosity', action='store_true')
parser.add_argument('--with-cmake-flags', help='Additional CMake configuration flags', default='')
parser.add_argument('--stdlib', help=('C++ Library to use, stdlibc++ or libc++.'
parser.add_argument('--with-stdlib', help=('C++ Library to use, stdlibc++ or libc++.'
' To build a spcific llvm <tag> of libc++ with cling '
'specify libc++,<tag>'),
default='')
Expand Down Expand Up @@ -1934,14 +1934,14 @@ def custom_input(prompt, always_yes=False):
CMAKE = 'cmake'

# logic is too confusing supporting both at the same time
if args.get('stdlib') and EXTRA_CMAKE_FLAGS.find('-DLLVM_ENABLE_LIBCXX=') != -1:
print('use of --stdlib cannot be combined with -DLLVM_ENABLE_LIBCXX')
if args.get('with_stdlib') and EXTRA_CMAKE_FLAGS.find('-DLLVM_ENABLE_LIBCXX=') != -1:
print('use of --with-stdlib cannot be combined with -DLLVM_ENABLE_LIBCXX')
parser.print_help()
raise SystemExit

CLING_BRANCH = None
if args['current_dev'] and args['cling_branch']:
CLING_BRANCH = args['cling_branch']
if args['current_dev'] and args['with_cling_branch']:
CLING_BRANCH = args['with_cling_branch']

print('Cling Packaging Tool (CPT)')
print('Arguments vector: ' + str(sys.argv))
Expand All @@ -1965,9 +1965,9 @@ def custom_input(prompt, always_yes=False):
if not os.path.isdir(TMP_PREFIX):
os.makedirs(TMP_PREFIX)

if args['with_binary_llvm'] and args['with_llvm_url']:
raise Exception("Cannot specify flags --with-binary-llvm and --with-llvm-url together")
elif args['with_binary_llvm'] is False and args['with_llvm_url']:
if args['with_llvm_binary'] and args['with_llvm_url']:
raise Exception("Cannot specify flags --with-llvm-binary and --with-llvm-url together")
elif args['with_llvm_binary'] is False and args['with_llvm_url']:
LLVM_GIT_URL = args['with_llvm_url']
else:
LLVM_GIT_URL = "http://root.cern.ch/git/llvm.git"
Expand All @@ -1981,9 +1981,9 @@ def custom_input(prompt, always_yes=False):
if DIST == 'Ubuntu':
install_line = ""
prerequisite = ['git', 'cmake', 'gcc', 'g++', 'debhelper', 'devscripts', 'gnupg', 'zlib1g-dev']
if args["with_binary_llvm"] or args["with_llvm_tar"]:
if args["with_llvm_binary"] or args["with_llvm_tar"]:
prerequisite.extend(['subversion'])
if args["with_binary_llvm"] and not args["with_llvm_tar"]:
if args["with_llvm_binary"] and not args["with_llvm_tar"]:
if check_ubuntu('llvm-'+llvm_vers+'-dev') is False:
llvm_binary_name = 'llvm-{0}-dev'.format(llvm_vers)
for pkg in prerequisite:
Expand Down Expand Up @@ -2122,7 +2122,7 @@ def custom_input(prompt, always_yes=False):
stdout=None,
stderr=subprocess.STDOUT).communicate('yes'.encode('utf-8'))

if args["with_llvm_tar"] or args["with_binary_llvm"]:
if args["with_llvm_tar"] or args["with_llvm_binary"]:
download_llvm_binary()

if args['current_dev']:
Expand All @@ -2131,7 +2131,7 @@ def custom_input(prompt, always_yes=False):
"https://raw.githubusercontent.com/root-project/cling/master/LastKnownGoodLLVMSVNRevision.txt").readline().strip().decode(
'utf-8')

if args['with_binary_llvm']:
if args['with_llvm_binary']:
compile = compile_for_binary
install_prefix = install_prefix_for_binary
fetch_clang(llvm_revision)
Expand Down Expand Up @@ -2180,7 +2180,7 @@ def custom_input(prompt, always_yes=False):
'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball()
Expand All @@ -2190,7 +2190,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball_deb()
Expand Down Expand Up @@ -2220,7 +2220,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
make_dmg()
Expand All @@ -2230,7 +2230,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball()
Expand All @@ -2249,7 +2249,7 @@ def custom_input(prompt, always_yes=False):
'https://raw.githubusercontent.com/root-project/cling/%s/LastKnownGoodLLVMSVNRevision.txt' % tag
).readline().strip().decode('utf-8')

args["with_binary_llvm"] = True
args["with_llvm_binary"] = True

if args["with_binary_llvm"]:
download_llvm_binary()
Expand Down Expand Up @@ -2277,7 +2277,7 @@ def custom_input(prompt, always_yes=False):
'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball()
Expand All @@ -2288,7 +2288,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball_deb()
Expand Down Expand Up @@ -2321,7 +2321,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
make_dmg()
Expand All @@ -2332,7 +2332,7 @@ def custom_input(prompt, always_yes=False):
compile(os.path.join(workdir, 'cling-' + DIST + '-' + REV + '-' + platform.machine().lower() + '-' + VERSION))
install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball()
Expand All @@ -2343,7 +2343,7 @@ def custom_input(prompt, always_yes=False):
"https://raw.githubusercontent.com/root-project/cling/%s/LastKnownGoodLLVMSVNRevision.txt" % args[
'tarball_tag']).readline().strip().decode(
'utf-8')
if args["with_binary_llvm"]:
if args["with_llvm_binary"]:
compile = compile_for_binary
install_prefix = install_prefix_for_binary
fetch_clang(llvm_revision)
Expand All @@ -2367,7 +2367,7 @@ def custom_input(prompt, always_yes=False):

install_prefix()
if not args['no_test']:
if args['with_binary_llvm']:
if args['with_llvm_binary']:
setup_tests()
test_cling()
tarball()
Expand Down