nandi/frqpublic Fork 0
719742dcbe6d54f9a46d2dd1d059f7a72286e5ba
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

defs.bzl · 28 lines · 1.3 KBPython Blame HistoryRaw
Build the APK with buck2, from pins rather than from a second checkout a71ef8f nandi 19d ago1# Where libvidya comes from, which is a question with two answers.
2#
3# A BUCK file cannot branch — `if` outside a `def` is not this dialect — and
4# this is not a `select` either: it does not vary by configuration but by
5# whether a checkout is sitting next to this one. So it lives in a macro.
6def libvidya(name):
7 """The Android libvidya: a sibling checkout's, or the pinned release's.
8
9 Either way the library's bytes are an input to what reads them, which is
10 the part that matters — an action that shelled out to build it would have
11 nothing to invalidate on and would serve the same stale object forever.
12 """
13 if native.read_root_config("frq", "libvidya", "pinned") == "checkout":
14 # Staged by the `buck` recipe out of the sibling jolt-native, so that
15 # anyone working on both repos at once builds what they are editing.
16 native.export_file(
17 name = name,
18 src = "prebuilt/arm64-v8a/libvidya.so",
19 mode = "reference",
20 )
21 else:
22 # The release, fetched by digest. This is what makes an APK buildable
23 # with no jolt-native checkout and no NDK anywhere on the machine.
24 native.genrule(
25 name = name,
26 out = "libvidya.so",
27 cmd = "cp $(location toolchains//dist:libvidya-android)/libvidya.so \"$OUT\"",
28 )