← Back to issue list

Validate namespaced parts or warn when part names contain slashes

View original Github issue

Metadata

Project
craft-parts
Number
#1016
Type
issue
State
open
Author
mr-cal
Labels
Created
2025-02-10 21:33:27+00:00
Updated
2025-03-11 14:28:19+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done #### Option 1 - Warn today, error tomorrow If a part name contains a slash, craft-parts should provide a warning: ``` Warning: part 'foo/bar' contains a '/', which may cause undesired behavior. ``` In a future major release, we can change the warning to an error. #### Option 2 - Check for conflicts If one part will be nested inside another, craft-parts should raise an error: ``` Error: part 'foo/bar' conflicts with 'foo'. ``` ### Why it needs to get done Craft-parts has no handling for '/' and allows for nested parts. Nested parts are undefined and will almost certainly cause a broken build: ```yaml parts: foo: plugin: nil foo/bar: plugin: nil ``` ``` ├── parts │   └── foo │   ├── bar │   │   ├── build │   │   ├── install │   │   ├── layer │   │   ├── run │   │   │   ├── build.sh │   │   │   └── environment.sh │   │   ├── src │   │   └── state │   │   ├── build │   │   ├── prime │   │   ├── pull │   │   └── stage │   ├── build │   ├── install │   ├── layer │   ├── run │   │   ├── build.sh │   │   └── environment.sh │   ├── src │   └── state │   ├── build │   ├── prime │   ├── pull │   └── stage ``` Note that some craft apps namespace parts to indicate they belong to the application ([example](https://github.com/canonical/snapcraft/blob/945ab1505b603f298ff491392bf570d959229edb/snapcraft/extensions/gnome.py#L339)).

Evaluation history

No evaluation history available.