Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Brioche.download() for locked downloads #102

Merged
merged 3 commits into from
Jul 21, 2024

Conversation

kylewlacy
Copy link
Member

@kylewlacy kylewlacy commented Jul 19, 2024

Companion PR: brioche-dev/brioche-packages#75

Part of #70

This PR updates the project analysis in Brioche to find instances of Brioche.download("..."), then to download the referenced URL and record the hash in the lockfile (without requiring the user to specify the hash directly). This only works when the argument is a literal string, and it will fail at analysis time and at runtime otherwise. This is in line with the other "statics" that are implemented today (Brioche.glob, Brioche.includeFile Brioche.includeDirectory).

As with the other statics, the runtime implementation of Brioche.download is not in the brioche repo, but will instead be part of the std package.

Here's a usage example:

// The hash will be recorded in `brioche.lock`
const source = Brioche.download(
  "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz",
)
  .unarchive("tar", "gzip")
  .peel();

@kylewlacy kylewlacy merged commit 7451f58 into main Jul 21, 2024
5 checks passed
@kylewlacy kylewlacy deleted the locked-downloads branch July 21, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant