source: trunk/Makefile

Last change on this file was b4b996c, checked in by Ross Patterson <me@…>, at 2020-09-17T23:09:53Z

build(make): Cleanup remnant coverage bits

I don't see anything in here that I can find references to elsewhere and we're certainly
running test coverage reports in tox and on CI now.

  • Property mode set to 100644
File size: 7.1 KB
Line 
1# Tahoe LFS Development and maintenance tasks
2#
3# NOTE: this Makefile requires GNU make
4
5### Defensive settings for make:
6#     https://tech.davis-hansson.com/p/make/
7SHELL := bash
8.ONESHELL:
9.SHELLFLAGS := -xeu -o pipefail -c
10.SILENT:
11.DELETE_ON_ERROR:
12MAKEFLAGS += --warn-undefined-variables
13MAKEFLAGS += --no-builtin-rules
14
15# Local target variables
16PYTHON=python
17export PYTHON
18PYFLAKES=flake8
19export PYFLAKES
20SOURCES=src/allmydata static misc setup.py
21APPNAME=tahoe-lafs
22
23
24# Top-level, phony targets
25
26.PHONY: default
27default:
28        @echo "no default target"
29
30.PHONY: test
31## Run all tests and code reports
32test: .tox
33        tox -p auto
34
35# This is necessary only if you want to automatically produce a new
36# _version.py file from the current git history (without doing a build).
37.PHONY: make-version
38make-version:
39        $(PYTHON) ./setup.py update_version
40
41# Build OS X pkg packages.
42.PHONY: build-osx-pkg
43build-osx-pkg:
44        misc/build_helpers/build-osx-pkg.sh $(APPNAME)
45
46.PHONY: test-osx-pkg
47test-osx-pkg:
48        $(PYTHON) misc/build_helpers/test-osx-pkg.py
49
50.PHONY: upload-osx-pkg
51upload-osx-pkg:
52        # [Failure instance: Traceback: <class 'OpenSSL.SSL.Error'>: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert unknown ca'), ('SSL routines', 'ssl3_write_bytes', 'ssl handshake failure')]
53        #
54        # @echo "uploading to ~tahoe-tarballs/OS-X-packages/ via flappserver"
55        # @if [ "X${BB_BRANCH}" = "Xmaster" ] || [ "X${BB_BRANCH}" = "X" ]; then \
56        #   flappclient --furlfile ~/.tahoe-osx-pkg-upload.furl upload-file tahoe-lafs-*-osx.pkg; \
57        #  else \
58        #   echo not uploading tahoe-lafs-osx-pkg because this is not trunk but is branch \"${BB_BRANCH}\" ; \
59        # fi
60
61.PHONY: code-checks
62#code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes
63code-checks: check-interfaces check-debugging check-miscaptures -find-trailing-spaces -check-umids pyflakes
64
65.PHONY: check-interfaces
66check-interfaces:
67        $(PYTHON) misc/coding_tools/check-interfaces.py 2>&1 |tee violations.txt
68        @echo
69
70.PHONY: check-debugging
71check-debugging:
72        $(PYTHON) misc/coding_tools/check-debugging.py
73        @echo
74
75.PHONY: check-miscaptures
76check-miscaptures:
77        $(PYTHON) misc/coding_tools/check-miscaptures.py $(SOURCES) 2>&1 |tee miscaptures.txt
78        @echo
79
80.PHONY: pyflakes
81pyflakes:
82        $(PYFLAKES) $(SOURCES) |sort |uniq
83        @echo
84
85.PHONY: check-umids
86check-umids:
87        $(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
88        @echo
89
90.PHONY: -check-umids
91-check-umids:
92        -$(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
93        @echo
94
95.PHONY: doc-checks
96doc-checks: check-rst
97
98.PHONY: check-rst
99check-rst:
100        @for x in `find *.rst docs -name "*.rst"`; do rst2html -v $${x} >/dev/null; done 2>&1 |grep -v 'Duplicate implicit target name:'
101        @echo
102
103.PHONY: count-lines
104count-lines:
105        @echo -n "files: "
106        @find src -name '*.py' |grep -v /build/ |wc -l
107        @echo -n "lines: "
108        @cat `find src -name '*.py' |grep -v /build/` |wc -l
109        @echo -n "TODO: "
110        @grep TODO `find src -name '*.py' |grep -v /build/` | wc -l
111        @echo -n "XXX: "
112        @grep XXX `find src -name '*.py' |grep -v /build/` | wc -l
113
114
115# Here is a list of testing tools that can be run with 'python' from a
116# virtualenv in which Tahoe has been installed. There used to be Makefile
117# targets for each, but the exact path to a suitable python is now up to the
118# developer. But as a hint, after running 'tox', ./.tox/py27/bin/python will
119# probably work.
120
121# src/allmydata/test/bench_dirnode.py
122
123
124# The check-speed and check-grid targets are disabled, since they depend upon
125# the pre-located $(TAHOE) executable that was removed when we switched to
126# tox. They will eventually be resurrected as dedicated tox environments.
127
128# The check-speed target uses a pre-established client node to run a canned
129# set of performance tests against a test network that is also
130# pre-established (probably on a remote machine). Provide it with the path to
131# a local directory where this client node has been created (and populated
132# with the necessary FURLs of the test network). This target will start that
133# client with the current code and then run the tests. Afterwards it will
134# stop the client.
135#
136# The 'sleep 5' is in there to give the new client a chance to connect to its
137# storageservers, since check_speed.py has no good way of doing that itself.
138
139##.PHONY: check-speed
140##check-speed: .built
141##      if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
142##      @echo "stopping any leftover client code"
143##      -$(TAHOE) stop $(TESTCLIENTDIR)
144##      $(TAHOE) start $(TESTCLIENTDIR)
145##      sleep 5
146##      $(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)
147##      $(TAHOE) stop $(TESTCLIENTDIR)
148
149# The check-grid target also uses a pre-established client node, along with a
150# long-term directory that contains some well-known files. See the docstring
151# in src/allmydata/test/check_grid.py to see how to set this up.
152##.PHONY: check-grid
153##check-grid: .built
154##      if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
155##      $(TAHOE) @src/allmydata/test/check_grid.py $(TESTCLIENTDIR) bin/tahoe
156
157.PHONY: test-get-ignore
158test-git-ignore:
159        $(MAKE)
160        $(PYTHON) misc/build_helpers/test-git-ignore.py
161
162.PHONY: test-clean
163test-clean:
164        find . |grep -vEe "allfiles.tmp|src/allmydata/_(version|appname).py" |sort >allfiles.tmp.old
165        $(MAKE)
166        $(MAKE) distclean
167        find . |grep -vEe "allfiles.tmp|src/allmydata/_(version|appname).py" |sort >allfiles.tmp.new
168        diff allfiles.tmp.old allfiles.tmp.new
169
170# It would be nice if 'make clean' deleted any automatically-generated
171# _version.py too, so that 'make clean; make all' could be useable as a
172# "what the heck is going on, get me back to a clean state', but we need
173# 'make clean' to work on non-checkout trees without destroying useful information.
174# Use 'make distclean' instead to delete all generated files.
175.PHONY: clean
176clean:
177        rm -rf build _trial_temp _test_memory .built
178        rm -f `find src *.egg -name '*.so' -or -name '*.pyc'`
179        rm -rf support dist
180        rm -rf `ls -d *.egg | grep -vEe"setuptools-|setuptools_darcs-|darcsver-"`
181        rm -rf *.pyc
182        rm -f bin/tahoe bin/tahoe.pyscript
183        rm -f *.pkg
184
185.PHONY: distclean
186distclean: clean
187        rm -rf src/*.egg-info
188        rm -f src/allmydata/_version.py
189        rm -f src/allmydata/_appname.py
190        rm -rf ./.tox/
191
192
193.PHONY: find-trailing-spaces
194find-trailing-spaces:
195        $(PYTHON) misc/coding_tools/find-trailing-spaces.py -r $(SOURCES)
196        @echo
197
198.PHONY: -find-trailing-spaces
199-find-trailing-spaces:
200        -$(PYTHON) misc/coding_tools/find-trailing-spaces.py -r $(SOURCES)
201        @echo
202
203.PHONY: fetch-and-unpack-deps
204fetch-and-unpack-deps:
205        @echo "test-and-unpack-deps is obsolete"
206
207.PHONY: test-desert-island
208test-desert-island:
209        @echo "test-desert-island is obsolete"
210
211.PHONY: test-pip-install
212test-pip-install:
213        @echo "test-pip-install is obsolete"
214
215# TARBALL GENERATION
216.PHONY: tarballs
217tarballs: # delegated to tox, so setup.py can update setuptools if needed
218        tox -e tarballs
219
220.PHONY: upload-tarballs
221upload-tarballs:
222        @if [ "X${BB_BRANCH}" = "Xmaster" ] || [ "X${BB_BRANCH}" = "X" ]; then for f in dist/*; do flappclient --furlfile ~/.tahoe-tarball-upload.furl upload-file $$f; done ; else echo not uploading tarballs because this is not trunk but is branch \"${BB_BRANCH}\" ; fi
223
224
225# Real targets
226
227src/allmydata/_version.py:
228        $(MAKE) make-version
229
230.tox: tox.ini setup.py
231        tox --notest -p all
Note: See TracBrowser for help on using the repository browser.