diff --git a/docs/requirements.txt b/docs/requirements.txt index 7ece00dc9f..d955d34bfb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ attrs==23.1.0 catkin-pkg==0.5.2 click==8.1.7 -craft-application==2.5.0 +craft-application==2.6.0 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/requirements-devel.txt b/requirements-devel.txt index 5d1522d5f0..99af12eac4 100644 --- a/requirements-devel.txt +++ b/requirements-devel.txt @@ -11,7 +11,7 @@ click==8.1.7 codespell==2.2.6 colorama==0.4.6 coverage==7.4.4 -craft-application==2.5.0 +craft-application==2.6.0 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/requirements.txt b/requirements.txt index 7a3b3f675c..1025d55a82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ cffi==1.16.0 chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 -craft-application==2.5.0 +craft-application==2.6.0 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/tests/spread/core24/grammar/snap/snapcraft.yaml b/tests/spread/core24/grammar/snap/snapcraft.yaml index ef1407d36c..e0f04fe812 100644 --- a/tests/spread/core24/grammar/snap/snapcraft.yaml +++ b/tests/spread/core24/grammar/snap/snapcraft.yaml @@ -15,6 +15,12 @@ platforms: build-on: amd64 build-for: arm64 +build-packages: + - on amd64 to amd64: + - libogg-dev + - on amd64 to arm64: + - libpci-dev + parts: hello-world: plugin: dump diff --git a/tests/unit/test_application.py b/tests/unit/test_application.py index 9706ba1665..c289646277 100644 --- a/tests/unit/test_application.py +++ b/tests/unit/test_application.py @@ -161,9 +161,13 @@ def test_application_expand_extensions(emitter, monkeypatch, extension_source, n @pytest.mark.usefixtures("fake_extension") -def test_application_build_with_extensions(monkeypatch, extension_source, new_dir): - """Test that extensions are correctly applied in regular builds.""" +def test_application_extra_yaml_transforms( + monkeypatch, extension_source, new_dir, emitter +): + """Test that extra_yaml_transforms applies root keywords and expands extensions.""" monkeypatch.setenv("CRAFT_DEBUG", "1") + extension_source["build-packages"] = [{"to s390x": "test-package"}] + extension_source["build-snaps"] = [{"to s390x": "test-snap"}] project_path = new_dir / "snap/snapcraft.yaml" (new_dir / "snap").mkdir() @@ -172,12 +176,16 @@ def test_application_build_with_extensions(monkeypatch, extension_source, new_di # Calling a lifecycle command will create a Project. Creating a Project # without applying the extensions will fail because the "extensions" field # will still be present on the yaml data, so it's enough to run "pull". - monkeypatch.setattr("sys.argv", ["snapcraft", "pull", "--destructive-mode"]) + monkeypatch.setattr( + "sys.argv", ["snapcraft", "pull", "--destructive-mode", "--build-for", "s390x"] + ) app = application.create_app() app.run() project = app.get_project() assert "fake-extension/fake-part" in project.parts + assert project.parts["snapcraft/core"]["build-packages"] == ["test-package"] + assert project.parts["snapcraft/core"]["build-snaps"] == ["test-snap"] def test_application_managed_core20_fallback(monkeypatch, new_dir, mocker):