forked from samcamwilliams/HyperBEAM
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathrebar.config
More file actions
269 lines (251 loc) · 8.58 KB
/
Copy pathrebar.config
File metadata and controls
269 lines (251 loc) · 8.58 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
{erl_opts, [
debug_info,
{d, 'COWBOY_QUICER', 1},
{d, 'GUN_QUICER', 1},
{i, "src/core"}
]}.
%% The repo is split into three top-level children under `src':
%% - `src/core' AO-Core runtime, stores, HTTP, Arweave, helpers
%% - `src/forge' device packager, rebar3 providers, tests
%% - `src/preloaded' Erlang sources for the devices baked into the
%% build by the Forge preload pipeline
%% Source files are no longer present at the bare `src/' root, except
%% for `hb.app.src' which rebar3 discovers there before applying the
%% `src_dirs' setting.
{project_app_dirs, ["."]}.
{src_dirs, [
{"src", [{recursive, false}]},
{"src/core", [{recursive, true}]},
{"src/forge", [{recursive, false}]}
]}.
{checkouts_dir, "src/forge"}.
% `hb_test_parallel' is used as a parse_transform by every module that
% includes `hb.hrl' under `-ifdef(TEST)', so it must be compiled first.
{erl_first_files, [
"src/core/test/hb_test_parallel.erl"
]}.
{plugins, [pc, rebar_edown_plugin, {rebar3_eunit_start, {git, "https://github.com/permaweb/rebar3_eunit_start.git", {ref, "04ec53fea187039770db0d4459b7aeb01a9021af"}}}]}.
{project_plugins, [plugin]}.
% Increase `scale_timeouts` when running on a slower machine.
{eunit_opts, [verbose, {scale_timeouts, 10}, {start_applications, [prometheus, hb]}]}.
{profiles, [
{quiet,
[
{eunit_opts, [{verbose, false}, {scale_timeouts, 10}]},
{erl_opts, [{d, 'QUIET', true}]}
]
},
{no_events, [{erl_opts, [{d, 'NO_EVENTS', true}]}]},
{verbose, [{erl_opts, [{d, 'HB_VERBOSE', true}]}]},
{top, [
{deps, [{observer_cli, {git, "https://github.com/permaweb/observer_cli.git",
{ref, "7e7a2613b262e08c43c539d50901e6f26a241b6f"}}}]},
{erl_opts, [{d, 'AO_TOP', true}]},
{relx, [{release, {'hb', "0.0.1"}, [hb, b64veryfast, base32, cowboy, gun, luerl, prometheus, prometheus_cowboy, prometheus_ranch, elmdb, observer_cli, runtime_tools]}]}
]},
{store_events, [{erl_opts, [{d, 'STORE_EVENTS', true}]}]},
{ao_profiling, [{erl_opts, [{d, 'AO_PROFILING', true}]}]},
{eflame,
[
{deps,
[
{eflame,
{git,
"https://github.com/samcamwilliams/eflame.git",
{ref, "d81a6e174956b4b0aca13363d51e4f51a5fabbd2"}
}
}
]
},
{erl_opts, [{d, 'ENABLE_EFLAME', true}]}
]
},
{genesis_wasm, [
{erl_opts, [{d, 'ENABLE_GENESIS_WASM', true}]},
{pre_hooks, [
{compile, "make -C . setup-genesis-wasm"}
]},
{relx, [
{overlay, [
{copy,
"_build/genesis_wasm/genesis-wasm-server",
"genesis-wasm-server"
}
]},
{sys_config, "config/app.config"}
]}
]},
{rocksdb, [
{deps, [{rocksdb, "1.8.0"}]},
{erl_opts, [
{d, 'ENABLE_ROCKSDB', true}
]}
]},
{http3, [
{deps, [
{quicer, {git, "https://github.com/emqx/quic.git",
{ref, "e2e9ab3e1ec53e20d5f9401359cc6ee8f971d112"}}
}
]},
{erl_opts, [
{d, 'ENABLE_HTTP3', true},
{d, 'COWBOY_QUICER', 1},
{d, 'GUN_QUICER', 1}
]},
{overrides, [
{add, cowboy, [{erl_opts, [{d, 'COWBOY_QUICER', 1}]}]},
{add, gun, [{erl_opts, [{d, 'GUN_QUICER', 1}]}]}
]}
]}
]}.
{overrides, [
{override, gun, [{deps, [cowlib]}]}
]}.
{pre_hooks, [
{compile, "make -C . buildinfo"},
{compile, "make -C . wamr"},
{"(linux|darwin)", compile, "make -C native/lib all"},
{"(linux|darwin)", compile, "make -C native/secp256k1 all"}
]}.
{port_env, [
{"(linux|darwin|solaris)", "CFLAGS",
"$CFLAGS -I_build/wamr/core/iwasm/include -I/usr/local/lib/erlang/usr/include/"},
{"(linux|darwin|solaris)", "LDFLAGS", "$LDFLAGS -L_build/wamr/lib -lvmlib -lei"},
{"(linux|darwin|solaris)", "LDLIBS", "-lei"}
]}.
{post_hooks, [
{"(linux|darwin)", clean, "make -C native/secp256k1 clean"},
{"(linux|darwin)", clean, "make -C native/lib secp256k1-clean"},
{"(linux|darwin|solaris)", clean, "make -C . clean-generated"},
{"(linux|darwin|solaris)", compile, "echo 'Post-compile hooks executed'"},
{ compile,
"sh -c '"
"mkdir -p priv/html; "
"cp -pR src/core/html/. priv/html; "
"ELMDB_SRC=_build/default/lib/elmdb/priv/crates/elmdb_nif/elmdb_nif.so; "
"ELMDB_DST=_build/default/lib/elmdb/priv/elmdb_nif.so; "
"if [ -f \"$ELMDB_SRC\" ] && ! cmp -s \"$ELMDB_SRC\" \"$ELMDB_DST\"; "
"then cp \"$ELMDB_SRC\" \"$ELMDB_DST\"; fi"
"'"
},
%% Run the Forge preloader over `src/preloaded' so every build
%% finishes with a `_build/preloaded-store' for the core default
%% config to consume.
{"(linux|darwin|solaris)", compile,
"sh -c '"
"case \"$PWD\" in "
"*/_build/*) ;; "
"*) make -C . preloaded-store ;; "
"esac"
"'"}
]}.
{provider_hooks, [
{pre, [
{eunit, {default, rebar3_eunit_start}}
]},
{post, [
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.
{port_specs, [
{"./priv/hb_beamr.so", [
"./native/hb_beamr/hb_beamr.c",
"./native/hb_beamr/hb_wasm.c",
"./native/hb_beamr/hb_driver.c",
"./native/hb_beamr/hb_helpers.c",
"./native/hb_beamr/hb_logging.c"
]},
{"./priv/hb_keccak.so", [
"./native/hb_keccak/hb_keccak.c",
"./native/hb_keccak/hb_keccak_nif.c"
]},
%% `-O3' (scoped to this port only) lets the compiler auto-vectorize the
%% scalar byte-transform loops -- the whole point of these NIFs. The base
%% `port_env' carries no `-O', so without this they would build at `-O0'
%% and run ~1.5-2.4x slower. Kept off `hb_beamr'/`hb_keccak' deliberately.
{".*", "./priv/hb_util_string.so",
["./native/hb_util_string/hb_util_string.c"],
[{env, [{"CFLAGS", "$CFLAGS -O3"}]}]}
%% secp256k1_arweave.so is built via native/secp256k1/Makefile
]}.
{deps, [
%% elmdb pinned to faa7623 on permaweb/elmdb-rs `feat/read-prefix': adds
%% `elmdb:read_prefix/2' (packed single-buffer row materialization) used by
%% the LMDB composite reads below (edge's 06ccf937 + the read_prefix NIF
%% commits). Repin to the default branch once read_prefix lands there.
{elmdb, {git, "https://github.com/permaweb/elmdb-rs.git", {ref, "faa762323be6bad2db26abfa1d4243863a877f0f"}}},
{b64veryfast, {git, "https://github.com/permaweb/b64veryfast.git", {ref, "20ea7c4b5420501c9a4d5f19d8f043a2e96f3271"}}},
{base32, "1.0.0"},
{cowlib, "2.16.0"},
{cowboy, "2.14.0"},
{ranch, "2.2.0"},
{gun, "2.2.0"},
{prometheus_cowboy, "0.2.0"},
{prometheus_ranch, {git, "https://github.com/permaweb/prometheus_ranch.git", {ref, "73f16ed9856972ced3fb8f4168004fffe742d5b2"}}},
{prometheus_httpd, "2.1.15"},
{prometheus, "6.0.3"},
{graphql, "0.17.1", {pkg, graphql_erl}},
{luerl, "1.3.0"},
{hackney, "1.25.0"},
{eqwalizer_support,
{git_subdir,
"https://github.com/whatsapp/eqwalizer.git",
{branch, "main"},
"eqwalizer_support"}}
]}.
{shell, [
{apps, [hb]},
{config, "config/app.config"}
]}.
{eunit, [
{apps, [hb]}
]}.
{relx, [
{release, {'hb', "0.0.1"}, [hb, b64veryfast, base32, cowboy, gun, luerl, prometheus, prometheus_cowboy, prometheus_ranch, elmdb, runtime_tools]},
{sys_config, "config/app.config"},
{include_erts, true},
{extended_start_script, true},
{overlay, [
{mkdir, "bin/priv"},
{copy, "priv", "bin/priv"},
{copy, "config.flat", "config.flat"},
{copy, "_build/preloaded-store", "_build/preloaded-store"},
{copy, "scripts/schema.gql", "scripts/schema.gql"}
]}
]}.
{dialyzer, [
{plt_extra_apps, [public_key, ranch, cowboy, prometheus, prometheus_cowboy, prometheus_ranch, b64veryfast, eunit, gun]},
incremental,
{warnings, [no_improper_lists, no_unused]}
]}.
{alias, [
{debugger,
[
{shell, "--sname hb --setcookie hb-debug --eval hb_debugger:start()."}
]
},
{'lua-test',
[
{eunit, "--module dev_lua_test"}
]
},
{'eunit-all',
[
{device, "test --with-core"}
]
},
{'deploy-scripts',
[
{shell, "--eval hb:deploy_scripts()."}
]
}
]}.
{edoc_opts, [
{doclet, edown_doclet},
{dir, "docs/resources/source-code"},
{preprocess, true},
{preprocess, true},
{private, true},
{hidden, true}
]}.