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

Make some ci fixes #279

Merged
merged 11 commits into from
Jun 14, 2021
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,6 @@ workflows:
test_data_cache_version: ["5"]
filters:
tags:
only: /AFNI_\d\d.\d.\d\d/
ignore: /.*/
branches:
only: /.*/
ignore: /.*/
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ include(get_git_repo_version)
include(get_build_macros_and_functions)
include(CMakeDependentOption)

if( (NOT DEFINED ENV{CC}) )
if(DEFINED CMAKE_TOOLCHAIN_FILE)
# Toolchain file defines the correct compiler settings for MacOS
option(AFNI_COMPILER_CHECK "Check that GCC and GXX are set as expected" OFF)
else()
option(AFNI_COMPILER_CHECK "Check that GCC and GXX are set as expected" ON)
endif()
if (AFNI_COMPILER_CHECK)
message(FATAL_ERROR "
Set the compilers for the build by setting the environment variables GCC and GXX...
Hint 1: export CC=$(which gcc);export CXX=$(which GXX)
Hint 2: If the above, or indeed this failure, is not useful you can consider passing -DAFNI_COMPILER_CHECK=OFF to cmake
"
)
endif()
endif()

# ##### Project info
project(
AFNI
Expand All @@ -21,8 +38,8 @@ set(AFNI_VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/AFNI_version.h")
check_header_has_been_created("${AFNI_VERSION_HEADER}" "${GIT_REPO_VERSION}")

if("/usr/bin/cc" STREQUAL "${CMAKE_C_COMPILER}")
# This should never happen, compiler should be gcc or clang
message(FATAL_ERROR "wrong compiler: ${CMAKE_C_COMPILER}")
# This should never happen, compiler should be gcc or clang.
message(FATAL_ERROR "wrong compiler: ${CMAKE_C_COMPILER}. Please check to see if clang or gcc are installed and functioning")
endif()
# set(CMAKE_LINK_WHAT_YOU_USE $<$<C_COMPILER_ID:GNU>:ON>)
include(afni_cmake_build_options)
Expand Down
5 changes: 5 additions & 0 deletions src/afni_history_rickr.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@

afni_history_struct rickr_history[] = {

{ 14, Jun, 2021, RCR, "dcm2niix_afni", MICRO, TYPE_BUG_FIX,
"turn of local signing in crorden/dcm2niix_console/makefile",
NULL
} ,

{ 10, Jun, 2021, RCR, "SurfLocalstat", MINOR, TYPE_NEW_PROG,
"add Ziad's program to the default build",
"This is to allow use of the 'mode' stat."
Expand Down
6 changes: 4 additions & 2 deletions src/crorden/dcm2niix_console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ endif()


if(APPLE)
message("-- Adding Apple plist")
set_target_properties(dcm2niix PROPERTIES LINK_FLAGS "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_SOURCE_DIR}/Info.plist")
# turn of signing locally
message("-- (not) Adding Apple plist")
# set_target_properties(dcm2niix PROPERTIES LINK_FLAGS "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_SOURCE_DIR}/Info.plist")

#Apple notarization requires a Info.plist
# For .app bundles, the Info.plist is a separate file, for executables it is appended as a section
#you can check that the Info.plist section has been inserted with either of these commands
Expand Down
4 changes: 3 additions & 1 deletion src/crorden/dcm2niix_console/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ ifneq ($(OS),Windows_NT)
ifeq "$(OS)" "Darwin"
#CFLAGS=-dead_strip -O3
#CFLAGS= -O3
CFLAGS=-O3 -sectcreate __TEXT __info_plist Info.plist
# CFLAGS=-O3 -sectcreate __TEXT __info_plist Info.plist
# rickr - ponder -sectcreate later
CFLAGS=-O3
#Apple notarization requires a Info.plist
# For .app bundles, the Info.plist is a separate file, for executables it is appended as a section
#you can check that the Info.plist section has been inserted with either of these commands
Expand Down
4 changes: 2 additions & 2 deletions tests/afni_test_utils/container_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ def raise_error_for_debug_mode(tests_dir, kwargs, docker_kwargs):
`# issues with file permissions` \
-e CONTAINER_UID=$(id -u) \
-e CONTAINER_GID=$(id -g) \
`#Pass git credentials into container for more pleasant interaction ` \
`#with the source git repository` \
`# Pass git credentials into container for more pleasant interaction ` \
`# with the source git repository` \
-e GIT_AUTHOR_NAME={docker_kwargs['environment']['GIT_AUTHOR_NAME']} \
-e GIT_AUTHOR_EMAIL={docker_kwargs['environment']['GIT_AUTHOR_EMAIL']} \
`# Delete the container upon exit` \
Expand Down
5 changes: 0 additions & 5 deletions tests/afni_test_utils/data_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,6 @@ def try_data_download(file_fetch_list, test_data_dir, logger):
return False

finally:
# make sure datalad repo wasn't updated to git annex version 8. Not sure why this is happening
git_config_file = Path(test_data_dir) / ".git" / "config"
git_config_file.write_text(
git_config_file.read_text().replace("version = 8", "version = 7")
)
dl_lock.release()
sleep(random.randint(1, 10))

Expand Down
2 changes: 1 addition & 1 deletion tests/afni_test_utils/minimal_funcs_for_run_tests_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def modify_path_and_env_if_not_using_cmake(**args_dict):
"Usage of cmake build for testing was "
"inferred from the usage of --build-dir. "
"Currently afnipy is not importable... you should be install it "
"into the current python interpreter. "
"into the current python interpreter. (something like pip install -e ../src/python_scripts)"
)
return
elif test_bin_path:
Expand Down
5 changes: 1 addition & 4 deletions tests/afni_test_utils/run_tests_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ def run_tests(tests_dir, **args_dict):
# append gcovr to assemble coverage report for C code
cmd += f"; gcovr -s --xml -o {tests_dir}/gcovr_output.xml -r {args_dict['build_dir']}/src"
# append command for compiling and uploading codecov report

# apparently there is a security issue here, must investigate
# cmd += "; bash -c 'bash <(curl -s https://codecov.io/bash)'"
# sys.exit(1)
cmd += "; bash -c 'bash <(curl -s https://codecov.io/bash)'"

print(f"Executing: {cmd}")
res = subprocess.run(cmd, shell=True, env=os.environ.copy())
Expand Down
8 changes: 5 additions & 3 deletions tests/scripts/test_ptaylor.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def test_3dClusterize(data, ptaylor_env):
# > {opref}_REP.txt
cmd = " ".join(cmd.split())
differ = tools.OutputDiffer(data, cmd)
differ.run()
differ.run(skip_output_diff=True)


def test_3dClusterize_new(data, ptaylor_env):
Expand All @@ -441,8 +441,10 @@ def test_3dClusterize_new(data, ptaylor_env):
"""
# > {opref}_REP.txt
cmd = " ".join(cmd.split())
differ = tools.OutputDiffer(data, cmd)
differ.run()
differ = tools.OutputDiffer(
data, cmd, kwargs_log={"append_to_ignored": "Mean and SEM based"}
)
differ.run(skip_output_diff=True)


# -------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions tests/scripts/test_testing_script_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,7 @@ def test_run_tests_container_subparsers_works(monkeypatch, argslist, mocked_scri
"ARGS='{DEFAULT_ARGS} {PYTEST_COV_FLAGS}' "
"ninja pytest;"
" gcovr -s --xml -o {TESTS_DIR}/gcovr_output.xml -r {params['args_in']['build_dir']}/src;"
" echo ======= REFUSING TO GO TO codecov.io ======== "
# there may be a security issue with getting the script this way
# " bash -c 'bash <(curl -s https://codecov.io/bash)'"
" bash -c 'bash <(curl -s https://codecov.io/bash)'"
),
},
],
Expand Down