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

Fix patch path #9

Merged
merged 4 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: pants-nix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: nix build '.#"release_2.21.0"'
- run: touch pants.toml && nix shell '.#"release_2.21.0"' --command pants --version
- run: touch pants.toml && nix shell '.#"release_2.21.0"' --command pants --no-pantsd --version
build-2-22:
runs-on: ubuntu-latest
steps:
Expand All @@ -26,4 +26,4 @@ jobs:
name: pants-nix
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: nix build '.#"release_2.22.0"'
- run: touch pants.toml && nix shell '.#"release_2.22.0"' --command pants --version
- run: touch pants.toml && nix shell '.#"release_2.22.0"' --command pants --no-pantsd --version
2 changes: 1 addition & 1 deletion common/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ let

prePatch =
lib.strings.concatMapStrings
(patch_path: "patch -p1 --batch -u -i ${./patch-process-manager.txt}")
(patch_path: "patch -p1 --batch -u -i ${patch_path}")
patches;

preBuild = ''
Expand Down
8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
nixConfig = {
extra-substituters = [
"https://pants-nix.cachix.org"
];
extra-trusted-public-keys = [
"pants-nix.cachix.org-1:qbtCBNLKjk4XIuZPquG8oQuEILiIFsd/pI9nkJ4W2OQ="
];
};
description = "A very basic flake";

inputs = {
Expand Down
25 changes: 12 additions & 13 deletions gen/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ async def _generate_tag(repo: Repo, version: str, force: bool = False) -> None:
template_string = Path("template.nix").read_text("utf-8")
output_hashes = await _prefetch_output_hashes(cargo_lock)
output_hashes.sort(key=operator.itemgetter(0))
patches_filenames = [
*[
"patch-process-manager.txt",
"patch-jar-tool.txt",
"patch-coursier-fetch.txt",
"patch-process.txt",
"patch-jdk-sh.txt",
],
*(["patch-process-extra-env-2.22.txt"] if Version(2, 22, 0) <= version_ < Version(2, 23, 0) else []),
*(["patch-process-extra-env.txt"] if Version(2, 23, 0) <= version_ else []),
]
result = string.Template(template_string).safe_substitute(
version=version,
args=f"python -m gen tag {version}",
Expand All @@ -156,19 +167,7 @@ async def _generate_tag(repo: Repo, version: str, force: bool = False) -> None:
cargo_lock_url=f"https://raw.githubusercontent.com/pantsbuild/pants/{tag}/src/rust/engine/Cargo.lock",
rust_toolchain_url=f"https://raw.githubusercontent.com/pantsbuild/pants/{tag}/src/rust/engine/rust-toolchain",
output_hashes="\n ".join(f'"{pname}" = "{hash_}";' for pname, hash_ in output_hashes),
patches="\n ".join(
[
*[
"./patch-process-manager.txt",
"./patch-jar-tool.txt",
"./patch-coursier-fetch.txt",
"./patch-process.txt",
"./patch-jdk-sh.txt",
],
*(["./patch-process-extra-env-2.22.txt"] if Version(2, 22, 0) <= version_ < Version(2, 23, 0) else []),
*(["./patch-process-extra-env.txt"] if Version(2, 23, 0) <= version_ else []),
]
),
patches="\n ".join(f"../../common/{filename}" for filename in patches_filenames),
)
(tag_dir / "default.nix").write_text(result)

Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.1rc0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.1rc1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.2rc0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.3rc0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.19.3rc1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0.dev7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
10 changes: 5 additions & 5 deletions tags/release_2.20.0a0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let
};
};
patches = [
./patch-process-manager.txt
./patch-jar-tool.txt
./patch-coursier-fetch.txt
./patch-process.txt
./patch-jdk-sh.txt
../../common/patch-process-manager.txt
../../common/patch-jar-tool.txt
../../common/patch-coursier-fetch.txt
../../common/patch-process.txt
../../common/patch-jdk-sh.txt
];
in
lib.makePants {
Expand Down
Loading