This repository was archived by the owner on Mar 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Add shell script that builds dune and makes tarball #12
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| result | ||
| *.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| if [ "$#" -ne "2" ]; then | ||
| echo "Usage: $0 NAME TARGET" | ||
| echo | ||
| echo "Creates a file NAME.tar.gz containing the dune binary distro." | ||
| echo "TARGET is the nix target that gets built. It should be one of:" | ||
| echo " - .#dune.dynamic (builds a dynamically-linked dune executable)" | ||
| echo " - .#dune.static (builds a statically-linked dune executable)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| NAME="$1" | ||
| TARGET="$2" | ||
|
|
||
| set -x | ||
|
|
||
| tmp_dir="$(mktemp -d)" | ||
| trap 'rm -rf "$tmp_dir"' EXIT | ||
| nix build "$TARGET" | ||
| cp -rL result "$tmp_dir/$NAME" | ||
| chmod -R u+w "$tmp_dir/$NAME" | ||
| pushd "$tmp_dir" | ||
| tar czf "$NAME.tar.gz" "$NAME" | ||
| popd | ||
| mv "$tmp_dir/$NAME.tar.gz" . | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own edification, where is the logic that will actually make this decision based on the value of
TARGET? Searching this repo for those strings didn't seem to turn anything up for me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the github action in the file .github/workflows/build.yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes. That I saw. Perhaps that intended usage shoukd be noted here then? There is nothing about this script itself as is that lets readers of the file know it has a coupling like that with the GitHub workflow.