From 2f3a2172b43959002f86ae934c4f4a2b905a3a57 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Fri, 16 Feb 2024 13:18:51 +0100 Subject: [PATCH] Better documentation for binary origins (#1546) * Document binary origins * Test for explicit binary origin --- doc/catalog-format-spec.md | 13 ++++++ .../my_index/crates/libhello_1.0.0.tgz | Bin 0 -> 435 bytes .../he/hello_world/hello_world-0.1.0.toml | 11 ++++++ .../my_index/index/index.toml | 1 + .../index/origin-binary-explicit/test.py | 37 ++++++++++++++++++ .../index/origin-binary-explicit/test.yaml | 5 +++ 6 files changed, 67 insertions(+) create mode 100644 testsuite/tests/index/origin-binary-explicit/my_index/crates/libhello_1.0.0.tgz create mode 100644 testsuite/tests/index/origin-binary-explicit/my_index/index/he/hello_world/hello_world-0.1.0.toml create mode 100644 testsuite/tests/index/origin-binary-explicit/my_index/index/index.toml create mode 100644 testsuite/tests/index/origin-binary-explicit/test.py create mode 100644 testsuite/tests/index/origin-binary-explicit/test.yaml diff --git a/doc/catalog-format-spec.md b/doc/catalog-format-spec.md index 40a153d4b..2307460d6 100644 --- a/doc/catalog-format-spec.md +++ b/doc/catalog-format-spec.md @@ -455,6 +455,12 @@ static, i.e. they cannot depend on the context. several crates from the same repository (sometimes referred to as a *monorepo*). + - `binary`: optional (defauts to false) boolean used to design the origin + as binary. Binary origins are not compiled and can use dynamic + expressions to narrow down the platform to which they apply. An origin + using a dynamic expression is implicitly tagged as binary; see the + example below. + Examples of origin tables: ```toml @@ -479,6 +485,13 @@ static, i.e. they cannot depend on the context. subdir = "examples" ``` + ```toml + # A binary origin denoting a compiler + [origin."case(os)".linux."case(host-arch)".x86-64] + url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.1.0-1/gnat-x86_64-linux-12.1.0-1.tar.gz" + hashes = ["sha256:df1f36b306359d528799b1de8629a793523347a90c9d4b72efd23c62a7279555"] + ``` + - `available`: optional dynamic boolean expression. If it evaluates to `false`, the package is not available for the current platform. diff --git a/testsuite/tests/index/origin-binary-explicit/my_index/crates/libhello_1.0.0.tgz b/testsuite/tests/index/origin-binary-explicit/my_index/crates/libhello_1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..e0add12efd6ce9fa61f2b2c2e838add85e2da5b4 GIT binary patch literal 435 zcmV;k0ZjfMiwFQ~SD;-01MQVfPlG@ZhB^0FjGQ!4Tt1c_dNT2#Nn=ek@ksbsTPi}c zKx+TJyA(*f);2NpL!IXWyR);q;brDc;$Xs(B=byz801>p2Sm`PR6flW$e<{hj{>{)B&v<8NNP%6)`Bs0+u@wEq z3(7gJ93{dya)fCE#uVz`aoUK=8KTePHc2VlH6gIIZK4W#J9uRC-aB ze+hHB!CCD}(mGc5t<5B9&E(i$`}Eje|9K~8?5cm#|5E=Z!TLW4O|h$WzOhcRo)82< d5ClOG1VIo4K@bE%5ClO^o=