From 27f73fa7e4b59412b56884922e0709fffe6b7552 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sun, 3 Mar 2019 20:00:51 +0100 Subject: [PATCH] gomod: use test binaries from go modules License: MIT Signed-off-by: Jakub Sztandera --- go.mod | 2 ++ go.sum | 4 ++++ mk/golang.mk | 4 ++++ test/bin/Rules.mk | 22 +++++++--------------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 2ea365ef5..89386383f 100644 --- a/go.mod +++ b/go.mod @@ -54,11 +54,13 @@ require ( github.com/ipfs/go-path v0.0.1 github.com/ipfs/go-unixfs v0.0.1 github.com/ipfs/go-verifcid v0.0.1 + github.com/ipfs/hang-fds v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.0.1 github.com/ipfs/iptb v1.4.0 github.com/ipfs/iptb-plugins v0.0.1 github.com/jbenet/go-is-domain v0.0.0-20160119110217-ba9815c809e0 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c + github.com/jbenet/go-random-files v0.0.0-20190219210431-31b3f20ebded github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2 github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8 github.com/libp2p/go-libp2p v0.0.1 diff --git a/go.sum b/go.sum index ccee53066..64a932420 100644 --- a/go.sum +++ b/go.sum @@ -185,6 +185,8 @@ github.com/ipfs/go-unixfs v0.0.1 h1:CTTGqLxU5+PRkkeA+w1peStqRWFD1Kya+yZgIT4Xy1w= github.com/ipfs/go-unixfs v0.0.1/go.mod h1:ZlB83nMtxNMx4DAAE5/GixeKN1qHC+xspBksI7Q5NeI= github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= +github.com/ipfs/hang-fds v0.0.1 h1:KGAxiGtJPT3THVRNT6yxgpdFPeX4ZemUjENOt6NlOn4= +github.com/ipfs/hang-fds v0.0.1/go.mod h1:U4JNbzwTpk/qP2Ms4VgrZ4HcgJGVosBJqMXvwe4udSY= github.com/ipfs/interface-go-ipfs-core v0.0.1 h1:IlAKkUPyw77UECt25WymL72A4KO+BGCMULKfMfc2R5g= github.com/ipfs/interface-go-ipfs-core v0.0.1/go.mod h1:CbFOGVGV8B4NCA0fAO2VVZ1Jt/ZQYE3FzTC6nLVqiAE= github.com/ipfs/iptb v1.4.0 h1:YFYTrCkLMRwk/35IMyC6+yjoQSHTEcNcefBStLJzgvo= @@ -203,6 +205,8 @@ github.com/jbenet/go-is-domain v0.0.0-20160119110217-ba9815c809e0 h1:qxMncUW0TzV github.com/jbenet/go-is-domain v0.0.0-20160119110217-ba9815c809e0/go.mod h1:I9DYFcJAixF5f9iOu/9oC451/bq+QDTaLGznkcJPWgg= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c/go.mod h1:sdx1xVM9UuLw1tXnhJWN3piypTUO3vCIHYmG15KE/dU= +github.com/jbenet/go-random-files v0.0.0-20190219210431-31b3f20ebded h1:fHCa28iw+qaRWZK4IqrntHxXALD5kKr/ESrpOCRRdrg= +github.com/jbenet/go-random-files v0.0.0-20190219210431-31b3f20ebded/go.mod h1:FKvZrl5nnaGnTAMewcq0i7wM5zHD75e0lwlnF8q46uo= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2 h1:vhC1OXXiT9R2pczegwz6moDvuRpggaroAXhPIseh57A= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8 h1:bspPhN+oKYFk5fcGNuQzp6IGzYQSenLEgH3s6jkXrWw= diff --git a/mk/golang.mk b/mk/golang.mk index cc5955715..763d516b2 100644 --- a/mk/golang.mk +++ b/mk/golang.mk @@ -30,6 +30,10 @@ define go-build-relative $(GOCC) build $(go-flags-with-tags) -o "$@" "$(call go-pkg-name,$<)" endef +define go-build +$(GOCC) build $(go-flags-with-tags) -o "$@" "$(1)" +endef + define go-try-build $(GOCC) build $(go-flags-with-tags) -o /dev/null "$(call go-pkg-name,$<)" endef diff --git a/test/bin/Rules.mk b/test/bin/Rules.mk index 215c093e2..9425f4d89 100644 --- a/test/bin/Rules.mk +++ b/test/bin/Rules.mk @@ -26,32 +26,24 @@ $(d)/json-to-junit: test/dependencies/json-to-junit $(go-build-relative) TGTS_$(d) += $(d)/json-to-junit -TGTS_GX_$(d) := hang-fds -TGTS_GX_$(d) := $(addprefix $(d)/,$(TGTS_GX_$(d))) +$(d)/hang-fds: + $(call go-build,github.com/ipfs/hang-fds) +TGTS_$(d) += $(d)/hang-fds -$(TGTS_GX_$(d)): - go build $(go-flags-with-tags) -o "$@" "$(call gx-path,$(notdir $@))" - -TGTS_$(d) += $(TGTS_GX_$(d)) - -# multihash is special $(d)/multihash: - go build $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-multihash)/go-multihash/multihash" + $(call go-build,github.com/multiformats/go-multihash/multihash) TGTS_$(d) += $(d)/multihash -# cid-fmt is also special $(d)/cid-fmt: - go build $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-cidutil)/go-cidutil/cid-fmt" + $(call go-build,github.com/ipfs/go-cidutil/cid-fmt) TGTS_$(d) += $(d)/cid-fmt -# random is also special $(d)/random: - go build -i $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-random)/go-random/random" + $(call go-build,github.com/jbenet/go-random/random) TGTS_$(d) += $(d)/random -# random-files is also special $(d)/random-files: - go build -i $(go-flags-with-tags) -o "$@" "gx/ipfs/$(shell gx deps find go-random-files)/go-random-files/random-files" + $(call go-build,github.com/jbenet/go-random-files/random-files) TGTS_$(d) += $(d)/random-files