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

Fails to rename desktop file #71

Open
wjt opened this issue Feb 2, 2022 · 8 comments
Open

Fails to rename desktop file #71

wjt opened this issue Feb 2, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@wjt
Copy link
Member

wjt commented Feb 2, 2022

I tried building an app using org.flatpak.Builder 1.2.2 on an Endless OS system with Flatpak 1.10.7 (matching Debian Bullseye). It fails when renaming the desktop file in an unexpected way.

Given the following manifest:

{
    "app-id": "uk.me.wjt.FlatpakBuilderTest",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "21.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "/bin/true",
    "rename-desktop-file": "test.desktop",
    "modules": [
        {
            "name": "test",
            "buildsystem": "simple",
            "sources": [
                {
                    "type": "file",
                    "path": "test.desktop"
                }
            ],
            "build-commands": [
                "install -D -t /app/share/applications test.desktop"
            ]
        }
    ]
}

and the following test.desktop:

[Desktop Entry]
Name=Test
Exec=true

Then with flatpak-builder 1.0.12 (from Debian Bullseye) the build succeeds, but with org.flatpak.Builder 1.2.2 it fails as follows:

Emptying app dir '_app'
Downloading sources
Starting build of uk.me.wjt.FlatpakBuilderTest
Cache hit for test, skipping build
Cache miss, checking out last cache hit
Cleaning up
Renaming test.desktop to uk.me.wjt.FlatpakBuilderTest.desktop
Error: Error moving file /sysroot/home/wjt/tmp/fbtest/.flatpak-builder/rofiles/rofiles-lZv3CH/files/share/applications/test.desktop: No such file or directory
@wjt
Copy link
Member Author

wjt commented Feb 2, 2022

https://github.com/wjt/flatpak-builder-issue-71 has the files above for ease of testing.

@wjt
Copy link
Member Author

wjt commented Feb 2, 2022

--verbose is not much more helpful:

$ org.flatpak.Builder --verbose  --force-clean _app uk.me.wjt.FlatpakBuilderTest.json 
FB: Running: git config --get user.email
FB: Running: git config --get user.name
Emptying app dir '_app'
FB: Running 'flatpak info --arch=x86_64 --show-commit org.freedesktop.Sdk 21.08' on host
FB: host_command_exited_cb 91854 0

FB: Running 'flatpak info --show-location --arch=x86_64 org.freedesktop.Sdk 21.08' on host
FB: host_command_exited_cb 91857 0

FB: Running 'flatpak info --arch=x86_64 --show-commit org.freedesktop.Platform 21.08' on host
FB: host_command_exited_cb 91860 0

Downloading sources
Starting build of uk.me.wjt.FlatpakBuilderTest
Cache hit for test, skipping build
Cache miss, checking out last cache hit
Cleaning up
FB: Mounting read-only fs: rofiles-fuse /sysroot/home/wjt/tmp/flatpak-builder-issue-71/_app /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH
Renaming test.desktop to uk.me.wjt.FlatpakBuilderTest.desktop
Error: Error moving file /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH/files/share/applications/test.desktop: No such file or directory
FB: Unmounting read-only fs: fusermount -uz /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH

My working theory is that f-b 1.2 is not compatible with flatpak 1.10, but I wonder whether it should be.

The context is that periodically people wonder whether we should stop baking flatpak-builder (and its somewhat large dependencies, like git, elfutils, etc.) into the Endless OS ostree, and instead direct the small subset of people who actually need it to this Flatpak. However this quick experiment suggests that we can't do this and the belief that having mutually-contemporary versions of flatpak and flatpak-builder is a good idea.

@wjt
Copy link
Member Author

wjt commented Feb 2, 2022

I tried building and running 1.2.2 on the host (rather than as a flatpak) and it works fine. The plot thickens

@nanonyme
Copy link
Collaborator

nanonyme commented Feb 6, 2022

I hope we didn't hit yet another dependency on host flatpak, see #13 (comment). It's possible that there is some dependency between flatpak in sandbox and flatpak in host.

@wjt
Copy link
Member Author

wjt commented Feb 24, 2022

I now have matching Flatpak versions between host and this Flatpak, and get a slightly different failure at exactly the same spot:

wjt@camille:~/tmp/flatpak-builder-issue-71 (main)$ flatpak --version
Flatpak 1.12.4
wjt@camille:~/tmp/flatpak-builder-issue-71 (main)$ flatpak run --command=flatpak org.flatpak.Builder --version
Flatpak 1.12.4
wjt@camille:~/tmp/flatpak-builder-issue-71 (main)$ org.flatpak.Builder --version
flatpak-builder 1.2.2
wjt@camille:~/tmp/flatpak-builder-issue-71 (main)$ org.flatpak.Builder --verbose --force-clean _app uk.me.wjt.FlatpakBuilderTest.json 
FB: Running: git config --get user.email
FB: Running: git config --get user.name
Emptying app dir '_app'
FB: Running 'flatpak info --arch=x86_64 --show-commit org.freedesktop.Sdk 21.08' on host
FB: host_command_exited_cb 3785 0

FB: Running 'flatpak info --show-location --arch=x86_64 org.freedesktop.Sdk 21.08' on host
FB: host_command_exited_cb 3788 0

FB: Running 'flatpak info --arch=x86_64 --show-commit org.freedesktop.Platform 21.08' on host
FB: host_command_exited_cb 3791 0

Downloading sources
Starting build of uk.me.wjt.FlatpakBuilderTest
Cache hit for test, skipping build
Cache hit for cleanup, skipping
Cache miss, checking out last cache hit
Finishing app
FB: Mounting read-only fs: rofiles-fuse /sysroot/home/wjt/tmp/flatpak-builder-issue-71/_app /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH
FB: Running: flatpak build-finish --command=/bin/true /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH
error: Build directory /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH not initialized
Error: Child process exited with code 1
FB: Unmounting read-only fs: fusermount -uz /sysroot/home/wjt/tmp/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-lZv3CH

@bbhtt
Copy link
Contributor

bbhtt commented Feb 22, 2024

Is this still relevant? 1.2.2 is pretty old by now and renames were worked on by @hfiguiere recently which is in org.flatpak.Builder right now.

I cannot reproduce the bug from the manifest and desktop file in the first post.

@wjt
Copy link
Member Author

wjt commented Feb 22, 2024

I can!

wjt@camille:flatpak-builder-issue-71 (main)$ ostree --version # for rofiles-fuse
libostree:
 Version: '2023.5'
 Features:
  - libcurl
  - libsoup3
  - gpgme
  - ex-fsverity
  - libarchive
  - selinux
  - avahi
  - libmount
  - systemd
  - release
  - p2p
wjt@camille:flatpak-builder-issue-71 (main)$ flatpak --version
Flatpak 1.14.4
wjt@camille:flatpak-builder-issue-71 (main)$ flatpak-builder --version
flatpak-builder 1.2.3
wjt@camille:flatpak-builder-issue-71 (main)$ org.flatpak.Builder --version
flatpak-builder 1.4.1
wjt@camille:flatpak-builder-issue-71 (main)$ org.flatpak.Builder --install --force-clean --user _app uk.me.wjt.FlatpakBuilderTest.json 
Emptying app dir '_app'
Downloading sources
Starting build of uk.me.wjt.FlatpakBuilderTest
Cache hit for test, skipping build
Cache miss, checking out last cache hit
Cleaning up
Renaming test.desktop to uk.me.wjt.FlatpakBuilderTest.desktop
Error: Error moving file /sysroot/home/wjt/src/wjt/flatpak-builder-issue-71/.flatpak-builder/rofiles/rofiles-kqp9q8/files/share/applications/test.desktop: No such file or directory
wjt@camille:flatpak-builder-issue-71 (main)$ flatpak-builder --install --force-clean --user _app uk.me.wjt.FlatpakBuilderTest.json 
[… it succeeds …]
Installing app/uk.me.wjt.FlatpakBuilderTest/x86_64/master
Pruning cache

@bbhtt bbhtt added the bug Something isn't working label Feb 29, 2024
@izissise
Copy link

izissise commented Jun 1, 2024

I have the same issue on ubuntu

flatpak-builder --version
flatpak-builder 1.2.2

@bbhtt bbhtt changed the title Fails to rename desktop file when used with Flatpak 1.10.x Fails to rename desktop file Jan 15, 2025
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

No branches or pull requests

4 participants