canonical / craft-application

The basis for *craft applications
https://canonical-craft-application.readthedocs-hosted.com/en/latest
GNU Lesser General Public License v3.0
7 stars 12 forks source link

parts, stage and prime should only live in the managed environment #53

Closed sergiusens closed 1 year ago

sergiusens commented 1 year ago

Bug Description

The original design is for parts, stage and prime to live inside the managed environment.

To Reproduce

Create an app using Craft Application

part yaml

N/A

Relevant log output

N/A
tigarmo commented 1 year ago

Just bumped into this issue. From what I can tell, the problem is that CraftApplication has a single "work_dir" which, in managed mode, ends up being the directory that contains the project file, mounted into the instance.

For contrast, in managed mode Rockcraft (and probably the other apps but I haven't checked) has work_dir as /root, and the directory that contains the project file, and is mounted into the instance, is the cwd.

References:

https://github.com/canonical/rockcraft/blob/main/rockcraft/lifecycle.py#L59 https://github.com/canonical/rockcraft/blob/main/rockcraft/lifecycle.py#L264

Note that utils.get_managed_environment_project_path() and utils.get_managed_environment_home_path() are two different paths: /root/project and /root respectively.