← Back to issue list

Calling snapcraft clean shouldn't load the project

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#2028047
Type
issue
State
open
Author
~gbeuzeboc
Labels
Created
Updated
Closed

Current evaluation

snapcraft clean loads project and plugins from host PYTHONPATH, causing crashes when host has conflicting Python modules. Issue is 1143 days old with no maintainer engagement.

Suggested action: needs triage

Reason: The issue is a well-structured bug report with clear reproduction steps (ROS Noetic environment, PYTHONPATH conflict), but it has been inactive for 1143 days with no labels, comments, or maintainer response. The project architecture may have changed significantly since then, so a maintainer should assess whether this issue is still relevant before deciding on next steps.

Impact: 50 Quick Win: 25.0 Staleness: 95 Complexity: 50 Confidence: 30 Support Request: 10

Issue body

The call to the lifecycle.clean method calls the project_loader.load_config which calls the pluginhandler.load_plugin This load_plugin method is using sys.path to load plugins. This is using the host sys.path (while cleaning a container/VM used to build the snap). If the host has a Python module with the same name as the snapcraft plugin, it will try to load the Python module from the host. The module from the host being something completely unrelated to snapcraft plugins, the load crashes. When calling snapcraft clean, snapcraft shouldn't try to load python module from the host or even parse/load the project. A simple way to reproduce the error is to: - Source a ROS Noetic environment (Expanding PYTHONPATH with a ROS dedicated path on the host) - Call snapcraft --use-lxd to build a ROS 1 Noetic snap (an example can be found here: https://github.com/ubuntu-robotics/ros-snaps-examples/tree/main/source_pkg_noetic_core20) - Run snapcraft clean --use-lxd to clean to snap build env - It will generate the following error: Loaded local plugin for catkin Failed to load plugin: unknown plugin: 'catkin' It happens because it tries to load a local plugin found in the PYTHONPATH. The "local plugin" is simply a Python module from the host that was added to the PYTHONPATH when sourcing our environment.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 25.0
Staleness: 95
Complexity: 50
Confidence: 30
Support Request: 10
needs triage snapcraft clean loads project and plugins from host PYTHONPATH, causing crashes when host has conflicting Python modules. Issue is 1143 days old with no maintainer engagement.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 60
Confidence: 85
Support Request: 5
needs triage snapcraft clean crashes by loading host Python plugins due to sys.path pollution. Untriaged, inactive for over three years, awaiting maintainer assessment.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 60
Confidence: 75
Support Request: 10
close stale snapcraft clean incorrectly loads the project and host PYTHONPATH plugins, causing crashes when host modules conflict with snapcraft plugins. Issue is 3 years old with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 65
Confidence: 85
Support Request: 5
needs triage snapcraft clean incorrectly loads project config and host plugins via sys.path, causing crashes when host PYTHONPATH shadows snapcraft plugins. Unlabeled, no maintainer response, inactive for ~3 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 75
Support Request: 10
close stale Bug report stating snapcraft clean incorrectly loads host Python modules via sys.path, causing plugin loading failures. Issue is three years old with no maintainer response or labels.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.