diff --git a/charmcraft/extensions/gunicorn.py b/charmcraft/extensions/gunicorn.py index 56ae3ce72..a2a76f773 100644 --- a/charmcraft/extensions/gunicorn.py +++ b/charmcraft/extensions/gunicorn.py @@ -163,6 +163,7 @@ def _get_root_snippet(self) -> dict[str, Any]: "plugin": "charm", "source": ".", "build-snaps": ["rustup"], # Needed to build pydantic. + "override-build": "rustup default stable\ncraftctl default", } }, } diff --git a/tests/extensions/test_gunicorn.py b/tests/extensions/test_gunicorn.py index 1151fde37..54fcf638a 100644 --- a/tests/extensions/test_gunicorn.py +++ b/tests/extensions/test_gunicorn.py @@ -66,7 +66,12 @@ def flask_input_yaml_fixture(): "options": {**FlaskFramework.options, **FlaskFramework._WEBSERVER_OPTIONS} }, "parts": { - "charm": {"plugin": "charm", "source": ".", "build-snaps": ["rustup"]}, + "charm": { + "plugin": "charm", + "source": ".", + "build-snaps": ["rustup"], + "override-build": "rustup default stable\ncraftctl default", + } }, "peers": {"secret-storage": {"interface": "secret-storage"}}, "provides": { @@ -120,7 +125,14 @@ def flask_input_yaml_fixture(): "config": { "options": {**DjangoFramework.options, **DjangoFramework._WEBSERVER_OPTIONS} }, - "parts": {"charm": {"plugin": "charm", "source": ".", "build-snaps": ["rustup"]}}, + "parts": { + "charm": { + "plugin": "charm", + "source": ".", + "build-snaps": ["rustup"], + "override-build": "rustup default stable\ncraftctl default", + } + }, "peers": {"secret-storage": {"interface": "secret-storage"}}, "provides": { "metrics-endpoint": {"interface": "prometheus_scrape"}, @@ -258,4 +270,5 @@ def test_handle_charm_part(flask_input_yaml, tmp_path): "plugin": "charm", "source": ".", "build-snaps": ["rustup"], + "override-build": "rustup default stable\ncraftctl default", } diff --git a/tests/spread/commands/init-flask-framework/task.yaml b/tests/spread/commands/init-flask-framework/task.yaml index fd58ecbf6..4fdb20425 100644 --- a/tests/spread/commands/init-flask-framework/task.yaml +++ b/tests/spread/commands/init-flask-framework/task.yaml @@ -6,6 +6,12 @@ systems: - ubuntu-22.04-64 execute: | + # Required for fetch-libs to succeed since the libraries are not available on + # the staging environment + unset CHARMCRAFT_STORE_API_URL + unset CHARMCRAFT_UPLOAD_URL + unset CHARMCRAFT_REGISTRY_URL + mkdir -p test-init cd test-init charmcraft init --profile flask-framework