Skip to content

Fix issue installing empty database directory#1144

Merged
val-ms merged 1 commit intoCisco-Talos:mainfrom
val-ms:issue-1142-install-database-directory
Jan 23, 2024
Merged

Fix issue installing empty database directory#1144
val-ms merged 1 commit intoCisco-Talos:mainfrom
val-ms:issue-1142-install-database-directory

Conversation

@val-ms
Copy link
Contributor

@val-ms val-ms commented Jan 16, 2024

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

@val-ms val-ms 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
@val-ms val-ms force-pushed the issue-1142-install-database-directory branch from 7157019 to f0e5337 Compare January 22, 2024 17:53
@val-ms val-ms mentioned this pull request Jan 22, 2024
@val-ms val-ms merged commit 4e85e28 into Cisco-Talos:main Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.3.0-rc1 build, with '-DENABLE_APP=ON' fails; incorrect "${ENV}" in MAKE_DIRECTORY path in 'freshclam/CMakeLists.txt'

1 participant