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

[clang] intercept-build can't find its Python modules on a lib64 system #106608

Closed
mgorny opened this issue Aug 29, 2024 · 2 comments
Closed

[clang] intercept-build can't find its Python modules on a lib64 system #106608

mgorny opened this issue Aug 29, 2024 · 2 comments
Labels
clang-tools-extra cmake Build system in general and CMake in particular release:backport

Comments

@mgorny
Copy link
Member

mgorny commented Aug 29, 2024

$ intercept-build 
Traceback (most recent call last):
  File "/usr/lib/llvm/20/bin/intercept-build", line 13, in <module>
    from libscanbuild.intercept import intercept_build
ModuleNotFoundError: No module named 'libscanbuild'

As the OP pointed out, the code appends a hardcoded lib directory:

this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(os.path.dirname(this_dir), 'lib'))

However, the files are installed in suffixed lib directory:

install(FILES lib/libscanbuild/${lib}
DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild
COMPONENT scan-build-py)

I'm going to submit a pull request changing the install directory to lib to match. Since these are just Python modules, they don't need multilib.

Original bug report: https://bugs.gentoo.org/938665

@github-actions github-actions bot added the clang Clang issues not falling into any other category label Aug 29, 2024
@EugeneZelenko EugeneZelenko added clang-tools-extra and removed clang Clang issues not falling into any other category labels Aug 29, 2024
mgorny added a commit to mgorny/llvm-project that referenced this issue Aug 29, 2024
Install scan-build-py modules into the plain `lib` directory,
without LLVM_LIBDIR_SUFFIX appended, to match the path expected
by `intercept-build` executable.  This fixes the program being unable
to find its modules.  Using unsuffixed path makes sense here, since
Python modules are not subject to multilib.

This change effectively reverts 1334e12.
The commit in question changed the path without a clear justification
("does not respect the given prefix") and the Python code was never
modified to actually work with the change.
@mgorny mgorny closed this as completed in 0c4cf79 Aug 30, 2024
@EugeneZelenko EugeneZelenko added the cmake Build system in general and CMake in particular label Aug 30, 2024
@mgorny mgorny reopened this Aug 31, 2024
@mgorny mgorny added this to the LLVM 19.X Release milestone Aug 31, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Aug 31, 2024
@mgorny
Copy link
Member Author

mgorny commented Aug 31, 2024

/cherry-pick 0c4cf79

llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Aug 31, 2024
Install scan-build-py modules into the plain `lib` directory,
without LLVM_LIBDIR_SUFFIX appended, to match the path expected
by `intercept-build` executable.  This fixes the program being unable
to find its modules.  Using unsuffixed path makes sense here, since
Python modules are not subject to multilib.

This change effectively reverts 1334e12.
The commit in question changed the path without a clear justification
("does not respect the given prefix") and the Python code was never
modified to actually work with the change.

Fixes llvm#106608

(cherry picked from commit 0c4cf79)
@llvmbot llvmbot closed this as completed Aug 31, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 31, 2024

/pull-request #106853

@github-project-automation github-project-automation bot moved this from Needs Triage to Done in LLVM Release Status Aug 31, 2024
tru pushed a commit to llvmbot/llvm-project that referenced this issue Sep 1, 2024
Install scan-build-py modules into the plain `lib` directory,
without LLVM_LIBDIR_SUFFIX appended, to match the path expected
by `intercept-build` executable.  This fixes the program being unable
to find its modules.  Using unsuffixed path makes sense here, since
Python modules are not subject to multilib.

This change effectively reverts 1334e12.
The commit in question changed the path without a clear justification
("does not respect the given prefix") and the Python code was never
modified to actually work with the change.

Fixes llvm#106608

(cherry picked from commit 0c4cf79)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang-tools-extra cmake Build system in general and CMake in particular release:backport
Projects
Development

No branches or pull requests

3 participants