Fix issue installing empty database directory#1144
Merged
val-ms merged 1 commit intoCisco-Talos:mainfrom Jan 23, 2024
Merged
Conversation
7853f85 to
7157019
Compare
The CMake code to install the empty database directory doesn't appear to
do anything. Further, it is causing build issues for some users.
I tested some with trying to install the database directory directly,
like this:
```cmake
if(IS_ABSOLUTE ${DATABASE_DIRECTORY})
INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${DATABASE_DIRECTORY} COMPONENT programs)
else()
INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DATABASE_DIRECTORY} COMPONENT programs)
endif()
```
However, this causes build failures for Windows and macOS installers.
Windows:
```
CMake Error at C:/Users/build/Documents/jenkins/workspace/test-pipelines_build-1.3/clamav-devel/build64/freshclam/cmake_install.cmake:66 (message):
ABSOLUTE path INSTALL DESTINATION forbidden (by caller):
C:/Users/build/Documents/jenkins/workspace/test-pipelines_build-1.3/clamav-devel/build64/install/database/
Call Stack (most recent call first):
C:/Users/build/Documents/jenkins/workspace/test-pipelines_build-1.3/clamav-devel/build64/cmake_install.cmake:133 (include)
```
macOS:
```
CMake Error at /Users/****/jenkins/workspace/test-pipelines_build-1.3/clamav-devel/build-pkg/freshclam/cmake_install.cmake:111 (file):
file INSTALL cannot make directory "/usr/local/clamav/share/clamav": No
such file or directory.
Call Stack (most recent call first):
/Users/****/jenkins/workspace/test-pipelines_build-1.3/clamav-devel/build-pkg/cmake_install.cmake:122 (include)
CPack Error: Error when generating package: ClamAV
```
I think my best option is just to remove this line of code since it's causing
problems for some and isn't working for anyone. Even if it would be
nice to have the database directory created at install time automatically.
Fixes: Cisco-Talos#1142
7157019 to
f0e5337
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CMake code to install the empty database directory doesn't appear to do anything. Further, it is causing build issues for some users.
Instead of running code to make the directory, it appears we can just install a directory directly.
Fixes: #1142