Skip to content

Commit 4f06dc8

Browse files
committed
test: remove building from source from get prev releases script
Using the get_previous_releases.py script to build from source only works for releases prior to v29 due to removal of Autotools (in favor of CMake). It also does not support building on Windows, and we are adding support for downloading Windows release binaries in later commits of this PR. As there were no complaints during review, it is assumed nobody uses this functionality.
1 parent cbd8e3d commit 4f06dc8

File tree

4 files changed

+19
-81
lines changed

4 files changed

+19
-81
lines changed

ci/test/03_test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if [ -z "$NO_DEPENDS" ]; then
9999
bash -c "$SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS LOG=1"
100100
fi
101101
if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
102-
test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR"
102+
test/get_previous_releases.py --target-dir "$PREVIOUS_RELEASES_DIR"
103103
fi
104104

105105
BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ build/test/functional/test_runner.py --extended
100100
In order to run backwards compatibility tests, first run:
101101

102102
```
103-
test/get_previous_releases.py -b
103+
test/get_previous_releases.py
104104
```
105105

106106
to download the necessary previous release binaries.

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def bin_dir_from_version(version):
543543
bins_missing = True
544544
if bins_missing:
545545
raise AssertionError("At least one release binary is missing. "
546-
"Previous releases binaries can be downloaded via `test/get_previous_releases.py -b`.")
546+
"Previous releases binaries can be downloaded via `test/get_previous_releases.py`.")
547547
assert_equal(len(extra_confs), num_nodes)
548548
assert_equal(len(extra_args), num_nodes)
549549
assert_equal(len(versions), num_nodes)

test/get_previous_releases.py

Lines changed: 16 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -172,73 +172,24 @@ def download_binary(tag, args) -> int:
172172
return 0
173173

174174

175-
def build_release(tag, args) -> int:
176-
githubUrl = "https://github.com/bitcoin/bitcoin"
177-
if args.remove_dir:
178-
if Path(tag).is_dir():
179-
shutil.rmtree(tag)
180-
if not Path(tag).is_dir():
181-
# fetch new tags
182-
subprocess.run(
183-
["git", "fetch", githubUrl, "--tags"])
184-
output = subprocess.check_output(['git', 'tag', '-l', tag])
185-
if not output:
186-
print('Tag {} not found'.format(tag))
187-
return 1
188-
ret = subprocess.run([
189-
'git', 'clone', f'--branch={tag}', '--depth=1', githubUrl, tag
190-
]).returncode
191-
if ret:
192-
return ret
193-
with pushd(tag):
194-
host = args.host
195-
if args.depends:
196-
with pushd('depends'):
197-
ret = subprocess.run(['make', 'NO_QT=1']).returncode
198-
if ret:
199-
return ret
200-
host = os.environ.get(
201-
'HOST', subprocess.check_output(['./config.guess']))
202-
config_flags = '--prefix={pwd}/depends/{host} '.format(
203-
pwd=os.getcwd(),
204-
host=host) + args.config_flags
205-
cmds = [
206-
'./autogen.sh',
207-
'./configure {}'.format(config_flags),
208-
'make',
209-
]
210-
for cmd in cmds:
211-
ret = subprocess.run(cmd.split()).returncode
212-
if ret:
213-
return ret
214-
# Move binaries, so they're in the same place as in the
215-
# release download
216-
Path('bin').mkdir(exist_ok=True)
217-
files = ['bitcoind', 'bitcoin-cli', 'bitcoin-tx']
218-
for f in files:
219-
Path('src/'+f).rename('bin/'+f)
220-
return 0
221-
222-
223175
def check_host(args) -> int:
224176
args.host = os.environ.get('HOST', subprocess.check_output(
225177
'./depends/config.guess').decode())
226-
if args.download_binary:
227-
platforms = {
228-
'aarch64-*-linux*': 'aarch64-linux-gnu',
229-
'powerpc64le-*-linux-*': 'powerpc64le-linux-gnu',
230-
'riscv64-*-linux*': 'riscv64-linux-gnu',
231-
'x86_64-*-linux*': 'x86_64-linux-gnu',
232-
'x86_64-apple-darwin*': 'x86_64-apple-darwin',
233-
'aarch64-apple-darwin*': 'arm64-apple-darwin',
234-
}
235-
args.platform = ''
236-
for pattern, target in platforms.items():
237-
if fnmatch(args.host, pattern):
238-
args.platform = target
239-
if not args.platform:
240-
print('Not sure which binary to download for {}'.format(args.host))
241-
return 1
178+
platforms = {
179+
'aarch64-*-linux*': 'aarch64-linux-gnu',
180+
'powerpc64le-*-linux-*': 'powerpc64le-linux-gnu',
181+
'riscv64-*-linux*': 'riscv64-linux-gnu',
182+
'x86_64-*-linux*': 'x86_64-linux-gnu',
183+
'x86_64-apple-darwin*': 'x86_64-apple-darwin',
184+
'aarch64-apple-darwin*': 'arm64-apple-darwin',
185+
}
186+
args.platform = ''
187+
for pattern, target in platforms.items():
188+
if fnmatch(args.host, pattern):
189+
args.platform = target
190+
if not args.platform:
191+
print('Not sure which binary to download for {}'.format(args.host))
192+
return 1
242193
return 0
243194

244195

@@ -248,18 +199,9 @@ def main(args) -> int:
248199
ret = check_host(args)
249200
if ret:
250201
return ret
251-
if args.download_binary:
252-
with pushd(args.target_dir):
253-
for tag in args.tags:
254-
ret = download_binary(tag, args)
255-
if ret:
256-
return ret
257-
return 0
258-
args.config_flags = os.environ.get('CONFIG_FLAGS', '')
259-
args.config_flags += ' --without-gui --disable-tests --disable-bench'
260202
with pushd(args.target_dir):
261203
for tag in args.tags:
262-
ret = build_release(tag, args)
204+
ret = download_binary(tag, args)
263205
if ret:
264206
return ret
265207
return 0
@@ -270,10 +212,6 @@ def main(args) -> int:
270212
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
271213
parser.add_argument('-r', '--remove-dir', action='store_true',
272214
help='remove existing directory.')
273-
parser.add_argument('-d', '--depends', action='store_true',
274-
help='use depends.')
275-
parser.add_argument('-b', '--download-binary', action='store_true',
276-
help='download release binary.')
277215
parser.add_argument('-t', '--target-dir', action='store',
278216
help='target directory.', default='releases')
279217
all_tags = sorted([*set([v['tag'] for v in SHA256_SUMS.values()])])

0 commit comments

Comments
 (0)