Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapcraft - folder witch_spells are mounted with the snap but never copy to the final location #82

Closed
cosmic-zip opened this issue Oct 26, 2024 · 0 comments · Fixed by #76
Assignees
Labels
bug Something isn't working

Comments

@cosmic-zip
Copy link
Owner

Issue: witch_spells Folder Not Copied to Host System in Snapcraft

Description:
During the Snapcraft build process, the folder witch_spells is correctly mounted within the .snap package and appears at the location /var/witch_craft/witch_spells when the package is unpacked using unsquashfs. However, the contents of witch_spells are not being copied to the expected destination on the host system upon installation, which prevents their access by the application.

Steps to Reproduce:

  1. Build the .snap package with Snapcraft, ensuring the witch_spells folder is included.
  2. Verify the contents of the .snap file using unsquashfs and confirm that witch_spells is present at /var/witch_craft/witch_spells.
  3. Install the snap on the host system and attempt to access /var/witch_craft/witch_spells from the host environment.
  4. Notice that witch_spells is missing on the host, even though it appears in the .snap package.

Expected Behavior:
The witch_spells folder should be copied to /var/witch_craft/witch_spells on the host system during installation, making its contents accessible to the application.

Observed Behavior:
The witch_spells folder remains within the .snap package but is not copied to the final location on the host.

Potential Causes:

  1. Snapcraft Configuration: The Snapcraft YAML configuration might lack proper directives to ensure the witch_spells folder is copied to the final location.
  2. Confinement Issues: If the snap uses strict confinement, it may not have the necessary permissions to copy files to /var.
  3. Snap Layouts or Bind Mounts: Snap layouts or bind mounts might be misconfigured, preventing witch_spells from being linked to the host system.

Suggested Solution:

  1. Verify Snapcraft YAML Configuration: Ensure the witch_spells directory is properly defined in the Snapcraft YAML under the layout section to bind it to /var/witch_craft/witch_spells.

    layout:
      /var/witch_craft/witch_spells:
        bind: $SNAP/witch_spells
  2. Check Confinement Settings: If using strict confinement, verify that the snap has the necessary permissions or consider using classic confinement if feasible.

  3. Add Post-Install Hook (if applicable): If Snapcraft configuration alone does not resolve the issue, consider adding a post-install hook to manually copy witch_spells to the desired location on the host.

@cosmic-zip cosmic-zip self-assigned this Oct 26, 2024
@cosmic-zip cosmic-zip added the bug Something isn't working label Oct 26, 2024
@cosmic-zip cosmic-zip pinned this issue Oct 26, 2024
@cosmic-zip cosmic-zip linked a pull request Oct 26, 2024 that will close this issue
@cosmic-zip cosmic-zip unpinned this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant