Skip to content

[fix] Fix missing CC_LIB_DIR when dev_package is used #4513

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

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

Szelethus
Copy link
Contributor

@Szelethus Szelethus commented Mar 31, 2025

If you are developing CodeChecker, you should likely build the 'dev_package' target instead of 'package', as it symlinks instead of copied implementation files. However, CodeChecker will immediately crash if the CC_LIB_DIR environmental variable is not set.

Based on the comment of @bruntib in #4491, this is a one-line fix. The issue is that CodeChecker (for historical reasons) has a non-standar library layout. Instead of every library being on the same level (codechecker_analyzer, codechecker_client, codechecker_web etc), they are all over the place in the source code. The "package" make target that "builds" CodeChecker solves this by copying the libraries in the same directory, with them finally being on the same level.

The "dev_package" target symlinks instead, so that changes in the actual source code are immediately refected without a need to build CodeChecker again.

CC_LIB_DIR points to this copied and corrected layout. However, if it was symlinked, we mistakenly resolved that symlink through os.path.realpath() -- but that points to the different directory layout, so removing or adding a directory from this path will land you in the wrong place.

Traditionally, we circumvented this by explicitly set the CC_LIB_DIR variable, in which case CodeChecker does no symlink resolving.

The patch now no longer resolves this symlink in any case.

iIf you are developing CodeChecker, you should likely build the
'dev_package' target instead of 'package', as it symlinks instead of
copied implementation files. However, CodeChecker will immediately
crash if the CC_LIB_DIR environmental variable is not set.

Based on the comment of @bruntib in Ericsson#4491, this is a one-line fix. The
issue is that CodeChecker (for historical reasons) has a non-standar
library layout. Instead of every library being on the same level
(codechecker_analyzer, codechecker_client, codechecker_web etc), they
are all over the place in the source code. The "package" make target
that "builds" CodeChecker solves this by copying the libraries in the
same directory, with them finally being on the same level.

The "dev_package" target symlinks instead, so that changes in the actual
source code are immediately refected without a need to build CodeChecker
again.

CC_LIB_DIR points to this copied and corrected layout. However, if it
was symlinked, we mistakenly resolved that symlink through
os.path.realpath() -- but that points to the different directory
layout, so removing or adding a directory from this path will land you
in the wrong place. The patch now no longer resolves this symlink.
@Szelethus Szelethus added this to the release 6.26.0 milestone Mar 31, 2025
@Szelethus Szelethus requested a review from dkrupp March 31, 2025 08:11
@bruntib bruntib merged commit eb80013 into Ericsson:master Mar 31, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants