Documentation
¶
Overview ¶
Package hcl is an HCL2 front-end for pkgx pantry recipes. A package.hcl is decoded into the SAME pantry.Recipe as a package.yml — via the same schema validation — so a recipe written either way produces an identical build.
Example (equivalent to the curl.se package.yml):
distributable {
url = "https://curl.se/download/curl-{{version}}.tar.bz2"
strip-components = 1
}
dependencies = { "openssl.org" = "^1.1", "zlib.net" = "^1.2.11" }
build {
script = ["./configure $ARGS", "make --jobs {{ hw.concurrency }} install"]
env = { ARGS = ["--prefix={{prefix}}", "--with-openssl"] }
}
provides = ["bin/curl", "bin/curl-config"]
Blocks express nested maps (build, test, distributable); object attributes express maps whose keys aren't HCL identifiers (eg. "openssl.org").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert turns a package.yml into package.hcl text, and refuses to return text that does not parse back into the same recipe.
The RENDERING is bottle.YAMLToHCL — the same conversion the client runs on upstream recipes as they arrive, which is what makes this command a measurement of the shipping path rather than of a copy of it. A second renderer here would drift, and the two would disagree about a recipe on the day it mattered.
What bk adds is the comparison the client cannot make. bottle checks that the HCL reads back as the same DOCUMENT; only bk has pantry.Parse, so only bk can check that it reads back as the same RECIPE — which is what a build actually consumes, and where the schema has its say.
Types ¶
This section is empty.