Bug 2292485 - Fail to load CMake package `antlr4-runtime` provided by `antlr4-cpp-runtime-devel`: missing `/usr/lib64/libantlr4-runtime.a`
Summary: Fail to load CMake package `antlr4-runtime` provided by `antlr4-cpp-runtime-d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: antlr4-project
Version: 40
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-06-15 08:17 UTC by rivance.0
Modified: 2024-07-05 06:21 UTC (History)
3 users (show)

Fixed In Version: antlr4-project-4.10.1-11.fc39 antlr4-project-4.10.1-15.fc40
Clone Of:
Environment:
Last Closed: 2024-07-05 01:18:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description rivance.0 2024-06-15 08:17:19 UTC
The `antlr4-runtime` CMake package provided by `antlr4-cpp-runtime-devel` seems to require both `/usr/lib64/libantlr4-runtime.so` and `/usr/lib64/libantlr4-runtime.a` to function properly, since it has two targets (`antlr4_shared` and `antlr4_static`) and will check if both are configured properly. However the static library is missing in the package.

Error message:

```
CMake Error at /usr/lib64/cmake/antlr4-runtime/antlr4-targets.cmake:85 (message):
  The imported target "antlr4_static" references the file

     "/usr/lib64/libantlr4-runtime.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/cmake/antlr4-runtime/antlr4-targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib64/cmake/antlr4-runtime/antlr4-runtime-config.cmake:42 (include)
  CMakeLists.txt:57 (find_package)
```

Reproducible: Always

Steps to Reproduce:
1. Create a new CMake project
2. Add `find_package(antlr4-runtime REQUIRED)` to the `CMakeLists.txt`
3. Run `cmake .`
Actual Results:  
CMake Error at /usr/lib64/cmake/antlr4-runtime/antlr4-targets.cmake:85 (message):
  The imported target "antlr4_static" references the file

     "/usr/lib64/libantlr4-runtime.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/cmake/antlr4-runtime/antlr4-targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib64/cmake/antlr4-runtime/antlr4-runtime-config.cmake:42 (include)
  CMakeLists.txt:57 (find_package)

Expected Results:  
Load the CMake package normally without errors.

Related CMake file contents (/usr/lib64/cmake/antlr4-runtime/antlr4-runtime-config.cmake):

```
foreach(_cmake_expected_target IN ITEMS antlr4_shared antlr4_static)
  list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
  if(TARGET "${_cmake_expected_target}")
    list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
  else()
    list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
  endif()
endforeach()
...
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
  foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
    if(NOT EXISTS "${_cmake_file}")
      message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
   \"${_cmake_file}\"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   \"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
    endif()
  endforeach()
  unset(_cmake_file)
  unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
```

Comment 1 Jerry James 2024-06-26 14:42:48 UTC
I think I see how to deal with this.  We don't really want to ship static libraries in Fedora, so I've got a patch to remove references to the static library in upstream's cmake files.  I will push an update momentarily.  Please let me know if it resolves the issue for you.

Comment 2 Fedora Update System 2024-06-26 14:43:40 UTC
FEDORA-2024-acb17dadf8 (antlr4-project-4.10.1-11.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-acb17dadf8

Comment 3 Fedora Update System 2024-06-27 02:20:21 UTC
FEDORA-2024-acb17dadf8 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-acb17dadf8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-acb17dadf8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2024-06-27 02:31:04 UTC
FEDORA-2024-1ce7a1cd98 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-1ce7a1cd98`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-1ce7a1cd98

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2024-07-05 01:18:08 UTC
FEDORA-2024-acb17dadf8 (antlr4-project-4.10.1-11.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2024-07-05 06:21:28 UTC
FEDORA-2024-1ce7a1cd98 (antlr4-project-4.10.1-15.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.