GLIBC errors - packaging Ubuntu 24.04.4 LTS pre-compiled binary

First time user to snap, so please be gentle.

Trying to package a snap of my previously compiled binary (that includes its libraries) on an Ubuntu 24.04.4 LTS system using core22 (my binary is fully compatible with it).

Save these two files anywhere and run to test:

$ make

Makefile

VERSION := $(shell wget -q "https://api.github.com/repos/ggarra13/mrv2/releases/latest" -O - | grep tag_name | cut -d'"' -f4 | sed 's|^v||')
INSTALL  := mrv2-v$(VERSION)-Linux-amd64/usr/local/mrv2-v$(VERSION)-Linux-64
FILENAME := mrv2-v$(VERSION)-Linux-amd64.tar.gz
URL      := https://github.com/ggarra13/mrv2/releases/download/v$(VERSION)/$(FILENAME)
ARCH     := amd64

all: snap
.PHONY: all snap

snap: desktop
	sed "s#@VERSION@#$(VERSION)#g ; s#@ARCH@#$(ARCH)#g" snapcraft.yaml.in > snap/snapcraft.yaml
	# We will get a number of unused libraries that are loaded on demand
	# with dlopen or python's imports.
	snapcraft --debug --destructive-mode

desktop: untar
	mkdir -p snap/gui
	cp -f $(INSTALL)/share/applications/mrv2.desktop snap/gui
	cp -f $(INSTALL)/share/icons/hicolor/48x48/apps/mrv2.png snap/gui
	sed -i "s#Exec=.*#Exec=mrv2# ; s#Icon=.*#Icon=$$\{SNAP\}/meta/gui/mrv2.png#" snap/gui/mrv2.desktop

	# Removed incorrect line in the .tar.gz desktop file.
	sed -i "s#Categories=Graphics##" snap/gui/mrv2.desktop

download: clean
	curl -C - -L $(URL) --output $(FILENAME)

untar: download
    ifneq ($(wildcard $(INSTALL)), $(INSTALL))
	tar xfv $(FILENAME)
    endif
	# Some incorrect libraries bundled
	rm -f $(INSTALL)/lib/libndi*5*
	rm -f $(INSTALL)/lib/libtinfo*

install:
	sudo snap install ./mrv2_$(VERSION)_$(ARCH).snap --dangerous --classic

uninstall:
	sudo snap remove mrv2

distclean: clean
	rm -rf mrv2-*-Linux*
	rm -f compile.log

clean:
	rm -f mrv2_$(VERSION)_$(ARCH).snap
	rm -rf parts/ prime/ stage/ snap/

snapcraft.yaml.in

name: mrv2
version: '@VERSION@'
summary: Professional review tool for the vfx, animation and cgi industries.
description: |
  mrv2 is an open source professional review tool for the vfx, animation and cgi  industries.
  It supports many image and video formats, OpenColorIO 2, native OpenTimelineIO
  timelines, a full featured Python API and OpenUSD OpenGL previews.

passthrough:
    license: BSD-3.0
    
base: core22
grade: stable

confinement: classic     # strict, classic or devmode
      
apps:
  mrv2:
    command: bin/mrv2.sh
    plugs:
      - network
      - home
      
parts:
  mrv2:
    plugin: dump
    source: ./mrv2-v@VERSION@-Linux-@ARCH@/usr/local/mrv2-v@VERSION@-Linux-64
    build-attributes:
      - enable-patchelf
    stage-packages:
      - libasound2t64
      - libegl1
      - libfontconfig1
      - libgl1
      - libglu1-mesa
      - libglx0
      - libharfbuzz0b
      - libopengl0
      - libpulse0
      - libx11-6
      - libx11-xcb1
      - libxcb1
      - libxcb-render0
      - libxcb-shm0
      - libxcomposite1
      - libxcursor1
      - libxdamage1
      - libxext6
      - libxft2
      - libxfixes3
      - libxi6
      - libxinerama1
      - libxrandr2
      - libxrender1
      - libxss1
      - libxt6t64
      - libwayland-client0
      - libwayland-cursor0
      - libwayland-egl1

I get GLIBC compatibility errors as it seems something in snapcraft is using the Ubuntu 24.04.4 LTS’ /bin/bash instead of core22’s one.

/bin/bash: /snap/core22/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /bin/bash)
/bin/bash: /snap/core22/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /bin/bash)

Any help is appreciated.

Hi ! @ggarra13.

The depend libc6 seems missing. Add libc6 in your stage-packages.

If I’m understanding your situation correctly, this could be a side effect of packing a core22 snap directly on a 24.04 system with --destructive-mode instead of letting snapcraft manage a 22.04 LXD container or Multipass VM.

1 Like

Hi! @mr_cal.

You were indeed correct regarding LXD. I figured it out after I had posted it. Now I need to figure out why my application icon is not showing on the Desktop.

1 Like