Skip to content

[Bug]: Hardcoded include paths #6110

Description

@meator

Version

3.5.2

Describe the problem you're encountering

Hardcoded include paths are used in several places in couchdb. couchdb is at least considerate enough to check both /usr/include, /usr/local/include and even /opt/homebrew/include/ in the code I reviewed, but this is still insufficient when cross compiling or when building in strange environments like Nix.

The /opt/homebrew/include/ include paths is especially telling. Adding a include path to the hardcoded list of library paths every time a supported target of couchdb needs it is bad.

For example this file includes plenty of hardcoded library paths.

Expected Behaviour

pkg-config should be used to get the appropriate paths. If pkg-config works well on all target environments supported by couchdb, it can fully replace the hardcoded lists, improving the readability and portability of the build system.

Even if pkg-config cannot be used on all supported couchdb systems, the advantages it provides justify it being added as one of the lookup methods (preferably the first) in my opinion. The lookup can fall back to hardcoded paths on systems where pkg-config isn't available.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions