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

Fix issue installing empty database directory #1144

Conversation

micahsnyder
Copy link
Contributor

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

@micahsnyder micahsnyder force-pushed the issue-1142-install-database-directory branch from 7853f85 to 7157019 Compare January 16, 2024 22:49
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
@micahsnyder micahsnyder force-pushed the issue-1142-install-database-directory branch from 7157019 to f0e5337 Compare January 22, 2024 17:53
@micahsnyder micahsnyder mentioned this pull request Jan 22, 2024
@micahsnyder micahsnyder merged commit 4e85e28 into Cisco-Talos:main Jan 23, 2024
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant