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

[librabbitmq] include path missing #23630

Closed
anders-wind opened this issue Mar 18, 2022 · 3 comments · Fixed by #25224
Closed

[librabbitmq] include path missing #23630

anders-wind opened this issue Mar 18, 2022 · 3 comments · Fixed by #25224
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@anders-wind
Copy link
Contributor

anders-wind commented Mar 18, 2022


Is your feature request related to a problem? Please describe.
When adding librabbitmq as a dependency the target does not set a target_include_directories. So while the header is located in the build/vcpkg_installed/x64-linux/include/amqp.h we still get a "cannot find the specified header" even after find_package(rabbitmq-c CONFIG REQUIRED) and adding rabbitmq::rabbitmq-static to target_link_libraries.

My temporary solution has been to add "$<BUILD_INTERFACE:${PACKAGE_PREFIX_DIR}/include>" to my own target_include_directories but it feels a bit hacky.

Proposed solution
Add a patch to the library which adds target_include_directories in a proper maner.

@FrankXie05 FrankXie05 added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Mar 21, 2022
@FrankXie05
Copy link
Contributor

FrankXie05 commented Mar 24, 2022

@anders-wind Thanks for posting this issue, I didn't reproduce your problem locally, can you provide an example of your project? Here is my project example and build log:

PS E:\test\build> cmake.exe .. -DCMAKE_TOOLCHAIN_FILE=E:/vcpkg/scripts/buildsystems/vcpkg.cmake                                                                 
-- Building for: Visual Studio 16 2019                                                                                  
-- Running vcpkg install                                                                                                
Detecting compiler hash for triplet x64-windows...                                                                      
The following packages will be built and installed:                                                                         
librabbitmq[core]:x64-windows -> 0.11.0                                                                               
* openssl[core]:x64-windows -> 1.1.1n#1                                                                                 
* vcpkg-cmake[core]:x64-windows -> 2022-02-14                                                                           
* vcpkg-cmake-config[core]:x64-windows -> 2022-02-06                                                                  
Additional packages (*) will be modified to complete this operation.                                                    
Restored 4 packages from C:\Users\test\AppData\Local\vcpkg\archives in 791.2 ms. Use --debug to see more details. 
Starting package 1/4: vcpkg-cmake-config:x64-windows                                                                    
Installing package vcpkg-cmake-config[core]:x64-windows...                                                              
Elapsed time for package vcpkg-cmake-config:x64-windows: 10.54 ms                                                       
Starting package 2/4: vcpkg-cmake:x64-windows                                                                           
Installing package vcpkg-cmake[core]:x64-windows...                                                                     
Elapsed time for package vcpkg-cmake:x64-windows: 51.29 ms                                                              
Starting package 3/4: openssl:x64-windows                                                                               
Installing package openssl[core]:x64-windows...                                                                         
Elapsed time for package openssl:x64-windows: 890.1 ms                                                                  
Starting package 4/4: librabbitmq:x64-windows                                                                           
Installing package librabbitmq[core]:x64-windows...                                                                     
Elapsed time for package librabbitmq:x64-windows: 135.3 ms                                                              
                                                                                                                        
Total elapsed time: 6.349 s                                                                                               

The package librabbitmq provides CMake targets:                                                                           
                                                                                                                          
	find_package(rabbitmq-c CONFIG REQUIRED)                                                                                
	target_link_libraries(main PRIVATE rabbitmq::rabbitmq rabbitmq::rabbitmq-static)   
	
-- Running vcpkg install - done                                                                                         
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.                                             
-- The C compiler identification is MSVC 19.29.30141.0                                                                 
-- The CXX compiler identification is MSVC 19.29.30141.0                                                                
-- Detecting C compiler ABI info                                                                                        
-- Detecting C compiler ABI info - done                                                                                 
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped      
-- Detecting C compile features                                                                                         
-- Detecting C compile features - done                                                                                  
-- Detecting CXX compiler ABI info                                                                                      
-- Detecting CXX compiler ABI info - done                                                                               
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped      
-- Detecting CXX compile features                                                                                       
-- Detecting CXX compile features - done                                                                                
-- Configuring done                                                                                                     
-- Generating done                                                                                                      
-- Build files have been written to: E:/test/build                                                                      
PS E:\test\build> 

test.zip

@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support and removed category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Mar 25, 2022
@FrankXie05 FrankXie05 added requires:repro The issue is not currently repro-able and removed category:port-bug The issue is with a library, which is something the port should already support labels Apr 2, 2022
@anders-wind
Copy link
Contributor Author

Hi @FrankXie05, thanks for taking a look at my problem :) I'm going on vacation and have not had time to try your example. Though I see that youre including #include "rabbitmq-c.h" and not include <amqp.h> It might be that the library never intended that file to be included, but we are relying on a third party project which does include it.
I will try out your example when I get back :)

@FrankXie05
Copy link
Contributor

@anders-wind I reproduced it,and I found that there is a way upstream to export the include definition file(https://github.com/alanxz/rabbitmq-c/blob/26ecf6d3012be81f5dfb8a2d822c722e916a86cb/librabbitmq/CMakeLists.txt#L72), but it doesn't link in the top-level CMakeLists.txt , it might be an upstream bug, you can submit an issue upstream to fix it. :)

@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project and removed requires:repro The issue is not currently repro-able labels Apr 6, 2022
@JackBoosY JackBoosY removed the depends:upstream-changes Waiting on a change to the upstream project label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants