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

Sporadic symlink issue without fatfakeroot #2742

Open
2 tasks done
Staudey opened this issue May 26, 2024 · 3 comments
Open
2 tasks done

Sporadic symlink issue without fatfakeroot #2742

Staudey opened this issue May 26, 2024 · 3 comments
Labels
Bug Something isn't working

Comments

@Staudey
Copy link
Member

Staudey commented May 26, 2024

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

@Staudey Staudey added the Bug Something isn't working label May 26, 2024
@github-project-automation github-project-automation bot moved this to Triage in Solus May 26, 2024
@Staudey
Copy link
Member Author

Staudey commented May 26, 2024

Output of file for a borked symlink:

libfreeimage.so: ELF 64-bit LSB shared object, x86-64, (SYSV)

Output of file for successfully created symlink:

libfreeimage.so: symbolic link to libfreeimage-3.18.0.so

Example hexdumps for broken "symlink"/ELF files:

λ hexdump -C libfreeimage.so.3
00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
00000010  03 00 3e 00 01 00                                 |..>...|
00000016

λ hexdump -C libfreeimageplus.so
00000000  7f 45 4c 46 02 01 01 00  00 00 00 00 00 00 00 00  |.ELF............|
00000010  03 00 3e 00 01 00 00 00  00 00                    |..>.......|
0000001a

@malfisya
Copy link
Member

Is this still a problem? I remember this was solved by rebuilding the toolchain

@Staudey
Copy link
Member Author

Staudey commented Jun 19, 2024

This was only worked around by enabling tmpfs on the builder, but it's an inherent issue with fatfakeroot. This can likely be closed once getsolus/solbuild#103 gets merged (and the builder updated)

@malfisya malfisya moved this from Triage to Ready in Solus Nov 10, 2024
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
Status: Ready
Development

No branches or pull requests

2 participants