flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
139 stars 93 forks source link

Build directory not initialized, use flatpak build-init #237

Open LordZane opened 5 years ago

LordZane commented 5 years ago

Linux distribution and version

KDE Neon 5.14

Flatpak-builder version

Verison: 1.0.0 Ref: app/org.flatpak.Builder/x86_64/stable ID: org.flatpak.Builder Arch: x86_64 Branch: stable Origin: flathub Collection ID: org.flathub.Stable Date: 2018-08-29 22:51:35 +0000 Subject: diffstat 1.62 (51464c19) Commit: 6cdf2a7f3e504d615c57282c240f8b234438f162d838cccc3dd2c0e39f7159ec Parent: c1c4430105c5861da84765a9e863c750ff0e62d12377999d94873f708342be7c Location: /var/lib/flatpak/app/org.flatpak.Builder/x86_64/stable/6cdf2a7f3e504d615c57282c240f8b234438f162d838cccc3dd2c0e39f7159ec Installed size: 48.3 MB Runtime: org.freedesktop.Sdk/x86_64/1.6 Sdk: org.freedesktop.Sdk/x86_64/1.6

Description of the problem

Build directory /home/zane/pokerngtool/.flatpak-builder/rofiles/rofiles-qtBvVQ not initialized, use flatpak build-init

Steps to reproduce

run: flatpak run org.flatpak.Builder build com.jms.PokeRNGTool.json --force-clean

ykgmfq commented 5 years ago

I have this same problem with Ubuntu 18.10 in a nspawn container. Disabling rofiles with flatpak-builder --disable-rofiles-fuse does it for me, but only if systemd-nspawn --capability=CAP_NET_ADMIN is invoked. See also https://github.com/flatpak/flatpak/issues/647.

technic commented 4 years ago

I faced this issue during build with docker. Starting docker with --privileged flag helped.

ssssam commented 4 years ago

I'm experiencing this problem with latest flatpak-builder (1.0.11), on Fedora Workstation 32 outside of any container.

It's triggered by https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/122 which added --metadata=X-DConf=migrate-path=/org/gnome/photos/ to finish-args in the manifest (as recommended here).

flatpak-builder successfully mounts the rofiles mount, looks for a file named X-DConf=migrate-path=/org/gnome/photos/ which doesn't exist, and then raises the "Build directory not initialized" error, as you can see from strace output:

...
[pid 181244] lstat("/home/sam/src/gnome-photos/flatpak/.flatpak-builder/rofiles/rofiles-Bn6ZQU/X-DConf=migrate-path=/org/gnome/photos",  <unfinished ...>
[pid 181253] read(4,  <unfinished ...>
[pid 181252] <... read resumed>">\0\0\0\1\0\0\0\6\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\303\2\0\0\0\0\0X-DConf=migrate-path=\0", 135168) = 62
[pid 181252] newfstatat(3, "X-DConf=migrate-path=", 0x7fab9f548ac0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
[pid 181252] writev(4, [{iov_base="\20\0\0\0\376\377\377\377\6\0\0\0\0\0\0\0", iov_len=16}], 1) = 16
[pid 181244] <... lstat resumed>0x7ffcbfd9acb0) = -1 ENOENT (No such file or directory)
[pid 181252] read(4,  <unfinished ...>
[pid 181244] futex(0x7f3b05e34f98, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 181244] futex(0x7f3b05e34f98, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 181244] openat(AT_FDCWD, "/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 181244] openat(AT_FDCWD, "/usr/share/locale/en_GB.utf8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 181244] openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/glib20.mo", O_RDONLY) = 3
[pid 181244] fstat(3, {st_mode=S_IFREG|0644, st_size=123643, ...}) = 0
[pid 181244] mmap(NULL, 123643, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3b043bc000
[pid 181244] close(3)                   = 0
[pid 181244] ioctl(1, TCGETS, 0x7ffcbfd9b010) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 181244] write(2, "error: Build directory /home/sam/src/gnome-photos/flatpak/.flatpak-builder/rofiles/rofiles-Bn6ZQU not initialised, use flatpak build-init\n", 138error: Build directory /home/sam/src/gnome-photos/flatpak/.flatpak-builder/rofiles/rofiles-Bn6ZQU not initialised, use flatpak build-init
) = 138
[pid 181244] exit_group(1)              = ?
[pid 181244] +++ exited with 1 +++
ssssam commented 4 years ago

It turned out my issue was caused by different interpretations of the --metadata argument by flatpak build-finish and flatpak build. I've sent https://github.com/flatpak/flatpak-builder/pull/359 to fix that.

vcaputo commented 2 years ago

Just wanted to chime in and say I tripped over this trying my hand at using flatpak-builder for the first time. Am using an nspawn container running Debian testing for flatpak experiments. Adding --disable-rofiles-fuse at least got the build succeeding.

Without finding this issue I'm not sure how long it would have been before I discovered the flag for the fix, the errors are fatal and leave a lot to be desired in terms of understanding cause/solutions.

travier commented 2 years ago

I've encountered the same issue. That happened while building https://github.com/flathub/com.valvesoftware.Steam.Utility.gamescope on Fedora Kinoite 37 in a Fedora 36 toolbox. Using --disable-rofiles-fuse worked too as a wokraround. Will investigate more.

Newbytee commented 8 months ago

This happens for me with org.flatpak.Builder from Flathub, but not flatpak-builder from Fedora 39's RPM repository.

fluoriteByte commented 5 months ago

Happened to me when trying to build my cursed virtualbox yaml file, using debian sid's flatpak-builder, havent tried the flag --disable-rofiles-fuse, will do when i get home

fedelibre commented 2 months ago

It just happened to me while using org.Flatpak.Builder. I stopped a previous build using Ctrl+C, updated a module definition and then run again the build command and got this error.

The option --disable-rofiles-fuse worked for me.