Skip to content

feat: add support for pkg-config #2555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2020
Merged

Conversation

wolffcm
Copy link

@wolffcm wolffcm commented Feb 24, 2020

This patch adds support for pkg-config, so that when go build is
invoked, libflux is built as part of finding the path to the library.

@wolffcm wolffcm force-pushed the feat/pkg-config-support branch 5 times, most recently from 8ee1f46 to a1f2f3e Compare February 25, 2020 19:47
Copy link
Contributor

@jsternberg jsternberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment on improving the makefile but it looks good otherwise.

@wolffcm wolffcm force-pushed the feat/pkg-config-support branch 5 times, most recently from 3e74676 to b652872 Compare February 26, 2020 22:34
@jsternberg jsternberg force-pushed the feat/pkg-config-support branch from a0309e3 to 2cab465 Compare February 27, 2020 15:22
rockstar and others added 2 commits February 27, 2020 08:58
This patch adds support for `pkg-config`, so that when `go build` is
invoked, `libflux` is built as part of finding the path to the library.
 Please enter the commit message for your changes. Lines starting

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Restoring and saving the gocache seems to interfere with `pkg-config`.
In the future, we can try to build `pkg-config` in a way where this
doesn't happen, but we don't get a lot of benefit from restoring the
gocache anyway so there isn't a lot of reason to save it.

The problem is that go will run `pkg-config --libs` to obtain the
library linker flags when it compiles the static library for a
dependency. When it links the final binary, it then uses the libraries
saved from that invocation. It caches this output inside of the gocache
and doesn't rerun it unless the package changes.

This causes a unique problem for CI. CI will save the gocache which
contains the build artifact from the go build, but when building flux
locally, it doesn't contain the static libraries that were created by
`pkg-config`. We then run CI again and restore the go build cache. Now,
the library is gone because it was kept in the repository and is no
longer present, but the build cache entry still exists and it doesn't
rerun `pkg-config`.

Since the gocache causes us more trouble than it saves, this eliminates
restoring and saving the gocache. We can fix the underlying problem in
`pkg-config` later at our discretion.
@wolffcm wolffcm force-pushed the feat/pkg-config-support branch from 2cab465 to 831e59e Compare February 27, 2020 17:02
@codecov-io
Copy link

Codecov Report

Merging #2555 into feat/use-algo-w will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           feat/use-algo-w    #2555   +/-   ##
================================================
  Coverage            51.15%   51.15%           
================================================
  Files                  297      297           
  Lines                38132    38132           
================================================
  Hits                 19507    19507           
  Misses               16443    16443           
  Partials              2182     2182
Impacted Files Coverage Δ
libflux/go/libflux/parser.go 50.76% <ø> (ø) ⬆️
libflux/go/libflux/analyze.go 32.81% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f38d6a...831e59e. Read the comment docs.

@wolffcm wolffcm marked this pull request as ready for review February 27, 2020 17:10
@wolffcm wolffcm merged commit d850334 into feat/use-algo-w Feb 27, 2020
@wolffcm wolffcm deleted the feat/pkg-config-support branch February 27, 2020 17:26
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.

None yet

4 participants