ljkasdljkasdjkl
This commit is contained in:
28
justfile
28
justfile
@@ -22,10 +22,13 @@ export NIX_PATH := `echo "${NIX_PATH_ORIG:-"${NIX_PATH:-}"}"`
|
||||
@fixup *args:
|
||||
cd "$invokedir"; just "$(gum filter $(just --summary --unsorted | tr ' ' '\n' | grep '^fixup-'))" "$@"
|
||||
@list *args:
|
||||
cd "$invokedir"; just "$(gum filter $(just --summary --unsorted | tr ' ' '\n' | grep '^list-'))" "$@"
|
||||
@instantiate *args:
|
||||
cd "$invokedir"; just "$(gum filter $(just --summary --unsorted | tr ' ' '\n' | grep '^instantiate-'))" "$@"
|
||||
@build *args:
|
||||
cd "$invokedir"; just "$(gum filter $(just --summary --unsorted | tr ' ' '\n' | grep '^build-'))" "$@"
|
||||
@bump *args:
|
||||
cd "$invokedir"; just "$(gum filter $(just --summary --unsorted | tr ' ' '\n' | grep '^bump-'))" "$@"
|
||||
|
||||
# === info helpers ===
|
||||
|
||||
@@ -349,27 +352,29 @@ push-new-pr:
|
||||
|
||||
# === speed worktrees ===
|
||||
|
||||
bump *packages:
|
||||
bump-new-worktree *packages:
|
||||
#!/usr/bin/env -S bash -euo pipefail -x
|
||||
declare -a packages=("$@")
|
||||
[[ -n "${packages[*]}" ]] || packages=($(just _some_packages))
|
||||
worktree=$(just _new_worktree bump "$(printf "%s\n" "${packages[0]}" | rev | cut -d. -f1 | rev)")
|
||||
[[ -n "worktree" ]]
|
||||
cd "$worktree"
|
||||
just _bump "${packages[@]}"
|
||||
just bump-here "${packages[@]}"
|
||||
NIXPKGS_ALLOW_UNFREE=1 "$SHELL"
|
||||
|
||||
[no-cd]
|
||||
_bump +$packages:
|
||||
bump-here *packages:
|
||||
#!/usr/bin/env -S bash -euo pipefail -x
|
||||
[[ -e .git && flake.nix ]]
|
||||
printf "%s.src\n" "$@" | xargs just _build_packages results-src-old ||: # TODO: unpack?
|
||||
declare -a packages=("$@")
|
||||
[[ -n "${packages[*]}" ]] || packages=($(just _some_packages))
|
||||
printf "%s.src\n" "${packages[@]}" | xargs just _build_packages results-src-old ||: # TODO: unpack?
|
||||
config=(env
|
||||
NIXPKGS_ALLOW_UNFREE=1
|
||||
NIXPKGS_ALLOW_BROKEN=1
|
||||
NIXPKGS_ALLOW_INSECURE=1
|
||||
)
|
||||
for package in "$@"; do
|
||||
for package in "${packages[@]}"; do
|
||||
if nix eval -f . "$package".passthru.updateScript >&/dev/null; then
|
||||
HEAD=$($GIT rev-parse HEAD)
|
||||
"${config[@]}" nix-update "$package" --use-update-script --update-script-args "--argstr skip-prompt true" --commit
|
||||
@@ -383,16 +388,16 @@ _bump +$packages:
|
||||
fi
|
||||
done
|
||||
set +e
|
||||
printf "%s.src\n" "$@" | xargs just _build_packages results-src-new # TODO: unpack?
|
||||
just _build_packages results "$@"
|
||||
printf "%s.src\n" "${packages[@]}" | xargs just _build_packages results-src-new # TODO: unpack?
|
||||
just _build_packages results "${packages[@]}"
|
||||
# TODO: filter non-existing tests:
|
||||
printf "%s.tests\n" "$@" | env _JUST_NIX_BUILD_ARGS="-j1" xargs just _build_packages results-tests
|
||||
printf "%s.tests\n" "${packages[@]}" | env _JUST_NIX_BUILD_ARGS="-j1" xargs just _build_packages results-tests
|
||||
printf "HEAD^%s " $(seq 0 $(($#-1))) | xe $GIT show
|
||||
fd . -l results results-tests --max-depth 1
|
||||
# test -L result && fd . result --type x --color=always | tee update-executables.txt
|
||||
# $GIT show --name-only --pretty="" | xe statix fix
|
||||
$GIT diff
|
||||
printf "delta results-src-{old,new}/%s.src/.\n" "$@"
|
||||
printf "delta results-src-{old,new}/%s.src/.\n" "${packages[@]}"
|
||||
|
||||
fix *packages:
|
||||
#!/usr/bin/env -S bash -euo pipefail
|
||||
@@ -509,7 +514,7 @@ _mk_worktree $name $dir $base="upstream/master" $onto="":
|
||||
$GIT branch "$name" "$branch" --no-track
|
||||
$GIT worktree add ../"$dir" "$name"
|
||||
cd ../"$dir"
|
||||
$GIT pull "$remote" "$branch"
|
||||
$GIT pull --rebase "$remote" "$branch"
|
||||
[[ -z "$onto" ]] || just rebase-onto HEAD "$onto"
|
||||
|
||||
pop-commits-to-new-worktree $commits=`cd "$invokedir"; just _some_commits`:
|
||||
@@ -628,7 +633,8 @@ setup:
|
||||
clean:
|
||||
#!/usr/bin/env -S bash -euo pipefail
|
||||
cleanlist="$(just _mk_clean_list)" || exit 1
|
||||
gum choose --no-limit --height="$(($(wc -l <<<"$cleanlist") + 5))" <<<"$cleanlist" | bash -x -
|
||||
#gum choose --no-limit --height="$(($(wc -l <<<"$cleanlist") + 5))" <<<"$cleanlist" | bash -x -
|
||||
gum choose --no-limit <<<"$cleanlist" | bash -x -
|
||||
|
||||
_mk_clean_list:
|
||||
#!/usr/bin/env -S bash -euo pipefail
|
||||
|
||||
11
overlays.nix
11
overlays.nix
@@ -60,7 +60,6 @@ let
|
||||
# none of these overlays should cause a mass-rebuild, they should only add optional functionality
|
||||
|
||||
# TODO: cccache and sccache
|
||||
# TODO: fetchurl.passthru.unpacked
|
||||
# TODO: mkDerivation.passthru.withOil: add <package>.withOil which run build with osh, https://oils.pub/osh.html#2-you-get-precise-error-messages
|
||||
# TODO: mkDerivation.passthru.withGDB: add <package>.withGDB which runs the full build with gdb
|
||||
# TODO: mkDerivation.passthru.withDebInfo: like overlay.withDebug but with cmakeBuildType = "RelWithDebInfo" mode
|
||||
@@ -82,6 +81,15 @@ let
|
||||
}
|
||||
);
|
||||
|
||||
# usage: nix-build ./dev.nix -A <package>.srcOnly
|
||||
overlays.srcOnly = mkDerivationOverlay (
|
||||
final: prev: prevStdenv: finalAttrs: prevAttrs: {
|
||||
passthru = {
|
||||
srcOnly = prev.srcOnly finalAttrs.finalPackage;
|
||||
} // prevAttrs.passthru or { };
|
||||
}
|
||||
);
|
||||
|
||||
# usage: nix-build ./dev.nix -A <package>.src.invalidated
|
||||
overlays.withInvalidateFetcherByDrvHash = mkDerivationOverlay (
|
||||
final: prev: prevStdenv: finalAttrs: prevAttrs: {
|
||||
@@ -433,6 +441,7 @@ in
|
||||
[
|
||||
overlays.withShellCheck
|
||||
overlays.withDebug
|
||||
overlays.srcOnly
|
||||
overlays.withInvalidateFetcherByDrvHash
|
||||
overlays.withUnpacked
|
||||
overlays.withTwostagePythonBuildPassthru
|
||||
|
||||
Reference in New Issue
Block a user