Skip to content

Commit

Permalink
Merge branch 'main' into build/toolchain-repack-and-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed Sep 28, 2024
2 parents 97cfcce + 61153c5 commit b5a4ddc
Show file tree
Hide file tree
Showing 126 changed files with 2,633 additions and 729 deletions.
4 changes: 2 additions & 2 deletions packages/broot/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { cargoBuild } from "rust";

export const project = {
name: "broot",
version: "1.40.0",
version: "1.42.0",
};

const source = std
.download({
url: `https://github.com/Canop/broot/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"2b3cd1b01a71f102e5f26836afdf2b6ef24e02ecf7c5459cc9863e2e670a27da",
"f8a206d44b55287f47cdb63e2f19c9022d55d49f9399e5461f7797ccbe0264ba",
),
})
.unarchive("tar", "gzip")
Expand Down
8 changes: 7 additions & 1 deletion packages/ca_certificates/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions packages/ca_certificates/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ export const project = {
};

export default (): std.Recipe<std.Directory> => {
const cacert = std.download({
url: `https://curl.se/ca/cacert-${project.version}.pem`,
hash: std.sha256Hash(
"1bf458412568e134a4514f5e170a328d11091e071c7110955c9884ed87972ac9",
),
});
const cacert = Brioche.download(
`https://curl.se/ca/cacert-${project.version}.pem`,
);

return std.setEnv(
std.directory({
Expand Down
4 changes: 2 additions & 2 deletions packages/carapace/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { goBuild } from "go";

export const project = {
name: "carapace",
version: "1.0.4",
version: "1.0.5",
};

const source = std
.download({
url: `https://github.com/carapace-sh/carapace-bin/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"745bf9cbbfc205ddc42c8a09b7a05534be792672ed9dc97bd670f74973438e1b",
"25555206b1b5350cba3567463cb2c5b87c43fad20d4e8200ab78d49371c0b4db",
),
})
.unarchive("tar", "gzip")
Expand Down
4 changes: 2 additions & 2 deletions packages/curl/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import openssl from "openssl";

export const project = {
name: "curl",
version: "8.8.0",
version: "8.9.1",
};

const source = std
.download({
url: `https://curl.se/download/curl-${project.version}.tar.gz`,
hash: std.sha256Hash(
"77c0e1cd35ab5b45b659645a93b46d660224d0024f1185e8a95cdb27ae3d787d",
"291124a007ee5111997825940b3876b3048f7d31e73e9caa681b80fe48b2dcd5",
),
})
.unarchive("tar", "gzip")
Expand Down
8 changes: 7 additions & 1 deletion packages/eza/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions packages/eza/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ import { cargoBuild } from "rust";

export const project = {
name: "eza",
version: "0.18.22",
version: "0.19.2",
};

// HACK: Workaround for issue unarchiving this tarfile. See:
// https://github.com/brioche-dev/brioche/issues/103
const sourceTar = Brioche.download(
`https://github.com/eza-community/eza/archive/refs/tags/v${project.version}.tar.gz`,
);
const source = std
.download({
url: `https://github.com/eza-community/eza/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"552fe9997ed4fc6e11dafebffc2aa249ab3fb465a05c614181c7b62e8a0df698",
),
.process({
command: "tar",
args: ["-xf", sourceTar, "--strip-components=1", "-C", std.outputPath],
outputScaffold: std.directory(),
dependencies: [std.tools()],
})
.unarchive("tar", "gzip")
.peel();
.toDirectory();

export default () => {
return cargoBuild({
Expand Down
74 changes: 49 additions & 25 deletions packages/git/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import caCertificates from "ca_certificates";

export const project = {
name: "git",
version: "2.45.2",
version: "2.46.0",
};

const source = std
.download({
url: `https://github.com/git/git/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"8422abc4a16e389220d8da15e12d712f4e6219846ddd8b112e9b31f3087ddf9b",
"d9a72f1648406806d2cb3049b4a73f357e2dc8df5d2962ce6d24220f3861a221",
),
})
.unarchive("tar", "gzip")
Expand Down Expand Up @@ -45,35 +45,59 @@ interface GitCheckoutOptions {
* Checkout a git repository at a specific commit. The specified commit will
* be cloned without any history.
*
* See also the `Brioche.gitRef` function, which can be used with `gitCheckout`
* to get a commit hash from a git ref (such as a branch or tag name), and
* then record the commit hash in the lockfile.
*
* ## Options
*
* - `repository`: The URL of the git repository to checkout.
* - `commit`: The full commit hash to checkout.
*
* ## Example
*
* ```typescript
* import { gitCheckout } from "git";
*
* // Check out the main branch from the Brioche repository. The commit
* // hash will be locked when first run, and will not change until the
* // lockfile is updated
* const source = gitCheckout(
* Brioche.gitRef({
* repository: "https://github.com/brioche-dev/brioche.git",
* ref: "main",
* }),
* );
* ```
*/
export function gitCheckout(
options: GitCheckoutOptions,
options: std.Awaitable<GitCheckoutOptions>,
): std.Recipe<std.Directory> {
// Validate that the commit is a hash
std.assert(
/^[0-9a-f]{40}$/.test(options.commit),
`Invalid git commit hash: ${options.commit}`,
);
return std.recipeFn(async () => {
const { commit, repository } = await options;

// Clone and fetch only the specified commit. See this article:
// https://blog.hartwork.org/posts/clone-arbitrary-single-git-commit/
return std.runBash`
cd "$BRIOCHE_OUTPUT"
git -c init.defaultBranch=main init
git remote add origin "$repository"
git fetch --depth 1 origin "$commit"
git -c advice.detachedHead=false checkout FETCH_HEAD
`
.dependencies(git(), caCertificates())
.env({
repository: options.repository,
commit: options.commit,
})
.outputScaffold(std.directory())
.unsafe({ networking: true })
.toDirectory();
// Validate that the commit is a hash
std.assert(
/^[0-9a-f]{40}$/.test(commit),
`Invalid git commit hash: ${commit}`,
);

// Clone and fetch only the specified commit. See this article:
// https://blog.hartwork.org/posts/clone-arbitrary-single-git-commit/
return std.runBash`
cd "$BRIOCHE_OUTPUT"
git -c init.defaultBranch=main init
git remote add origin "$repository"
git fetch --depth 1 origin "$commit"
git -c advice.detachedHead=false checkout FETCH_HEAD
`
.dependencies(git(), caCertificates())
.env({
repository,
commit,
})
.outputScaffold(std.directory())
.unsafe({ networking: true })
.toDirectory();
});
}
7 changes: 6 additions & 1 deletion packages/gitui/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions packages/gitui/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export const project = {
version: "0.26.3",
};

const source = gitCheckout({
repository: "https://github.com/extrawurst/gitui.git",
commit: "95e1d4d4324bf1eab34f8100afc7f3ae7e435252",
});
const source = gitCheckout(
Brioche.gitRef({
repository: "https://github.com/extrawurst/gitui.git",
ref: `v${project.version}`,
}),
);

export default () => {
return cargoBuild({
Expand Down
4 changes: 2 additions & 2 deletions packages/go/project.bri
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import caCertificates from "ca_certificates";

export const project = {
name: "go",
version: "1.22.5",
version: "1.23.0",
};

/**
Expand All @@ -23,7 +23,7 @@ export function go(): std.Recipe<std.Directory> {
.download({
url: `https://go.dev/dl/go${project.version}.linux-amd64.tar.gz`,
hash: std.sha256Hash(
"904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0",
"905a297f19ead44780548933e0ff1a1b86e8327bb459e92f9c0012569f76f5e3",
),
})
.unarchive("tar", "gzip")
Expand Down
Loading

0 comments on commit b5a4ddc

Please sign in to comment.