diff --git a/pkgs/by-name/sn/snapcraft/esm-test.patch b/pkgs/by-name/sn/snapcraft/esm-test.patch new file mode 100644 index 000000000000..e2c3e4d32815 --- /dev/null +++ b/pkgs/by-name/sn/snapcraft/esm-test.patch @@ -0,0 +1,14 @@ +diff --git i/tests/unit/test_application.py w/tests/unit/test_application.py +index d5da2454c..2a9bcd6f9 100644 +--- i/tests/unit/test_application.py ++++ w/tests/unit/test_application.py +@@ -391,7 +391,8 @@ def test_esm_error(snapcraft_yaml, base, monkeypatch, capsys): + _, err = capsys.readouterr() + + assert re.match( +- rf"^Base {base!r} is not supported by this version of Snapcraft.\n" ++ rf"^Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead.\n" ++ rf"Base {base!r} is not supported by this version of Snapcraft.\n" + rf"Recommended resolution: Use Snapcraft .* from the '.*' channel of snapcraft where {base!r} was last supported.\n" + r"For more information, check out: .*/reference/bases\n", + err, diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index 9e5043d159c9..91053416956d 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -26,6 +26,12 @@ python312Packages.buildPythonApplication rec { }; patches = [ + # We're using a later version of `craft-cli` than expected, which + # adds an extra deprecation warning to the CLI output, meaning that + # an expected error message looks slightly different. This patch corrects + # that by checking for the updated error message and can be dropped in a + # later release of snapcraft. + ./esm-test.patch # Snapcraft is only officially distributed as a snap, as is LXD. The socket # path for LXD must be adjusted so that it's at the correct location for LXD # on NixOS. This patch will likely never be accepted upstream.