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

Error creating flatpak on RHEL 8.7 under Windows Subsystem for Linux #1

Open
stuarthillary opened this issue Mar 23, 2023 · 4 comments

Comments

@stuarthillary
Copy link

I have installed pupnet-deploy and its pre-requisites on a Redhat Enterprise Linux 8.7 system. When trying to build a flatpak for this Helloworld example I get an error. I modified the .csproj file to target .NET 6.0. Here is the output from running pupnet -k flatpak

PupNet Deploy 1.0.1
Configuration: ./HelloWorld.pupnet.conf

============================================================
APPLICATION: HelloWorld 3.2.1 [5]
============================================================

AppBaseName: HelloWorld
AppId: zone.kuiper.helloworld
AppVersion: 3.2.1
PackageRelease: 5
StartCommand: helloworld [Not Supported]

============================================================
OUTPUT: FLATPAK
============================================================

PackageKind: Flatpak
Runtime: linux-x64
Arch: Auto (x86_64)
Build: Release
OutputName: HelloWorld-3.2.1-5.x86_64.flatpak
OutputDirectory: /home/stuart/PupNet-HelloWorld/Deploy/bin

============================================================
DESKTOP: app.desktop
============================================================

[Desktop Entry]
Type=Application
Name=Hello World
Icon=zone.kuiper.helloworld
Comment=A Hello World application
Exec=HelloWorld
TryExec=HelloWorld
NoDisplay=false
X-AppImage-Integrate=true
Terminal=true
Categories=Utility
MimeType=
Keywords=

============================================================
BUILD PROJECT: PupNet-HelloWorld
============================================================

dotnet publish "/home/stuart/PupNet-HelloWorld" -r linux-x64 -c Release -p:Version=3.2.1 --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin"

/home/stuart/PupNet-HelloWorld/Deploy/PostPublish.sh

============================================================
BUILD PACKAGE: HelloWorld-3.2.1-5.x86_64.flatpak
============================================================

flatpak-builder  --repo="/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/repo" --force-clean "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/build" --state-dir "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state" "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/HelloWorld.yml"

flatpak build-bundle "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/repo" "/home/stuart/PupNet-HelloWorld/Deploy/bin/HelloWorld-3.2.1-5.x86_64.flatpak" zone.kuiper.helloworld

============================================================
ISSUES
============================================================

[None Detected]

Continue? [N/y] or ESC aborts? Y
Remove: . ... OK
Create Directory: . ... OK
Create Directory: AppDir ... OK
Create Directory: AppDir/usr/bin ... OK
Create Directory: AppDir/usr/share ... OK
Create Directory: AppDir/usr/share/icons ... OK
Create Directory: AppDir/usr/share/applications ... OK
Create Directory: AppDir/usr/share/metainfo ... OK
Create File: AppDir/usr/share/applications/zone.kuiper.helloworld.desktop ... OK
Create File: AppDir/usr/share/metainfo/zone.kuiper.helloworld.metainfo.xml ... OK
Create Directory: AppDir/usr/share/icons/hicolor/16x16/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/16x16/apps/zone.kuiper.helloworld.png ... OK
Create Directory: AppDir/usr/share/icons/hicolor/24x24/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/24x24/apps/zone.kuiper.helloworld.png ... OK
Create Directory: AppDir/usr/share/icons/hicolor/32x32/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/32x32/apps/zone.kuiper.helloworld.png ... OK
Create Directory: AppDir/usr/share/icons/hicolor/48x48/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/48x48/apps/zone.kuiper.helloworld.png ... OK
Create Directory: AppDir/usr/share/icons/hicolor/64x64/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/64x64/apps/zone.kuiper.helloworld.png ... OK
Create Directory: AppDir/usr/share/icons/hicolor/scalable/apps ... OK
Create File: AppDir/usr/share/icons/hicolor/scalable/apps/zone.kuiper.helloworld.svg ... OK

Building Project ...
dotnet publish "/home/stuart/PupNet-HelloWorld" -r linux-x64 -c Release -p:Version=3.2.1 --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin"
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /home/stuart/PupNet-HelloWorld/HelloWorld/HelloWorld.csproj (in 131 ms).
  HelloWorld -> /home/stuart/PupNet-HelloWorld/HelloWorld/bin/Release/net6.0/linux-x64/HelloWorld.dll
  HelloWorld -> /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin/

/home/stuart/PupNet-HelloWorld/Deploy/PostPublish.sh

===========================
POST_PUBLISH BASH SCRIPT
===========================

BUILD_ARCH: x64
BUILD_TARGET: Release
BUILD_SHARE: /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/share
BUILD_APP_BIN: /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin

Do work...
+ mkdir -p /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin/subdir
+ touch /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/AppDir/usr/bin/subdir/file.test
+ set +x

===========================
POST_PUBLISH END
===========================


Building Package ...
Exists?: AppDir/usr/bin/HelloWorld ... OK
Create File: AppDir/usr/bin/LICENSE ... OK
Create File: HelloWorld.yml ... OK
flatpak-builder --repo="/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/repo" --force-clean "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/build" --state-dir "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state" "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/HelloWorld.yml"
Downloading sources
Initializing build dir
Committing stage init to cache
Starting build of zone.kuiper.helloworld
fuse: device not found, try 'modprobe fuse' first
========================================================================
Building module HelloWorld in /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state/build/HelloWorld-1
========================================================================
Running: mkdir -p /app/bin
error: Build directory /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state/rofiles/rofiles-ipA9yH not initialized, use flatpak build-init
Error: module HelloWorld: Child process exited with code 1

FAILED
flatpak-builder returned non-zero exit code 1
@kuiperzone
Copy link
Owner

Hi Stuart,

Thanks. I'm running Fedora here, and can't repeat the problem.

But looks like this line suggests the problem: fuse: device not found, try 'modprobe fuse' first

I know that AppImage also uses fuse, so I'm wondering if you have a problem building AppImage also?

I modified the .csproj file to target .NET 6.0

You mean the HelloWorld csproj? Yes, that should be absolutely fine.

Andy

@kuiperzone
Copy link
Owner

Although not for Flatpak, I'm wondering if this would be helpful?

https://docs.appimage.org/user-guide/troubleshooting/fuse.html

@stuarthillary
Copy link
Author

It turns out I should have mentioned that my RHEL 8.7 instance is running inside Windows Subsystem for Linux (WSL). As mentioned here, microsoft/WSL#17 (comment) , FUSE does not work for version 1 images but is baked into the WSL2 kernel. I converted my RHEL instance in version 2 for WSL. I now get a different error when trying to make the flatpak

[TRIMMED OUTPUT]

===========================
POST_PUBLISH END
===========================


Building Package ...
Exists?: AppDir/usr/bin/HelloWorld ... OK
Create File: AppDir/usr/bin/LICENSE ... OK
Create File: HelloWorld.yml ... OK
flatpak-builder --repo="/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/repo" --force-clean "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/build" --state-dir "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state" "/tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/HelloWorld.yml"
Downloading sources
Initializing build dir
Committing stage init to cache
Starting build of zone.kuiper.helloworld
========================================================================
Building module HelloWorld in /tmp/KuiperZone.PupNet/zone.kuiper.helloworld-linux-x64-Release-Flatpak/state/build/HelloWorld-1
========================================================================
Running: mkdir -p /app/bin
error: Unable to allocate instance id
Error: module HelloWorld: Child process exited with code 1

FAILED
flatpak-builder returned non-zero exit code 1

I am guessing this is another WSL specific issue with flatpak-builder.

@stuarthillary stuarthillary changed the title Error creating flatpak on RHEL 8.7 Error creating flatpak on RHEL 8.7 under Windows Subsystem for Linux Mar 24, 2023
@kuiperzone
Copy link
Owner

I am guessing this is another WSL specific issue with flatpak-builder.

I would guess the same. Ultimately I can't fix issues with flatpak-builder or other third-party tools. I can only make sure that they are called correctly.

One thing you can do is call:

pupnet -k flatpak --verbose

This will show you the flatpak manifest contents it has generated and will it supply to flatpak-builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants