Skip to content

Commit a0309e3

Browse files
committedFeb 27, 2020
ci: do not restore or save the gocache
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. do not restore or save the cache this may interfere with pkg-config. ignore the pkg-config log for git eliminate restoring and saving the go cache
1 parent 8a0e0d2 commit a0309e3

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed
 

‎.circleci/config.yml

-13
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ jobs:
1111
SCCACHE_CACHE_SIZE: 1G
1212
steps:
1313
- checkout
14-
# Populate GOCACHE.
15-
- restore_cache:
16-
name: Restoring GOCACHE
17-
keys:
18-
- flux-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
19-
- flux-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
20-
- flux-gocache- # Matches a new branch.
2114
# Populate GOPATH/pkg.
2215
- restore_cache:
2316
name: Restoring GOPATH/pkg/mod
@@ -42,12 +35,6 @@ jobs:
4235
name: Uploading coverage report
4336
command: |
4437
bash <(curl -s https://codecov.io/bash)
45-
- save_cache:
46-
name: Saving GOCACHE
47-
key: flux-gocache-{{ .Branch }}-{{ .Revision }}
48-
paths:
49-
- /tmp/go-cache
50-
when: always
5138
- save_cache:
5239
name: Saving GOPATH/pkg/mod
5340
key: flux-gomod-{{checksum "go.sum"}}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ target
1414
/libflux/site/node_modules
1515
/libflux/.cache
1616
/release-notes.txt
17+
/pkg-config.log

0 commit comments

Comments
 (0)