Skip to content

Sporadic symlink issue without fatfakeroot #2742

@Staudey

Description

@Staudey

Please confirm there isn't an existing open bug report

  • I have searched open bugs for this issue

Summary

As was recently discovered in the freeimage package, building without the fatfakeroot option can create non-functioning symlinks in the final package. See #2644
Instead of symlinks there are truncated ELF files in the resulting package archive.

After this another issue was found with android-tools where building from the tarball without fatfakeroot causes the cmake create_symlink command to fail in the install phase.

@ReillyBrogan and @malfisya reported that they can't reproduce the freeimage issue on their computers.

I've created a patch manually linking the freeimage libs for easier testing with different fakeroot LD_PRELOAD settings (the original make instructions need (fake)root privileges) here: Staudey@573a405

Some findings from testing:

  1. Putting the whole package build into the install phase leads to working symlinks in the final result.
  2. Putting unset LD_PRELOAD in the install phase will make tree show the correct symlinks at the last build step, but the resulting package will still have broken symlinks.
  3. Putting unset LD_PRELOAD in the install phase but an export LD_PRELOAD=libfakeroot.so right before the tree command will make it show the broken symlink configuration (i.e. no symlinks), and this will be reflected in the final package.
  4. Putting the whole build into the install phase and an unset LD_PRELOAD right before the final tree command will show the correct symlink configuration, and the symlinks will also be correct in the final package
  5. At least part of the issue seems to be some sort of race condition; during one build only half the symlinks were broken, but this was not reproducible reliably. Using fatfakeroot (and probably an install-phase-only build) seems to always prevent the issue from occurring though.

Steps to reproduce

  1. Patch freeimage recipe with the above-mentioned changes
  2. Run go-task in the freeimage package recipe folder
  3. Observe the tree output towards the end of the build showing no symlinks, the strip failures, and missing symlinks in the resulting package
    (As mentioned above this might not be reproducible on every machine)

Expected result

Symlinks are correctly created during the build and in the resulting package, no strip failures

Actual result

Symlinks are NOT correctly created during the build and/or not found in the resulting package, build shows strip failures at the end, truncated ELF files instead of symlinks in the package archive

Environment

  • Is system up to date?

Repo

Unstable

Desktop Environment

Budgie

System details

System:
  Host: solus-pc Kernel: 6.8.10-291.current arch: x86_64 bits: 64
  Desktop: Budgie v: 10.9.1 Distro: Solus 4.5 resilience
Machine:
  Type: Desktop Mobo: MSI model: Z170A PC MATE (MS-7971) v: 2.0
    serial: <superuser required> UEFI-[Legacy]: American Megatrends v: A.60
    date: 12/17/2015
CPU:
  Info: quad core Intel Core i7-6700K [MT MCP] speed (MHz): avg: 800
    min/max: 800/4200
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] driver: nvidia v: 550.40.61
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 23.2.7 driver: X:
    loaded: nvidia gpu: nvidia,nvidia-nvswitch resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.40.61
    renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
Network:
  Device-1: Realtek RTL8192CE PCIe Wireless Network Adapter driver: rtl8192ce
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169
Drives:
  Local Storage: total: 1.82 TiB used: 768.58 GiB (41.3%)
Info:
  Memory: total: 32 GiB available: 31.31 GiB used: 6.16 GiB (19.7%)
  Processes: 327 Uptime: 3h 25m Shell: Zsh inxi: 3.3.34

Other comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions