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.

Build the APK with buck2, from pins rather than from a second checkout a71ef8f · on 719742dcbe6d54f9a46d2dd1d059f7a72286e5ba · nandi · 18d ago
defs.bzl · 28 lines · 1.3 KBPython Blame HistoryRaw
 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
# Where libvidya comes from, which is a question with two answers.
#
# A BUCK file cannot branch — `if` outside a `def` is not this dialect — and
# this is not a `select` either: it does not vary by configuration but by
# whether a checkout is sitting next to this one. So it lives in a macro.
def libvidya(name):
    """The Android libvidya: a sibling checkout's, or the pinned release's.

    Either way the library's bytes are an input to what reads them, which is
    the part that matters — an action that shelled out to build it would have
    nothing to invalidate on and would serve the same stale object forever.
    """
    if native.read_root_config("frq", "libvidya", "pinned") == "checkout":
        # Staged by the `buck` recipe out of the sibling jolt-native, so that
        # anyone working on both repos at once builds what they are editing.
        native.export_file(
            name = name,
            src = "prebuilt/arm64-v8a/libvidya.so",
            mode = "reference",
        )
    else:
        # The release, fetched by digest. This is what makes an APK buildable
        # with no jolt-native checkout and no NDK anywhere on the machine.
        native.genrule(
            name = name,
            out = "libvidya.so",
            cmd = "cp $(location toolchains//dist:libvidya-android)/libvidya.so \"$OUT\"",
        )