You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snapcraft fails to compile a snap when trying to use the home interface plug attribute "read: all".
This ValidationError is thrown: Input should be a valid list [type=list_type, input_value={'home': {'read': ['all']}}, input_type=dict].
The "read: all" feature seems to be introduced by this MR, and is documented in the home interfaces doc. Its description is "read (plug): optional, when set to ‘all’, also allows reading non-hidden files in the home directories of all users as traditional file permissions allow."
If the plug is defined separately, a warning is issued: INFO snap "os-release" has bad plugs or slots: home-all (home plug requires "read" be 'all'), but no access to home is given. Ie,
plugs:
home-all:
interface: home
read: [all]
To Reproduce
Try to build a snap (ie, simple example provided below, taken from snapcraft docs) using the home interface's read attribute:
plugs:
home:
read: all
Environment
Ubuntu 24.04, LXD
snapcraft.yaml
name: os-releasebase: core22version: '0.2'summary: Outputs the contents of /etc/os-releasedescription: Prints the contents of os-releasegrade: stableconfinement: strictapps:
part-os-release:
command: bin/os-release.shplugs:
home:
read: [all]parts:
part-os-release:
plugin: dumpsource: .organize:
os-release.sh: bin/
Relevant log output
$ snapcraft
Traceback (most recent call last):
File "/snap/snapcraft/13008/bin/snapcraft", line 8, in<module>sys.exit(main())
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/application.py", line 485, in main
returncli.run()
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/cli.py", line 252, in run
_run_dispatcher(dispatcher, global_args)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/cli.py", line 225, in _run_dispatcher
dispatcher.run()
File "/snap/snapcraft/13008/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 494, in run
return self._loaded_command.run(self._parsed_command_args)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 266, in run
super().run(parsed_args)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/commands/core22/lifecycle.py", line 139, in run
parts_lifecycle.run(self.name, parsed_args)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/snapcraft/parts/lifecycle.py", line 102, in run
project = models.Project.unmarshal(yaml_data_for_arch)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/craft_application/models/base.py", line 61, in unmarshal
return cls.model_validate(data)
File "/snap/snapcraft/13008/lib/python3.10/site-packages/pydantic/main.py", line 596, in model_validate
return cls.__pydantic_validator__.validate_python(
pydantic_core._pydantic_core.ValidationError: 1 validation error for Project
apps.part-os-release.plugs
Input should be a valid list [type=list_type, input_value={'home': {'read': ['all']}}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.9/v/list_type
Additional context
No response
The text was updated successfully, but these errors were encountered:
Bug Description
Snapcraft fails to compile a snap when trying to use the home interface plug attribute "read: all".
This ValidationError is thrown:
Input should be a valid list [type=list_type, input_value={'home': {'read': ['all']}}, input_type=dict]
.The "read: all" feature seems to be introduced by this MR, and is documented in the home interfaces doc. Its description is "read (plug): optional, when set to ‘all’, also allows reading non-hidden files in the home directories of all users as traditional file permissions allow."
If the plug is defined separately, a warning is issued: INFO snap "os-release" has bad plugs or slots: home-all (home plug requires "read" be 'all'), but no access to home is given. Ie,
To Reproduce
Try to build a snap (ie, simple example provided below, taken from snapcraft docs) using the home interface's read attribute:
Environment
Ubuntu 24.04, LXD
snapcraft.yaml
Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: