Skip to content

Commit 137bd86

Browse files
authored
charmcraft: 3.2.2 -> 3.4.2 (#381233)
2 parents a4aadaa + b4c51dc commit 137bd86

File tree

13 files changed

+160
-57
lines changed

13 files changed

+160
-57
lines changed

pkgs/by-name/ch/charmcraft/package.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
python3Packages.buildPythonApplication rec {
1010
pname = "charmcraft";
11-
version = "3.2.2";
11+
version = "3.4.2";
1212

1313
pyproject = true;
1414

1515
src = fetchFromGitHub {
1616
owner = "canonical";
1717
repo = "charmcraft";
1818
tag = version;
19-
hash = "sha256-2MI2cbAohfTgbilxZcFvmxt/iVjR6zJ2o0gequB//hg=";
19+
hash = "sha256-6ucF0iQxQrFFz7jlaktYsB538W8jbX+Sw5hP0/VoYsk=";
2020
};
2121

2222
postPatch = ''
@@ -35,6 +35,7 @@ python3Packages.buildPythonApplication rec {
3535
humanize
3636
jinja2
3737
jsonschema
38+
pip
3839
pydantic
3940
python-dateutil
4041
pyyaml
@@ -51,11 +52,14 @@ python3Packages.buildPythonApplication rec {
5152
pythonRelaxDeps = [
5253
"urllib3"
5354
"craft-application"
55+
"pip"
56+
"pydantic"
5457
];
5558

5659
nativeCheckInputs =
5760
with python3Packages;
5861
[
62+
freezegun
5963
hypothesis
6064
pyfakefs
6165
pytest-check

pkgs/by-name/ro/rockcraft/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
python3Packages.buildPythonApplication rec {
1313
pname = "rockcraft";
14-
version = "1.7.0";
14+
version = "1.8.0";
1515

1616
src = fetchFromGitHub {
1717
owner = "canonical";
1818
repo = "rockcraft";
1919
rev = version;
20-
hash = "sha256-2Bo3qtpSSfNvqszlt9cCc9/rurDNDMySAaqLbvRmjjw=";
20+
hash = "sha256-v7biDGgJoQO6cKRXG8xosCgd/mlOUEwHrqcgtL2R5L4=";
2121
};
2222

2323
pyproject = true;

pkgs/by-name/sn/snapcraft/os-platform.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

pkgs/by-name/sn/snapcraft/package.nix

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,22 @@
1313

1414
python3Packages.buildPythonApplication rec {
1515
pname = "snapcraft";
16-
version = "8.5.1";
16+
version = "8.6.1";
1717

1818
pyproject = true;
1919

2020
src = fetchFromGitHub {
2121
owner = "canonical";
2222
repo = "snapcraft";
2323
tag = version;
24-
hash = "sha256-7kIVWbVj5qse3JIdlCvRtVUfSa/rSjn4e8HJdVY3sOA=";
24+
hash = "sha256-SbxsgvDptkUl8gHAIrJvnzIPOh0/R81n8cgJWBH7BXQ=";
2525
};
2626

2727
patches = [
2828
# Snapcraft is only officially distributed as a snap, as is LXD. The socket
2929
# path for LXD must be adjusted so that it's at the correct location for LXD
3030
# on NixOS. This patch will likely never be accepted upstream.
3131
./lxd-socket-path.patch
32-
# In certain places, Snapcraft expects an /etc/os-release file to determine
33-
# host info which doesn't exist in our test environment. This is a
34-
# relatively naive patch which helps the test suite pass - without it *many*
35-
# of the tests fail. This patch will likely never be accepted upstream.
36-
./os-platform.patch
3732
# Snapcraft will try to inject itself as a snap *from the host system* into
3833
# the build system. This patch short-circuits that logic and ensures that
3934
# Snapcraft is installed on the build system from the snap store - because
@@ -118,6 +113,7 @@ python3Packages.buildPythonApplication rec {
118113
build-system = with python3Packages; [ setuptools ];
119114

120115
pythonRelaxDeps = [
116+
"craft-parts"
121117
"docutils"
122118
"jsonschema"
123119
"pygit2"

pkgs/development/python-modules/craft-application/default.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,19 @@
3030

3131
buildPythonPackage rec {
3232
pname = "craft-application";
33-
version = "4.8.2";
33+
version = "4.9.0";
3434
pyproject = true;
3535

36-
disabled = pythonOlder "3.10";
37-
3836
src = fetchFromGitHub {
3937
owner = "canonical";
4038
repo = "craft-application";
4139
tag = version;
42-
hash = "sha256-rKeEi9z5eQfjn0Q4FR6CVIz9YDS7Ejg4cqcor5wtz0s=";
40+
hash = "sha256-DprItAuGjw8AACeJDrIa6KIWLSyImuWI0qeROpPohtM=";
4341
};
4442

4543
postPatch = ''
4644
substituteInPlace pyproject.toml \
47-
--replace-fail "setuptools==75.2.0" "setuptools"
45+
--replace-fail "setuptools==75.8.0" "setuptools"
4846
'';
4947

5048
build-system = [ setuptools-scm ];

pkgs/development/python-modules/craft-cli/default.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
fetchFromGitHub,
55
nix-update-script,
66
platformdirs,
7+
jinja2,
8+
overrides,
79
pyyaml,
810
setuptools-scm,
911
pytest-check,
@@ -13,15 +15,15 @@
1315

1416
buildPythonPackage rec {
1517
pname = "craft-cli";
16-
version = "2.13.0";
18+
version = "2.15.0";
1719

1820
pyproject = true;
1921

2022
src = fetchFromGitHub {
2123
owner = "canonical";
2224
repo = "craft-cli";
2325
tag = version;
24-
hash = "sha256-IqK+eU2z63yDMJrHAhETHWoTz5lWK1er9bwYH9Oml18=";
26+
hash = "sha256-L8hOQJhjVAMo/WxEHHEk2QorlSdDFMGdcL/Q3Pv6mT4=";
2527
};
2628

2729
postPatch = ''
@@ -32,6 +34,8 @@ buildPythonPackage rec {
3234
build-system = [ setuptools-scm ];
3335

3436
dependencies = [
37+
jinja2
38+
overrides
3539
platformdirs
3640
pyyaml
3741
];
Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
diff --git a/craft_parts/executor/step_handler.py b/craft_parts/executor/step_handler.py
2-
index 404df69..f90e2ac 100644
2+
index 5eab915..bc26252 100644
33
--- a/craft_parts/executor/step_handler.py
44
+++ b/craft_parts/executor/step_handler.py
5-
@@ -243,8 +243,9 @@ class StepHandler:
6-
print(script, file=script_file)
7-
script_file.flush()
8-
script_file.seek(0)
9-
+ import shutil
10-
process = subprocess.Popen( # pylint: disable=consider-using-with
11-
- ["/bin/bash"],
12-
+ [shutil.which("bash")],
13-
stdin=script_file,
14-
cwd=work_dir,
15-
stdout=self._stdout,
16-
@@ -394,7 +395,8 @@ def _create_and_run_script(
5+
@@ -445,7 +445,8 @@ def _create_and_run_script(
176
) -> None:
187
"""Create a script with step-specific commands and execute it."""
198
with script_path.open("w") as run_file:
@@ -22,12 +11,28 @@ index 404df69..f90e2ac 100644
2211
+ print(f"#!{shutil.which('bash')}", file=run_file)
2312
print("set -euo pipefail", file=run_file)
2413

25-
if build_environment_script_path:
14+
if environment_script_path:
15+
diff --git a/craft_parts/plugins/java_plugin.py b/craft_parts/plugins/java_plugin.py
16+
index f2b4064..cb4e9e8 100644
17+
--- a/craft_parts/plugins/java_plugin.py
18+
+++ b/craft_parts/plugins/java_plugin.py
19+
@@ -71,9 +71,8 @@ class JavaPlugin(Plugin):
20+
return None, ""
21+
22+
def _find_javac(self) -> list[str]:
23+
- cmd = ["find", "/usr/lib/jvm", "-path", "*/bin/javac", "-print"]
24+
- output = subprocess.check_output(cmd, text=True)
25+
- return [x for x in output.split("\n") if len(x) > 0]
26+
+ import shutil
27+
+ return [shutil.which("javac")]
28+
29+
@override
30+
def get_build_environment(self) -> dict[str, str]:
2631
diff --git a/craft_parts/plugins/validator.py b/craft_parts/plugins/validator.py
27-
index b8d8f11..fce0e72 100644
32+
index 5b4c735..8ff30c2 100644
2833
--- a/craft_parts/plugins/validator.py
2934
+++ b/craft_parts/plugins/validator.py
30-
@@ -142,9 +142,9 @@ class PluginEnvironmentValidator:
35+
@@ -141,9 +141,9 @@ class PluginEnvironmentValidator:
3136
print(self._env, file=env_file)
3237
print(cmd, file=env_file)
3338
env_file.flush()
@@ -39,3 +44,56 @@ index b8d8f11..fce0e72 100644
3944
check=True,
4045
capture_output=True,
4146
text=True,
47+
diff --git a/tests/unit/executor/test_step_handler.py b/tests/unit/executor/test_step_handler.py
48+
index 4e73c2b..b762fb8 100644
49+
--- a/tests/unit/executor/test_step_handler.py
50+
+++ b/tests/unit/executor/test_step_handler.py
51+
@@ -209,9 +209,10 @@ class TestStepHandlerBuiltins:
52+
53+
assert get_mode(build_script_path) == 0o755
54+
with open(build_script_path) as file:
55+
+ import shutil
56+
assert file.read() == dedent(
57+
f"""\
58+
- #!/bin/bash
59+
+ #!{shutil.which('bash')}
60+
set -euo pipefail
61+
source {environment_script_path}
62+
set -x
63+
diff --git a/tests/unit/utils/test_process.py b/tests/unit/utils/test_process.py
64+
index 84b29ad..dc2d772 100644
65+
--- a/tests/unit/utils/test_process.py
66+
+++ b/tests/unit/utils/test_process.py
67+
@@ -33,7 +33,8 @@ _RUN_TEST_CASES = [
68+
69+
@pytest.mark.parametrize(("out", "err"), _RUN_TEST_CASES)
70+
def test_run(out, err):
71+
- result = process.run(["/usr/bin/sh", "-c", f"echo {out};sleep 0;echo {err} >&2"])
72+
+ import shutil
73+
+ result = process.run([shutil.which("sh"), "-c", f"echo {out};sleep 0;echo {err} >&2"])
74+
assert result.returncode == 0
75+
assert result.stdout == (out + "\n").encode()
76+
assert result.stderr == (err + "\n").encode()
77+
@@ -42,8 +43,9 @@ def test_run(out, err):
78+
79+
@pytest.mark.parametrize(("out", "err"), _RUN_TEST_CASES)
80+
def test_run_devnull(out, err):
81+
+ import shutil
82+
result = process.run(
83+
- ["/usr/bin/sh", "-c", f"echo {out};echo {err} >&2"],
84+
+ [shutil.which("sh"), "-c", f"echo {out};echo {err} >&2"],
85+
stdout=subprocess.DEVNULL,
86+
stderr=subprocess.DEVNULL,
87+
)
88+
@@ -78,9 +80,10 @@ def test_run_selector(out, err, new_dir):
89+
90+
selector.register(sock, selectors.EVENT_READ, accept)
91+
92+
+ import shutil
93+
result = process.run(
94+
[
95+
- "/usr/bin/sh",
96+
+ shutil.which("sh"),
97+
"-c",
98+
f"echo {out};sleep 0;echo {err} >&2; echo -n {out}|socat - UNIX-CONNECT:{new_dir}/test.socket",
99+
],

pkgs/development/python-modules/craft-parts/default.nix

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,25 @@
1818
jsonschema,
1919
git,
2020
squashfsTools,
21+
socat,
2122
setuptools-scm,
2223
stdenv,
24+
ant,
25+
maven,
26+
jdk,
2327
}:
2428

2529
buildPythonPackage rec {
2630
pname = "craft-parts";
27-
version = "2.2.2";
31+
version = "2.6.0";
2832

2933
pyproject = true;
3034

3135
src = fetchFromGitHub {
3236
owner = "canonical";
3337
repo = "craft-parts";
3438
tag = version;
35-
hash = "sha256-6ufcay1C2Qv3nnG0augnPWzwBVDMj1ypRwzHRAhHARA=";
39+
hash = "sha256-SybDzprUrKeL+Jl7Gm4XYLlvmy056D1OtJB7v/W2flY=";
3640
};
3741

3842
patches = [ ./bash-path.patch ];
@@ -57,14 +61,18 @@ buildPythonPackage rec {
5761
pythonImportsCheck = [ "craft_parts" ];
5862

5963
nativeCheckInputs = [
64+
ant
6065
git
6166
hypothesis
67+
jdk
6268
jsonschema
69+
maven
6370
pytest-check
6471
pytest-mock
6572
pytest-subprocess
6673
pytestCheckHook
6774
requests-mock
75+
socat
6876
squashfsTools
6977
];
7078

@@ -80,6 +88,8 @@ buildPythonPackage rec {
8088
"test_run_prime"
8189
"test_get_build_packages_with_source_type"
8290
"test_get_build_packages"
91+
# Relies upon certain paths being present that don't make sense on Nix.
92+
"test_java_plugin_jre_not_17"
8393
];
8494

8595
disabledTestPaths =

pkgs/development/python-modules/craft-providers/default.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
responses,
1616
freezegun,
1717
pytest-subprocess,
18-
pytest-logdog,
18+
logassert,
1919
}:
2020

2121
buildPythonPackage rec {
2222
pname = "craft-providers";
23-
version = "2.1.0";
23+
version = "2.1.1";
2424

2525
pyproject = true;
2626

2727
src = fetchFromGitHub {
2828
owner = "canonical";
2929
repo = "craft-providers";
3030
tag = version;
31-
hash = "sha256-+j3uwvecffl8cK+yNidWbL243VnPkX72DMYv8RXMaXE=";
31+
hash = "sha256-aW3efKy3c7ZGXS4wsvby0ww3Gwjt+1tMKsJCGprkcZo=";
3232
};
3333

3434
patches = [
@@ -50,7 +50,7 @@ buildPythonPackage rec {
5050
# The urllib3 incompat: https://github.com/msabramo/requests-unixsocket/pull/69
5151
# This is already patched in nixpkgs.
5252
substituteInPlace pyproject.toml \
53-
--replace-fail "setuptools==73.0.1" "setuptools"
53+
--replace-fail "setuptools==75.2.0" "setuptools"
5454
'';
5555

5656
pythonRelaxDeps = [ "requests" ];
@@ -69,10 +69,10 @@ buildPythonPackage rec {
6969

7070
nativeCheckInputs = [
7171
freezegun
72+
logassert
7273
pytest-check
7374
pytest-mock
7475
pytest-subprocess
75-
pytest-logdog
7676
pytestCheckHook
7777
responses
7878
];

0 commit comments

Comments
 (0)