diff --git a/.github/workflows/exchange-ci.yml b/.github/workflows/exchange-ci.yml index 6f4384fa..5e55a54e 100644 --- a/.github/workflows/exchange-ci.yml +++ b/.github/workflows/exchange-ci.yml @@ -288,7 +288,7 @@ jobs: LLVM_DIR: '/usr/lib/llvm-18/lib/cmake/llvm' NUTC_WRAPPER_BINARY_PATH: ${{ github.workspace }}/exchange/build/WRAPPER NUTC_CPP_TEMPLATE_PATH: ${{ github.workspace }}/exchange/template.cpp - NUTC_LINTER_SPAWNER_BINARY_PATH: ${{ github.workspace }}/exchange/build/LINTER-spawner + NUTC_LINTER_SPAWNER_BINARY_PATH: ${{ github.workspace }}/exchange/build/LINTER_spawner steps: - uses: actions/checkout@v3 diff --git a/exchange/src/exchange/wrappers/handle/wrapper_handle.cpp b/exchange/src/exchange/wrappers/handle/wrapper_handle.cpp index e1b6c644..b8fa2b80 100644 --- a/exchange/src/exchange/wrappers/handle/wrapper_handle.cpp +++ b/exchange/src/exchange/wrappers/handle/wrapper_handle.cpp @@ -22,17 +22,22 @@ namespace nutc::exchange { const fs::path& WrapperHandle::wrapper_binary_path() { + static constexpr auto WRAPPER_BINARY_PATH_ENV_VAR = "NUTC_WRAPPER_BINARY_PATH"; static const char* const wrapper_binary_location = - std::getenv("NUTC_WRAPPER_BINARY_PATH"); + std::getenv(WRAPPER_BINARY_PATH_ENV_VAR); if (wrapper_binary_location == nullptr) [[unlikely]] { - throw std::runtime_error("NUTC_WRAPPER_BINARY_PATH environment variable not set" + throw std::runtime_error( + fmt::format("{} environment variable not set", WRAPPER_BINARY_PATH_ENV_VAR) ); } static const fs::path wrapper_binary_path{wrapper_binary_location}; - if (!fs::exists(wrapper_binary_path)) - throw std::runtime_error("File at NUTC_WRAPPER_BINARY_PATH does not exist"); + if (!fs::exists(wrapper_binary_path)) { + throw std::runtime_error( + fmt::format("File at {} does not exist", WRAPPER_BINARY_PATH_ENV_VAR) + ); + } return wrapper_binary_path; } diff --git a/exchange/src/linter/spawning/spawning.cpp b/exchange/src/linter/spawning/spawning.cpp index 00fd1bd0..4cc69825 100644 --- a/exchange/src/linter/spawning/spawning.cpp +++ b/exchange/src/linter/spawning/spawning.cpp @@ -25,8 +25,11 @@ LintProcessManager::spawner_binary_path() } static const std::filesystem::path spawner_binary_path{spawner_binary_location}; - if (!std::filesystem::exists(spawner_binary_path)) - throw std::runtime_error("File at NUTC_SPAWNER_BINARY_PATH does not exist"); + if (!std::filesystem::exists(spawner_binary_path)) { + throw std::runtime_error( + fmt::format("File at {} does not exist", LINTER_SPAWNER_BINARY_ENV_VAR) + ); + } return spawner_binary_path; }