Add $KOKA_PATH, and pkg-config lookup for C libraries#795
Open
timbertson wants to merge 2 commits intokoka-lang:devfrom
Open
Add $KOKA_PATH, and pkg-config lookup for C libraries#795timbertson wants to merge 2 commits intokoka-lang:devfrom
timbertson wants to merge 2 commits intokoka-lang:devfrom
Conversation
TimWhiting
reviewed
Aug 29, 2025
| <- getKokaDirs (localLibDir flags) (localShareDir flags) buildDir | ||
|
|
||
| normalizedIncludes <- mapM realPath ("." : (localShareDir ++ "/lib") : includePath flags) | ||
| pathsFromEnv <- fmap splitSearchPath (getEnvVar "KOKA_PATH") |
Collaborator
There was a problem hiding this comment.
It looks like we already have a utility for splitting delimited paths used elsewhere in this file: undelimPaths. Not sure if Daan would want to avoid the extra dependency, and use this, or if we should use a version that might handle slightly more edge cases than we do. We tend to avoid adding more dependencies.
Contributor
Author
There was a problem hiding this comment.
Thanks, happy to use that - I wasn't aware of it. GHC reported that filepath was a hidden dependency which I assumed meant it was already required transitively, but there's a chance it was only used for tests previously.
Collaborator
There was a problem hiding this comment.
Hmm, yes, that might be the case.
3d4be09 to
2341087
Compare
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.
This PR implements the two ideas I mentioned in discord:
$KOKA_PATHas an additional list of include directories, similar to many other languagespkg-config. This is a standard which is supported by a number of build tools (including many conan / vcpkg packages). This may make the existing two integrations redundant one day, but for now I've just added it as an additional source.Sample output finding
libuvwith--verbose=4(the library is provided bynix, thus the long paths):