diff --git a/docs/source/research_tool_docs/vara/add_setup_infos/clion_setup.rst b/docs/source/research_tool_docs/vara/add_setup_infos/clion_setup.rst index 3152ad5af..ae03bf107 100644 --- a/docs/source/research_tool_docs/vara/add_setup_infos/clion_setup.rst +++ b/docs/source/research_tool_docs/vara/add_setup_infos/clion_setup.rst @@ -5,7 +5,7 @@ How to set up VaRA/LLVM in CLion -------------------------------- 1. Use ``vara-buildsetup vara -i`` to correctly clone and checkout the VaRa/LLVM repos (cf. :ref:`How to setup VaRA`) -2. Start CLion and from the menu select **File | Open** and point to ``/vara-llvm-project/llvm/CMakeLists.txt``. +2. Start CLion and from the menu select **File | Open** and point to ``/tools_src/vara-llvm-project/llvm/CMakeLists.txt``. In the dialog that opens, click **Open as Project**. 3. Go to **Settings/Preferences | Build, Execution, Deployment | CMake** to configure the CMake project. @@ -20,8 +20,8 @@ How to set up VaRA/LLVM in CLion -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=ON - -DCMAKE_C_FLAGS_DEBUG=-O2 -g -fno-omit-frame-pointer - -DCMAKE_CXX_FLAGS_DEBUG=-O2 -g -fno-omit-frame-pointer + -DCMAKE_C_FLAGS_DEBUG="-O2 -g -fno-omit-frame-pointer" + -DCMAKE_CXX_FLAGS_DEBUG="-O2 -g -fno-omit-frame-pointer" -DCMAKE_CXX_STANDARD=17 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=/tools/VaRA @@ -55,8 +55,8 @@ How to set up VaRA/LLVM in CLion -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=ON - -DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG -march=native -fno-omit-frame-pointer -gmlt - -DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG -march=native -fno-omit-frame-pointer -gmlt + -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -march=native -fno-omit-frame-pointer -gmlt" + -DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG -march=native -fno-omit-frame-pointer -gmlt" -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=/tools/VaRA -DLLVM_ENABLE_ASSERTIONS=OFF diff --git a/varats/varats/tools/driver_casestudy.py b/varats/varats/tools/driver_casestudy.py index 2f40a8409..364ddc69d 100644 --- a/varats/varats/tools/driver_casestudy.py +++ b/varats/varats/tools/driver_casestudy.py @@ -69,6 +69,7 @@ TypedChoice, EnumChoice, create_multi_case_study_choice, + ShortCommitHashParamType, ) from varats.utils.git_util import ( get_initial_commit, @@ -555,7 +556,11 @@ def __casestudy_package( @click.option( "--project", required=True, help="Project to view result files for." ) -@click.option("--commit-hash", help="Commit hash to view result files for.") +@click.option( + "--commit-hash", + type=ShortCommitHashParamType(), + help="Commit hash to view result files for." +) @click.option( "--newest-only", is_flag=True, diff --git a/varats/varats/ts_utils/click_param_types.py b/varats/varats/ts_utils/click_param_types.py index f080fa4e7..bbd0e6042 100644 --- a/varats/varats/ts_utils/click_param_types.py +++ b/varats/varats/ts_utils/click_param_types.py @@ -5,6 +5,7 @@ import click from benchbuild.experiment import ExperimentRegistry +from click import ParamType from varats.data.discover_reports import initialize_reports from varats.experiments.discover_experiments import initialize_experiments @@ -17,6 +18,7 @@ ) from varats.ts_utils.cli_util import CLIOptionTy, convert_value, make_cli_option from varats.utils.exceptions import ConfigurationLookupError +from varats.utils.git_util import ShortCommitHash if tp.TYPE_CHECKING: # pylint: disable=unused-import @@ -184,8 +186,22 @@ def create_multi_experiment_type_choice( return TypedMultiChoice(value_dict) +class ShortCommitHashParamType(ParamType): + """Click parameter type for commit hashes.""" + name = "ShortCommitHash" + + def convert( + self, value: tp.Union[str, ShortCommitHash], + param: tp.Optional[click.Parameter], ctx: tp.Optional[click.Context] + ) -> ShortCommitHash: + if isinstance(value, ShortCommitHash): + return value + + return ShortCommitHash(value) + + # ------------------------------------------------------------------------------ -# Predefined CLI Options +# Predefined plot/table CLI Options # ------------------------------------------------------------------------------ REQUIRE_CASE_STUDY: CLIOptionTy = convert_value(