termux-pacman / glibc-packages

Glibc packages for termux
MIT License
134 stars 19 forks source link

on-device building is cursed #128

Closed askorbinovaya-kislota closed 1 year ago

askorbinovaya-kislota commented 1 year ago

non-glibc packages do support on-device building, so maybe it should also be possible for glibc packages?

Maxython commented 1 year ago

when building any package i get this error if proot-distro is installed

It looks like this is a problem with proot-distro, try restarting Termux.

CC @sylirre as the creator of proot-distro

built packages include data/data/com.termux/files/usr/var/log/pacman.log which already exists in filesystem, so they cannot be installed

In fact, this file should not be in the package since this file is a process log from pacman.

when building every package the build script installs files directly to $PREFIX/glibc and breaks pacman non-glibc packages do support on-device building, so maybe it should also be possible for glibc packages?

Compiling glibc packages with build-packages.sh supports compilation on the Termux device. How did you run build-packages.sh to compile pkg? Apparently you are doing something wrong.

askorbinovaya-kislota commented 1 year ago

Compiling glibc packages with build-packages.sh supports compilation on the Termux device. How did you run build-packages.sh to compile pkg? Apparently you are doing something wrong.

i used ./build-package.sh --library glibc gpkg/vulkan-headers (vulkan-headers do not exist in gpkg, i simply copied it from termux-packages with 0 changes)

Maxython commented 1 year ago

i used ./build-package.sh --library glibc gpkg/vulkan-headers (vulkan-headers do not exist in gpkg, i simply copied it from termux-packages with 0 changes)

I ran ./build-package.sh --library glibc packages/vulkan-headers and everything compiled correctly. I forgot to ask you a question about what error you get when compiling the package? Also, when compiling packages from the termux-packages repo, add the -L flag for correct compilation (more info).

sylirre commented 1 year ago

It looks like this is a problem with proot-distro, try restarting Termux.

Technically this is a problem of proot, not of proot-distro. Because proot when using --bind option creates mount point directories with no permissions (effect as chmod 000 ./path/to/file).

Ask about this in https://github.com/termux/proot/issues as I really can't explain such behavior of proot.

Same error can be caused by literally by any file that lacks read access mode.

askorbinovaya-kislota commented 1 year ago

I forgot to ask you a question about what error you get when compiling the package?

compiling goes fine if i remove any proot distro, but i can't install the resulting package:

``` ~/glibc-packages $ pacman -U output/vulkan-headers-glibc-1.3.268-0-any.pkg.tar.xz loading packages... resolving dependencies... looking for conflicting packages... Packages (1) vulkan-headers-glibc-1.3.268-0 Total Installed Size: 24.35 MiB :: Proceed with installation? [Y/n] Y (1/1) checking keys in keyring [######################] 100% (1/1) checking package integrity [######################] 100% (1/1) loading package files [######################] 100% (1/1) checking for file conflicts [######################] 100% error: failed to commit transaction (conflicting files) vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h264std.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h264std_decode.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h264std_encode.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h265std.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h265std_decode.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codec_h265std_encode.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vk_video/vulkan_video_codecs_common.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vk_icd.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vk_layer.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vk_platform.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan.cppm exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_android.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_beta.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_core.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_directfb.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_enums.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_extension_inspection.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_format_traits.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_fuchsia.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_funcs.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_ggp.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_handles.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_hash.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_hpp_macros.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_ios.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_macos.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_metal.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_raii.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_screen.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_shared.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_static_assertions.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_structs.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_to_string.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_vi.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_video.hpp exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_wayland.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_win32.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_xcb.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_xlib.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/include/vulkan/vulkan_xlib_xrandr.h exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/cmake/VulkanHeaders/VulkanHeadersConfig.cmake exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/cmake/VulkanHeaders/VulkanHeadersConfigVersion.cmake exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/doc/vulkan-headers-glibc/LICENSE exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/apiconventions.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/cgenerator.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/generator.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/genvk.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/parse_dependency.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/profiles/VP_KHR_roadmap_2022.json exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/reg.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/spec_tools/conventions.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/spec_tools/util.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/stripAPI.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/validusage.json exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/video.xml exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/vk.xml exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/glibc/share/vulkan/registry/vkconventions.py exists in filesystem vulkan-headers-glibc: /data/data/com.termux/files/usr/var/log/pacman.log exists in filesystem Errors occurred, no packages were upgraded. ```

if i return the proot distro (debian in my case) mv ~/debian $PREFIX/var/lib/proot-distro/installed-rootfs/ then building fails with that tar error

Maxython commented 1 year ago

compiling goes fine if i remove any proot distro, but i can't install the resulting package

Now it has become clear. This is due to the fact that the compiler immediately installs the package files into the Termux system and then creates the package. To install the compiled package, you need to run pacman with the --overwrite "*" flag.

if i return the proot distro (debian in my case) mv ~/debian $PREFIX/var/lib/proot-distro/installed-rootfs/ then building fails with that tar error

👉 https://github.com/termux-pacman/glibc-packages/issues/128#issuecomment-1765282848

askorbinovaya-kislota commented 1 year ago

but what about the included pacman.log file? the installation would fail even on clean prefix...

Maxython commented 1 year ago

but what about the included pacman.log file? the installation would fail even on clean prefix...

Has been fixed - https://github.com/termux/termux-packages/commit/da44a1456622ae273433f1712bda62318751bb58