Skip to content

Commit d850334

Browse files
Christopher M. Wolffjsternberg
Christopher M. Wolff
andauthoredFeb 27, 2020
feat: add support for pkg-config (#2555)
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. 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. Co-authored-by: Jonathan A. Sternberg <jonathan@influxdata.com>
1 parent 9f38d6a commit d850334

File tree

18 files changed

+85
-616
lines changed

18 files changed

+85
-616
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
@@ -9,6 +9,7 @@ target
99
.tern-project
1010
.idea
1111
/coverage.txt
12+
/libflux/lib
1213
/libflux/pkg
1314
/libflux/site/node_modules
1415
/libflux/.cache

‎Makefile

+19-77
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
# This Makefile encodes the "go generate" prerequisites ensuring that the proper tooling is installed and
22
# that the generate steps are executed when their prerequeisites files change.
3-
#
4-
# This Makefile follows a few conventions:
5-
#
6-
# * All cmds must be added to this top level Makefile.
7-
# * All binaries are placed in ./bin, its recommended to add this directory to your PATH.
8-
# * Each package that has a need to run go generate, must have its own Makefile for that purpose.
9-
# * All recursive Makefiles must support the targets: generate and clean.
10-
#
113

124
SHELL := /bin/bash
135

146
GO_TAGS=
157
GO_ARGS=-tags '$(GO_TAGS)'
168

17-
# Test vars can be used by all recursive Makefiles
9+
# This invokes a custom package config during Go builds, such that
10+
# the Rust library libflux is built on the fly.
11+
export PKG_CONFIG:=$(PWD)/pkg-config.sh
12+
1813
export GOOS=$(shell go env GOOS)
19-
export GO_BUILD=env FLUX_PARSER_TYPE=rust GO111MODULE=on go build $(GO_ARGS)
20-
export GO_TEST=env FLUX_PARSER_TYPE=rust GO111MODULE=on go test $(GO_ARGS)
14+
export GO_BUILD=env GO111MODULE=on go build $(GO_ARGS)
15+
export GO_TEST=env GO111MODULE=on go test $(GO_ARGS)
2116
export GO_TEST_FLAGS=
2217
# Do not add GO111MODULE=on to the call to go generate so it doesn't pollute the environment.
2318
export GO_GENERATE=go generate $(GO_ARGS)
24-
export GO_VET=env FLUX_PARSER_TYPE=rust GO111MODULE=on go vet $(GO_ARGS)
19+
export GO_VET=env GO111MODULE=on go vet $(GO_ARGS)
2520
export CARGO=cargo
2621
export CARGO_ARGS=
2722

@@ -40,10 +35,12 @@ GENERATED_TARGETS = \
4035
stdlib/packages.go \
4136
semantic/flatbuffers_gen.go \
4237
semantic/internal/fbsemantic/semantic_generated.go \
38+
$(LIBFLUX_GENERATED_TARGETS)
39+
40+
LIBFLUX_GENERATED_TARGETS = \
4341
libflux/src/flux/ast/flatbuffers/ast_generated.rs \
4442
libflux/src/flux/semantic/flatbuffers/semantic_generated.rs \
45-
libflux/scanner.c \
46-
libflux/go/libflux/flux.h
43+
libflux/scanner.c
4744

4845
generate: $(GENERATED_TARGETS)
4946

@@ -62,72 +59,18 @@ libflux/src/flux/semantic/flatbuffers/semantic_generated.rs: semantic/semantic.f
6259
ast/asttest/cmpopts.go: ast/ast.go ast/asttest/gen.go $$(call go_deps,./internal/cmd/cmpgen)
6360
$(GO_GENERATE) ./ast/asttest
6461

65-
stdlib/packages.go: libflux-go $(STDLIB_SOURCES)
62+
stdlib/packages.go: $(STDLIB_SOURCES) $(LIBFLUX_GENERATED_TARGETS)
6663
$(GO_GENERATE) ./stdlib
6764

6865
internal/scanner/unicode.rl: internal/scanner/unicode2ragel.rb
6966
cd internal/scanner && ruby unicode2ragel.rb -e utf8 -o unicode.rl
7067
internal/scanner/scanner.gen.go: internal/scanner/gen.go internal/scanner/scanner.rl internal/scanner/unicode.rl
7168
$(GO_GENERATE) ./internal/scanner
7269

73-
libflux: libflux/target/debug/libflux.a libflux/target/debug/liblibstd.a
74-
75-
libflux-go: libflux libflux/go/libflux/flux.h
76-
77-
# Build the rust static library. Afterwards, fix the .d file that
78-
# rust generates so it references the correct targets.
79-
# The unix sed, which is on darwin machines, has a different
80-
# command line interface than the gnu equivalent.
81-
libflux/target/debug/libflux.a: libflux/scanner.c libflux/src/flux/ast/flatbuffers/ast_generated.rs libflux/src/flux/semantic/flatbuffers/semantic_generated.rs
82-
cd libflux && $(CARGO) build -p flux $(CARGO_ARGS)
83-
84-
libflux/target/debug/liblibstd.a:
85-
cd libflux && $(CARGO) build -p libstd $(CARGO_ARGS)
86-
87-
libflux/go/libflux/flux.h: libflux/include/influxdata/flux.h
88-
$(GO_GENERATE) ./libflux/go/libflux
89-
90-
# The dependency file produced by Rust appears to be wrong and uses
91-
# absolute paths while we use relative paths everywhere. So we need
92-
# to do some post processing of the file to ensure that the
93-
# dependencies we load are correct. But, we do not want to trigger
94-
# a rust build just to load the dependencies since we may not need
95-
# to build the static library to begin with.
96-
# It is good enough for us to include this target so that the makefile
97-
# doesn't error when the file doesn't exist. It does not actually
98-
# have to create the file, just promise that the file will be created.
99-
# If the .d file does not exist, then the .a file above also
100-
# does not exist so the dependencies don't matter. If the .d file
101-
# exists, this will never get called or, at a minimum, it won't modify
102-
# the files at all. This allows the target below to depend on this
103-
# file without the file necessarily existing and it will force
104-
# post-processing of the file if the .d file is newer than our
105-
# post-processed .deps file.
106-
libflux/target/debug/libflux.d:
107-
108-
libflux/target/debug/libflux.deps: libflux/target/debug/libflux.d
109-
@if [ -e "$<" ]; then \
110-
sed -e "s@${CURDIR}/@@g" -e "s@debug/debug@debug@g" -e "s@\\.dylib@.a@g" -e "s@\\.so@.a@g" $< > $@; \
111-
fi
112-
# Conditionally include the libflux.deps file so if any of the
113-
# source files are modified, they are considered when deciding
114-
# whether to rebuild the library.
115-
-include libflux/target/debug/libflux.deps
116-
117-
# Handle dependencies for liblibstd similar to how we handle them
118-
# for libflux, above.
119-
libflux/target/debug/liblibstd.d:
120-
121-
libflux/target/debug/liblibstd.deps: libflux/target/debug/liblibstd.d
122-
@if [ -e "$<" ]; then \
123-
sed -e "s@${CURDIR}/@@g" -e "s@debug/debug@debug@g" -e "s@\\.dylib@.a@g" -e "s@\\.so@.a@g" $< > $@; \
124-
fi
125-
# Conditionally include the liblibstd.deps file so if any of the
126-
# source files are modified, they are considered when deciding
127-
# whether to rebuild the library.
128-
-include libflux/target/debug/liblibstd.deps
129-
130-
build: libflux
70+
libflux: $(LIBFLUX_GENERATED_TARGETS)
71+
cd libflux && $(CARGO) build $(CARGO_ARGS)
72+
73+
build:
13174
$(GO_BUILD) ./...
13275

13376
clean:
@@ -159,16 +102,16 @@ staticcheck:
159102

160103
test: test-go test-rust
161104

162-
test-go: libflux
105+
test-go:
163106
$(GO_TEST) $(GO_TEST_FLAGS) ./...
164107

165108
test-rust:
166109
cd libflux && $(CARGO) test $(CARGO_ARGS) && $(CARGO) clippy $(CARGO_ARGS) -- -Dclippy::all
167110

168-
test-race: libflux
111+
test-race:
169112
$(GO_TEST) -race -count=1 ./...
170113

171-
test-bench: libflux
114+
test-bench:
172115
$(GO_TEST) -run=NONE -bench=. -benchtime=1x ./...
173116

174117
vet: libflux
@@ -192,7 +135,6 @@ libflux-wasm:
192135
build \
193136
default \
194137
libflux \
195-
libflux-go \
196138
libflux-wasm \
197139
fmt \
198140
checkfmt \

‎README.md

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ The specification contains many examples to start learning Flux.
1515

1616
Flux is currently available in InfluxDB 1.7 and 2.0 or through the REPL that can be compiled from this repository.
1717

18+
To build flux, first install the `pkg-config` utility, and ensure the GNU `pkg-config` utility is also installed.
19+
20+
```
21+
$ go get github.com/influxdata/pkg-config
22+
```
23+
1824
To compile the REPL, use the following command:
1925

2026
```

‎go.mod

+3-7
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ require (
1717
github.com/google/go-cmp v0.3.0
1818
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1919
github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e
20+
github.com/influxdata/pkg-config v0.0.0-20200220204715-6668c8414ecc
2021
github.com/influxdata/promql/v2 v2.12.0
2122
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9
22-
github.com/kr/pretty v0.1.0 // indirect
2323
github.com/lib/pq v1.0.0
2424
github.com/mattn/go-colorable v0.0.9 // indirect
2525
github.com/mattn/go-isatty v0.0.4 // indirect
@@ -29,22 +29,18 @@ require (
2929
github.com/matttproud/golang_protobuf_extensions v1.0.1
3030
github.com/opentracing/opentracing-go v1.0.2
3131
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
32-
github.com/pkg/errors v0.8.1
32+
github.com/pkg/errors v0.9.1
3333
github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 // indirect
3434
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
3535
github.com/prometheus/common v0.6.0
3636
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
3737
github.com/segmentio/kafka-go v0.1.0
3838
github.com/sergi/go-diff v1.0.0 // indirect
3939
github.com/spf13/cobra v0.0.3
40-
github.com/spf13/pflag v1.0.3
41-
go.uber.org/atomic v1.3.2 // indirect
42-
go.uber.org/multierr v1.1.0 // indirect
4340
go.uber.org/zap v1.9.1
4441
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522
4542
golang.org/x/net v0.0.0-20190620200207-3b0461eec859
46-
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0
43+
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5
4744
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca
4845
google.golang.org/api v0.7.0
49-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
5046
)

‎go.sum

+28-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
88
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
99
github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08=
1010
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
11+
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
12+
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
1113
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
1214
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
1315
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
@@ -66,6 +68,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
6668
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
6769
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
6870
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
71+
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
6972
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
7073
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
7174
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
@@ -76,13 +79,16 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
7679
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
7780
github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e h1:/o3vQtpWJhvnIbXley4/jwzzqNeigJK9z+LZcJZ9zfM=
7881
github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE=
82+
github.com/influxdata/pkg-config v0.0.0-20200220204715-6668c8414ecc h1:pElO9WTD6i3zvhcKFYFW2176JF51kOvdKNdGABVLZPc=
83+
github.com/influxdata/pkg-config v0.0.0-20200220204715-6668c8414ecc/go.mod h1:EMS7Ll0S4qkzDk53XS3Z72/egBsPInt+BeRxb0WeSwk=
7984
github.com/influxdata/promql/v2 v2.12.0 h1:kXn3p0D7zPw16rOtfDR+wo6aaiH8tSMfhPwONTxrlEc=
8085
github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
8186
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9 h1:MHTrDWmQpHq/hkq+7cw9oYAt2PqUw52TZazRA0N7PGE=
8287
github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0=
8388
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
8489
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
8590
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
91+
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
8692
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
8793
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
8894
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
@@ -115,6 +121,8 @@ github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
115121
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
116122
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
117123
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
124+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
125+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
118126
github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5 h1:tFwafIEMf0B7NlcxV/zJ6leBIa81D3hgGSgsE5hCkOQ=
119127
github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
120128
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -129,6 +137,7 @@ github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkp
129137
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
130138
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
131139
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
140+
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
132141
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
133142
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
134143
github.com/segmentio/kafka-go v0.1.0 h1:IXCHG+sXPNiIR5pC/vTEItZduPKu4cnpr85YgxpxlW0=
@@ -154,15 +163,19 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
154163
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
155164
go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4=
156165
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
157-
go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
158-
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
159-
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
160-
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
166+
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
167+
go.uber.org/atomic v1.5.1 h1:rsqfU5vBkVknbhUGbAUwQKR2H4ItV8tjJ+6kJX4cxHM=
168+
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
169+
go.uber.org/multierr v1.4.0 h1:f3WCSC2KzAcBXGATIxAB1E2XuCpNU255wNKZ505qi3E=
170+
go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
171+
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
172+
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
161173
go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
162174
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
163175
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
164176
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
165177
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
178+
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
166179
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU=
167180
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
168181
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de h1:xSjD6HQTqT0H/k60N5yYBtnN1OEkVy7WIo/DYyxKRO0=
@@ -176,7 +189,10 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
176189
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
177190
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
178191
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
192+
golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
193+
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
179194
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
195+
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
180196
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
181197
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
182198
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -236,8 +252,13 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3
236252
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
237253
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
238254
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
255+
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
239256
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0 h1:Dh6fw+p6FyRl5x/FvNswO1ji0lIGzm3KP8Y9VkS9PTE=
240257
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
258+
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
259+
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
260+
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
261+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
241262
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca h1:PupagGYwj8+I4ubCxcmcBRk3VlUWtTg5huQpZR9flmE=
242263
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
243264
gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6 h1:4WsZyVtkthqrHTbDCJfiTs8IWNYE4uvsSDgaV6xpp+o=
@@ -265,6 +286,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
265286
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
266287
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
267288
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
289+
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
268290
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
269291
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
270292
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
@@ -273,5 +295,7 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
273295
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
274296
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a h1:LJwr7TCTghdatWv40WobzlKXc9c4s8oGa7QKJUtHhWA=
275297
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
298+
honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=
299+
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
276300
rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=
277301
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=

‎internal/cmd/flux-config/build.go

-326
This file was deleted.

‎internal/cmd/flux-config/main.go

-68
This file was deleted.

‎libflux/go/libflux/analyze.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package libflux
22

3-
// #cgo CFLAGS: -I.
4-
// #cgo LDFLAGS: -L. -llibstd
5-
// #include "flux.h"
3+
// #include "influxdata/flux.h"
64
// #include <stdlib.h>
75
import "C"
86

‎libflux/go/libflux/flux.h

-105
This file was deleted.

‎libflux/go/libflux/libflux.a

-1
This file was deleted.

‎libflux/go/libflux/liblibstd.a

-1
This file was deleted.

‎libflux/go/libflux/parser.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package libflux
22

3-
// #cgo CFLAGS: -I.
4-
// #cgo LDFLAGS: -L. -lflux
5-
// #include "flux.h"
3+
// #cgo pkg-config: flux
4+
// #include "influxdata/flux.h"
65
// #include <stdlib.h>
76
import "C"
87

@@ -15,8 +14,6 @@ import (
1514
"github.com/influxdata/flux/internal/errors"
1615
)
1716

18-
//go:generate cp ../../include/influxdata/flux.h flux.h
19-
2017
// freeable indicates a resource that has memory
2118
// allocated to it outside of Go and must be freed.
2219
type freeable interface {

‎libflux/go/libflux/parser_linux.go

-4
This file was deleted.

‎libflux/src/flux/semantic/bootstrap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn infer_stdlib() -> Result<
7979
> {
8080
let (builtins, mut f) = builtin_types()?;
8181

82-
let files = file_map(parse_flux_files("../../stdlib")?);
82+
let files = file_map(parse_flux_files("../../../stdlib")?);
8383

8484
let (prelude, importer) = infer_pre(&mut f, &files, &builtins)?;
8585
let importer = infer_std(&mut f, &files, &builtins, prelude.clone(), importer)?;

‎libflux/stdlib

-1
This file was deleted.

‎pkg-config.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
tmpdir=$(mktemp -d)
4+
trap "{ rm -rf ${tmpdir}; }" EXIT
5+
6+
# "go build" can be noisy, and when Go invokes pkg-config (by calling this script) it will merge stdout and stderr.
7+
# Discard any output unless "go build" terminates with an error.
8+
go build -o ${tmpdir}/pkg-config github.com/influxdata/pkg-config &> ${tmpdir}/go_build_output
9+
if [ "$?" -ne 0 ]; then
10+
cat ${tmpdir}/go_build_output 1>&2
11+
exit 1
12+
fi
13+
14+
${tmpdir}/pkg-config "$@"

‎tools/tools.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// +build tools
2+
3+
package tools
4+
5+
import (
6+
_ "github.com/influxdata/pkg-config"
7+
)
8+
9+
// This package specifies the list of go tool dependencies that downstream
10+
// dependencies will need to build Flux.

0 commit comments

Comments
 (0)
Please sign in to comment.