Skip to content

Build issues on FreeBSD if two versions of openjpeg are installed #2563

@melvyn-sopacua

Description

@melvyn-sopacua

Related

PR 2554

Recap: /usr/local/include is inserted before /usr/local/include/openjpeg-2.1, which causes problems if two versions of openjpeg are installed.

Observations:

  1. It sometimes succeeds even without the fix in mentioned PR.
  2. The version specific directory is added twice.
  3. When it succeeds, openjpeg is the first package tried.
  4. As a result, converting the inline dict in the for loop in build_extensions to a collections.OrderedDict also resolves the issue.

Root cause

Ordering aside, the root cause is that packages are essentially configured twice in different ways. First pkg-config is used and then best guess directory searches are used to do the same thing.

Possible solutions

If this were to be fixed without the insert override from the PR, then fixing it relies on kits ordering. Not ideal.
A more generic approach is to use the following order of events:

  1. Based on the platform, add the needed "generic" directories, so top-level "lib" and "include" paths.
  2. Go through the pkg-config loop, but always prepend directories (in the reverse order as returned by pkg-config). Set state for found libraries.
  3. Add available libraries, but only those not already configured by pkg-config.

Analysis

Since this braindead OpenJPEG versioning is likely to be an exception, as is having two versions installed, the current fix from the PR looks "good enough" to me, but if maintainers want the approach from above, I'm happy to make a new PR as I'm in a good position to test it.

I do not actually understand, why packages found by pkg-config are revisited in the "feature" code, so that would have to be explained.

P.S.: I pretty much expect the choice will be made to not go for an elaborate fix and as such this issue logs the problem and causes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAny unexpected behavior, until confirmed feature.FreeBSDInstallationUsually a problem with …Library LinkingLinuxPlatformA catchall for platform-related

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions