Skip to content

pkg-config: share before lib, also only request mirage-solo5 (which h…#676

Merged
hannesm merged 1 commit intomirage:masterfrom
hannesm:sort-pkgconfig
Nov 14, 2016
Merged

pkg-config: share before lib, also only request mirage-solo5 (which h…#676
hannesm merged 1 commit intomirage:masterfrom
hannesm:sort-pkgconfig

Conversation

@hannesm
Copy link
Copy Markdown
Member

@hannesm hannesm commented Nov 14, 2016

…as ocaml-freestanding as dependency)

/cc @mato

@mato
Copy link
Copy Markdown
Contributor

mato commented Nov 14, 2016

LGTM

mato added a commit to mato/mirage-solo5 that referenced this pull request Nov 14, 2016
@hannesm hannesm merged commit 51478fa into mirage:master Nov 14, 2016
@hannesm hannesm deleted the sort-pkgconfig branch November 14, 2016 23:59
@pqwy
Copy link
Copy Markdown
Contributor

pqwy commented Nov 15, 2016

Are you sure that going against the normal behavior of pkg-config is a good solution to whatever problem you were having?

@mato
Copy link
Copy Markdown
Contributor

mato commented Nov 15, 2016

Sorry for the rather terse PRs. It's not normal behaviour. We're working around a bug in pkg-config which AFAICT was exposed by the use of multiple directories in PKG_CONFIG_PATH and resulted in the link order for Solo5 unikernels being wrong (libmirage-solo5_bindings.a was placed after the ocaml-freestanding asmrun.a).

Best as I can tell(*) the bug only affects pkg-config versions prior to 0.28 from January 2013, unfortunately Ubuntu 14.04 (used by Travis) ships 0.26(!). @hannesm has also verified that this does not break on FreeBSD which uses it's own pkg-conf reimplementation of pkg-config.

(*) I think this is the commit that fixes the pkg-config bug: https://cgit.freedesktop.org/pkg-config/commit/?id=6ecf318c927ffe89a028b8b9cb70d0535673c550

<rant>
Our use of pkg-config is a house of cards in any case, since we depend on the system pkg-config and then manipulate it's search path via PKG_CONFIG_PATH.

A possible improvement might be to ship our own build of pkg-config (or the FreeBSD implementation thereof) as part of conf-pkg-config with the correct paths already set and call it something like opam-pkg-config. This could then be replaced with a thin wrapper over per-package variables for OPAM 2.0.
</rant>

/cc FYI @avsm @yomimono @talex5

@hannesm
Copy link
Copy Markdown
Member Author

hannesm commented Nov 15, 2016

Thanks for this explanation @mato. I would suggest to use it as is for now, and make a switch over to opam 2.0 once that is available and stable. No need to work on improving the pkg-config situation in the meantime (as it is right now it seems to work on the platforms we're interested in).

@mato
Copy link
Copy Markdown
Contributor

mato commented Nov 15, 2016

I agree, unless it breaks again in some unforeseen way, in which case we'll need to fix it properly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants