Repository navigation
GraphBLAS: escape double quotes in GB_C_LINK_FLAGS - #1076
Open
elvisdukaj wants to merge 1 commit into
Open
elvisdukaj wants to merge 1 commit into
elvisdukaj wants to merge 1 commit into
Conversation
I am trying to create the conan package for this library but it fails to
build on the conan center index.
The issue is the following:
/tmp/workspace/cci_prod_PR-31385/conan-home/p/b/suite69965dfdc1a7b/b/GraphBLAS/Source/jitifyer/GB_jitifyer.c:
In function 'GB_jitifyer_init':
/tmp/workspace/cci_prod_PR-31385/conan-home/p/b/suite69965dfdc1a7b/b/GraphBLAS/Config/GB_config.h:29:49:
error: 'tmp' undeclared (first use in this function)
29 | #define GB_C_LINK_FLAGS "-m64
-Wl,-rpath-link="/tmp/workspace/cci_prod_PR-31385/conan-home/p/openbb37405d51ba66/p/lib"
-Wl,-rpath-link="/tmp/workspace/cci_prod_PR-31385/conan-home/p/mpfrea3a4336e4ebc/p/lib"
-Wl,-rpath-link="/tmp/workspace/cci_prod_PR-31385/conan-home/p/gmpe3bcaf50ea0b5/p/lib"
-shared "
| ^~~
/tmp/workspace/cci_prod_PR-31385/conan-home/p/b/suite69965dfdc1a7b/b/GraphBLAS/Source/jitifyer/GB_jitifyer.c:197:32:
note: in definition of macro 'GB_COPY_STUFF'
197 | uint64_t memsize = strlen (src) ; \
| ^~~
/tmp/workspace/cci_prod_PR-31385/conan-home/p/b/suite69965dfdc1a7b/b/GraphBLAS/Source/jitifyer/GB_jitifyer.c:364:41:
note: in expansion of macro 'GB_C_LINK_FLAGS'
364 | GB_COPY_STUFF (GB_jit_C_link_flags, GB_C_LINK_FLAGS) ;
Full logs:
https://build-logs.conan.io/cci/prod/PR-31385/4/0cd9a6530dcb540c//build_log_suitesparse_7_14_1_f17cf177a6b480c128be2bc4448ae6ca_402caf650e8a701de50d3a8cea803ac4ab20f7f3.txt
Owner
|
Thanks for the update. Can you email me a signed contributor agreement, to me at davis@tamu.edu? |
Author
Done, thank you. |
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.
Problem
SuiteSparse:GraphBLAS fails to build when
CMAKE_SHARED_LINKER_FLAGScontains double quotes, which happens with Conan environments, e.g.-Wl,-rpath-link="/path/to/conan/lib". The flags are substituted into a C string literal in the generatedConfig/GB_config.h:so unescaped quotes terminate the string literal and the build fails:
Full failing build log (conan-center-index): https://build-logs.conan.io/cci/prod/PR-31385/4/0cd9a6530dcb540c//build_log_suitesparse_7_14_1_f17cf177a6b480c128be2bc4448ae6ca_402caf650e8a701de50d3a8cea803ac4ab20f7f3.txt
Root cause
GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmakealready escapes double quotes inGB_C_FLAGS:but the same escaping is missing for
GB_C_LINK_FLAGS, which is substituted intoGB_config.hthe same way.Fix
Apply the identical escaping to
GB_C_LINK_FLAGS:Testing
Verified that with a linker flag containing quotes (
-Wl,-rpath-link="/tmp/conan/p/openmp/lib"), the generated#define GB_C_LINK_FLAGS "..."line is now a valid C string literal (compiles cleanly).