Skip to content

Commit 484c148

Browse files
cgwaltersdustymabe
authored andcommittedSep 13, 2022
Remove tools/, install schematyper on demand
We've had a few build/CI flakes due to the `go install` invocations happening as part of a build. We previously removed `gomarkdoc`, this completes things and stops building/installing `schematyper` by default. It's only need for developers to regenerate the schema; we commit the generated code, so we don't need to build or ship it by default.
1 parent acb4294 commit 484c148

File tree

6 files changed

+19
-38
lines changed

6 files changed

+19
-38
lines changed
 

‎.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ maipo/
88
*.pyo
99
*.shellchecked
1010
.coverage
11-
tools/bin
1211
.idea
1312
bin/

‎Makefile

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ DESTDIR ?=
99
# W504 line break after binary operator
1010
PYIGNORE ?= E128,E241,E402,E501,E722,W503,W504
1111

12-
.PHONY: all check shellcheck flake8 pycheck unittest clean mantle mantle-check install tools
12+
.PHONY: all check shellcheck flake8 pycheck unittest clean mantle mantle-check install
1313

1414
MANTLE_BINARIES := ore kola plume
1515

16-
all: bin/coreos-assembler tools mantle
16+
all: bin/coreos-assembler mantle
1717

1818
src:=$(shell find src -maxdepth 1 -type f -executable -print)
1919
pysources=$(shell find src -type f -name '*.py') $(shell for x in $(src); do if head -1 $$x | grep -q python; then echo $$x; fi; done)
@@ -64,7 +64,6 @@ cosa-go-check:
6464

6565
clean:
6666
rm -f ${src_checked} ${tests_checked} ${cwd_checked}
67-
rm -rf tools/bin
6867
find . -name "*.py[co]" -type f | xargs rm -f
6968
find . -name "__pycache__" -type d | xargs rm -rf
7069

@@ -78,9 +77,6 @@ $(MANTLE_BINARIES) kolet:
7877
mantle-check:
7978
cd mantle && $(MAKE) test
8079

81-
tools:
82-
cd tools && $(MAKE)
83-
8480
.PHONY: schema
8581
schema:
8682
$(MAKE) -C schema
@@ -113,5 +109,4 @@ install:
113109
ln -sf ../lib/coreos-assembler/cp-reflink $(DESTDIR)$(PREFIX)/bin/
114110
ln -sf coreos-assembler $(DESTDIR)$(PREFIX)/bin/cosa
115111
install -d $(DESTDIR)$(PREFIX)/lib/coreos-assembler/tests/kola
116-
cd tools && $(MAKE) install DESTDIR=$(DESTDIR)
117112
cd mantle && $(MAKE) install DESTDIR=$(DESTDIR)

‎gangplank/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = $(shell cd .. && git log -n 1 --date=short --pretty=format:%cs.%h~${st
44
cosa_dir = $(shell test -d /usr/lib/coreos-assembler && echo /usr/lib/coreos-assembler)
55
ldflags=-X main.version=${version} -X main.cosaDir=${cosa_dir}
66
buildtags=containers_image_openpgp
7-
export PATH := $(my_dir)/bin:$(shell readlink -f ../tools/bin):$(PATH)
7+
export PATH := $(my_dir)/bin:$(PATH)
88

99
PREFIX ?= /usr
1010
DESTDIR ?=

‎schema/generate-schema.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -xe
1+
#!/bin/bash
2+
set -euo pipefail
3+
topdir=$(git rev-parse --show-toplevel)
24
mydir=$(dirname $(readlink -f $0))
35
tdir="${mydir}/tmp"
46
mkdir -p "${tdir}"
@@ -11,8 +13,19 @@ echo "Generating COSA Schema ${schema_version}"
1113

1214
out="${tdir}/cosa_${schema_version}.go"
1315

14-
"schematyper" \
15-
"${schema_version}.json" \
16+
schematyper=
17+
if test -f ${topdir}/bin/schematyper; then
18+
schematyper=${topdir}/bin/schematyper
19+
else
20+
schematyper=$(which schematyper 2>/dev/null || true)
21+
fi
22+
if test -z "${schematyper}"; then
23+
env GOBIN=${topdir}/bin go install github.com/idubinskiy/schematyper@latest
24+
schematyper=${topdir}/bin/schematyper
25+
fi
26+
27+
${schematyper} \
28+
${topdir}/src/"${schema_version}.json" \
1629
-o "${out}" \
1730
--package="builds" \
1831
--root-type=Build \

‎tools/Makefile

-20
This file was deleted.

‎tools/README.md

-6
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.