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

flatpak-builder cannot find Flatpak SDK in fedora-toolbox-35 #863

Open
vchernin opened this issue Aug 24, 2021 · 5 comments
Open

flatpak-builder cannot find Flatpak SDK in fedora-toolbox-35 #863

vchernin opened this issue Aug 24, 2021 · 5 comments
Labels
1. Bug Something isn't working

Comments

@vchernin
Copy link

vchernin commented Aug 24, 2021

Describe the bug

Cannot use flatpak-builder in Fedora 35 with a fedora-toolbox-35 container since sdks can't be found.

Steps how to reproduce the behaviour

  1. Use flatpak-builder in a fedora-toolbox-35 container on Fedora 35 (I used Silverblue).
  2. Attempt to build an app with any Flatpak SDK (I tried with GNOME SDK, probably affects others).
  3. You will see Failed to init: Unable to find sdk org.gnome.Sdk version 40 regardless of whether the sdk is installed on the host or not.
  4. I am not able to install flatpak correctly either, but I think this was a problem in fedora-toolbox-34 and Fedora 34 as well. But this issue was only introduced in 35, even when Installing flatpak inside a toolbox container fails on fedora 32 #629 existed before.

Expected behaviour
flatpak-builder finds needed sdks as expected.

Actual behaviour
flatpak-builder is effectively useless without its sdks in a fedora-toolbox-35 container

Output of toolbox --version (v0.0.90+)
toolbox version 0.0.99.2

Toolbox package info (rpm -q toolbox)
toolbox-0.0.99.2^3.git075b9a8d2779-1.fc35.x86_64

Output of podman version

Version:      3.3.0
API Version:  3.3.0
Go Version:   go1.16.6
Built:        Fri Aug 20 12:35:44 2021
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)
podman-3.3.0-1.fc35.x86_64

Info about your OS
Fedora Silverblue 35

Additional context
Used fresh fedora-toolbox-35 image.
flatpak-builder-1.0.12-4.fc35.x86_64

@vchernin vchernin added the 1. Bug Something isn't working label Aug 24, 2021
@anthr76
Copy link
Contributor

anthr76 commented Aug 29, 2021

Typically I called out to flatpak with flatpak-spawn but wonder if that pattern has changed as of lately?

@vchernin
Copy link
Author

vchernin commented Sep 1, 2021

@anthr76 Could you provide an example of what you usually used to use?

Doing things like flatpak-spawn --host flatpak install org.gnome.Platform//40 from toolbox to get the 40 runtime doesn't help me much, as they provide the same result as just running in the host.

For reference I usually use flatpak-builder installed via dnf in toolbox, and flatpak provided in the base image.

I am somewhat conceptually at a loss how this can be resolved.

@anthr76
Copy link
Contributor

anthr76 commented Sep 1, 2021

something like this

cat /usr/bin/flatpak
#!/bin/bash 
# https://github.com/containers/toolbox/issues/145
executable=$(basename "$0")
exec flatpak-spawn --host --watch-bus --forward-fd=1 --forward-fd=2 --directory="$(pwd)" --env=TERM=xterm-256color "$executable" "$@

flatpak-spawn in the toolbox flatpak on the host. Flatpaks are installed on the host

@vchernin
Copy link
Author

vchernin commented Sep 2, 2021

Ah I think I see what you meant now. I usually took advantage of behaviour like #659 (comment) when I tried running flatpak in toolbox, but I didn't do that much anyway.

Still as far as I can tell flatpak-spawn doesn't really help with running flatpak-builder, or could it?

@fedelibre
Copy link

Perhaps this has been fixed by #640 (0.1.0 milestone)?
See also this comment.

Workaround:

$ ls -l /var/lib/ | grep flatpak
drwxr-xr-x. 1 nobody nobody  136 Nov 24 22:40 flatpak
$ sudo umount /var/lib/flatpak
$ ls -l /var/lib/ | grep flatpak
drwxr-xr-x. 2 root root     40 Nov 25 07:49 flatpak
$ sudo dnf install -y flatpak

Installation succeeds, but now flatpak list can see only the user installations.
Exit the container and stop it (podman stop fedora-toolbox-35). When you enter it again, /var/lib/flatpak will be again as it used to be and flatpak list will show also the flatpaks installed system-wide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants