forked from libbitcoin/libbitcoin-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.py
81 lines (60 loc) · 4 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import copy
import os
import cpuid
import platform
from ci_utils import get_builder, handle_microarchs, copy_env_vars, filter_valid_exts, filter_marchs_tests
if __name__ == "__main__":
full_build = os.getenv('BITPRIM_FULL_BUILD', '0') == '1'
builder, name = get_builder()
builder.add_common_builds(shared_option_name="%s:shared" % name)
filtered_builds = []
for settings, options, env_vars, build_requires, reference in builder.items:
if settings["build_type"] == "Release" \
and not options["%s:shared" % name]:
copy_env_vars(env_vars)
if os.getenv('BITPRIM_RUN_TESTS', 'false') == 'true':
options["%s:with_tests" % name] = "True"
if full_build:
marchs = filter_valid_exts(str(platform.system()), str(settings["compiler"]), float(str(settings["compiler.version"])), ['x86-64', 'haswell', 'skylake'])
else:
marchs = ["x86-64"]
ci_currency = os.getenv('BITPRIM_CI_CURRENCY', None)
if ci_currency is None:
# opts_bch_keoken = copy.deepcopy(options)
opts_bch_no_keoken = copy.deepcopy(options)
opts_btc = copy.deepcopy(options)
# opts_ltc = copy.deepcopy(options)
# opts_bch_keoken["%s:currency" % name] = "BCH"
# opts_bch_keoken["%s:keoken" % name] = True
# opts_bch_keoken["%s:db" % name] = "full"
opts_bch_no_keoken["%s:currency" % name] = "BCH"
opts_bch_no_keoken["%s:keoken" % name] = False
opts_btc["%s:currency" % name] = "BTC"
# opts_ltc["%s:currency" % name] = "LTC"
opts_btc_full = copy.deepcopy(opts_btc)
opts_btc_full["%s:db" % name] = "full"
opts_bch_full = copy.deepcopy(opts_bch_no_keoken)
opts_bch_full["%s:db" % name] = "full"
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_bch_full, env_vars, build_requires)
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_btc_full, env_vars, build_requires)
# handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_bch_keoken, env_vars, build_requires)
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_bch_no_keoken, env_vars, build_requires)
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_btc, env_vars, build_requires)
# handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_ltc, env_vars, build_requires)
else:
options["%s:currency" % name] = ci_currency
# if ci_currency == "BCH":
# # options_keoken = copy.deepcopy(options)
# # options_keoken["%s:keoken" % name] = True
# # options_keoken["%s:db" % name] = "full"
# opts_bch_domain = copy.deepcopy(options)
# opts_bch_domain["%s:use_domain" % name] = "True"
# handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_bch_domain, env_vars, build_requires)
# # handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, options_keoken, env_vars, build_requires)
opts_db_full = copy.deepcopy(options)
opts_db_full["%s:db" % name] = "full"
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, opts_db_full, env_vars, build_requires)
handle_microarchs("%s:microarchitecture" % name, marchs, filtered_builds, settings, options, env_vars, build_requires)
filter_marchs_tests(name, filtered_builds, ["%s:with_tests" % name])
builder.builds = filtered_builds
builder.run()