Skip to content

Fix Abseil conflict with or-tools'#10772

Open
jimmysitu wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
jimmysitu:master
Open

Fix Abseil conflict with or-tools'#10772
jimmysitu wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
jimmysitu:master

Conversation

@jimmysitu

Copy link
Copy Markdown

Summary

Fix Abseil conflict with or-tools' in OpenROAD

Type of Change

Change DependencyInstaller.sh, use or-tools' Abseil when or-tools already installed one
This change can fix the isssue #10651

Impact

Abseil is changed to ABSL_VERSION="20250512.0", which is snyced with or-tools'

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.

Related Issues

[#10651]

@jimmysitu jimmysitu requested a review from a team as a code owner June 28, 2026 13:50
@jimmysitu jimmysitu requested a review from precisionmoon June 28, 2026 13:50

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request removes the CMake policy CMP0144 override and updates the Abseil dependency version in the installer script to match prebuilt or-tools. It also enhances the Abseil installation check to support both lib and lib64 directories. Feedback on these changes suggests declaring the new loop variables as local to prevent variable leakage in Bash, and removing a redundant loop that sets a local variable that is never used again.

Comment on lines 675 to 676
local absl_prefix_found=""
local absl_version_file=""

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=""

Comment on lines +721 to +728
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

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.

@github-actions github-actions Bot left a comment

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.

Welcome to OpenROAD! Thanks for opening your first PR.
Before we review:

Please ensure:

  • CI passes
  • Code is properly formatted
  • Tests are included where applicable
    A maintainer will review shortly!

Signed-off-by: Jimmy Situ <web@jimmystone.cn>
@maliberty

Copy link
Copy Markdown
Member

@mguthaus does this solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants