Skip to content
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: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ cmake_policy(SET CMP0074 NEW)
# critical for builds in non-standard environments.
cmake_policy(SET CMP0144 NEW)

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
# Disallows <PACKAGENAME>_ROOT in find_package.
# TODO: resolve absl/or-tools issue and switch to NEW
cmake_policy(SET CMP0144 OLD)
endif()

# Allow AUTOUIC on generated source
cmake_policy(SET CMP0071 NEW)

Expand Down
43 changes: 30 additions & 13 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ LEMON_VERSION="1.3.1"
SPDLOG_VERSION="1.15.0"
GTEST_VERSION="1.17.0"
GTEST_CHECKSUM="3471f5011afc37b6555f6619c14169cf"
ABSL_VERSION="20260107.0"
ABSL_CHECKSUM="2a7add2ee848dd4591f41b0f6339d624"
# Match the Abseil version bundled in prebuilt or-tools ${OR_TOOLS_VERSION_BIG}.
ABSL_VERSION="20250512.0"
ABSL_CHECKSUM="ecd64c3c38b20335c48e1ede28a8db90"
BISON_VERSION="3.8.2"
BISON_CHECKSUM="1e541a097cda9eca675d29dd2832921f"
FLEX_VERSION="2.6.4"
Expand Down Expand Up @@ -674,20 +675,28 @@ _install_abseil() {
local absl_prefix_found=""
local absl_version_file=""
Comment on lines 675 to 676

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The loop variables absl_version_file_default and absl_version_file_or_tools are used in for loops within this function but are not declared as local. In Bash, variables are global by default unless declared with local, which can lead to variable leakage or unintended side effects in the calling scope. Declaring them as local at the beginning of the function is recommended.

Suggested change
local absl_prefix_found=""
local absl_version_file=""
local absl_prefix_found=""
local absl_version_file=""
local absl_version_file_default=""
local absl_version_file_or_tools=""


# Check in default/user-specified prefix first
local absl_version_file_default="${absl_prefix_install}/lib/cmake/absl/abslConfigVersion.cmake"
if [[ -f "${absl_version_file_default}" ]]; then
absl_prefix_found="${absl_prefix_install}"
absl_version_file="${absl_version_file_default}"
fi
# Check in default/user-specified prefix first (lib64 on RHEL, lib elsewhere).
for absl_version_file_default in \
"${absl_prefix_install}/lib64/cmake/absl/abslConfigVersion.cmake" \
"${absl_prefix_install}/lib/cmake/absl/abslConfigVersion.cmake"; do
if [[ -f "${absl_version_file_default}" ]]; then
absl_prefix_found="${absl_prefix_install}"
absl_version_file="${absl_version_file_default}"
break
fi
done

# If not found, check in or-tools path
if [[ -z "${absl_prefix_found}" && -n "${OR_TOOLS_PATH}" ]]; then
local absl_version_file_or_tools="${OR_TOOLS_PATH}/lib/cmake/absl/abslConfigVersion.cmake"
if [[ -f "${absl_version_file_or_tools}" ]]; then
absl_prefix_found="${OR_TOOLS_PATH}"
absl_version_file="${absl_version_file_or_tools}"
fi
for absl_version_file_or_tools in \
"${OR_TOOLS_PATH}/lib64/cmake/absl/abslConfigVersion.cmake" \
"${OR_TOOLS_PATH}/lib/cmake/absl/abslConfigVersion.cmake"; do
if [[ -f "${absl_version_file_or_tools}" ]]; then
absl_prefix_found="${OR_TOOLS_PATH}"
absl_version_file="${absl_version_file_or_tools}"
break
fi
done
fi

local absl_installed_version="none"
Expand All @@ -709,6 +718,14 @@ _install_abseil() {
_execute "Building and installing Abseil..." "${cmake_bin}" --build build --target install
)
absl_prefix_found="${absl_prefix_install}"
for absl_version_file_default in \
"${absl_prefix_install}/lib64/cmake/absl/abslConfigVersion.cmake" \
"${absl_prefix_install}/lib/cmake/absl/abslConfigVersion.cmake"; do
if [[ -f "${absl_version_file_default}" ]]; then
absl_version_file="${absl_version_file_default}"
break
fi
done
Comment on lines +721 to +728

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This loop attempts to find and set absl_version_file after Abseil is built and installed. However, absl_version_file is a local variable that is never read or used again after this point, making this entire loop redundant. Removing it simplifies the code and avoids unnecessary file system checks.

INSTALL_SUMMARY+=("Abseil: system=${absl_installed_version}, required=${required_version}, path=${absl_prefix_found}, status=installed")
else
INSTALL_SUMMARY+=("Abseil: system=${absl_installed_version}, required=${required_version}, path=${absl_prefix_found}, status=skipped")
Expand Down
Loading