armory3d / armory3d/armory

Krom is linked against Glibc 2.36. Ubuntu 22.04 LTS comes with Glibc 2.35

Open
#2,980 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
3.3k
Forks
353
Avg merge
3d 16h
Merged PRs (30d)
1

Description

Not a bug *per se*, but nevertheless annoying.

**Description**
The newest Armory SDK (2023.12) comes with the Krom player linked against Glibc 2.36. This makes it impossible to run on a Ubuntu 22.04 LTS which comes with Glibc 2.35. The error:

```
Read prefs: "/home/sheemeh/.config/blender/3.6/config/userpref.blend"
Running Armory SDK from /home/sheemeh/armsdk/
Read blend: "/home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/logic_event_fromhaxe.blend"
Project updated to SDK v2023.12($Id: a37ffcb4d907facd1fac49da73140d27381e689a $)
Project cleaned
Using CPU for environment render (might be slow). If possible, configure GPU rendering in Blender preferences (System > Cycles Render Devices).
Saved: '/home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/compiled/Assets/envmaps/env_World.jpg'
Time: 00:00.15 (Saving: 00:00.02)

CMFT info: Converting latlong image to cubemap.
CMFT info: Saving spherical harmonics coefficients to /home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/compiled/Assets/envmaps/env_World_irradiance.c
CMFT info: Done.
"/home/sheemeh/armsdk/lib/armory_tools/cmft/cmft-linux64" --input "/home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/compiled/Assets/envmaps/env_World_radiance.jpg" --filter radiance --dstFaceSize 128.0 --srcFaceSize 128.0 --excludeBase false --glossScale 8 --glossBias 3 --lightingModel blinnbrdf --edgeFixup none --numCpuProcessingThreads 2 --useOpenCL true --clVendor anyGpuVendor --deviceType gpu --deviceIndex 0 --generateMipChain true --inputGammaNumerator 1.0 --inputGammaDenominator 1.0 --outputGammaNumerator 1.0 --outputGammaDenominator 1.0 --outputNum 1 --output0 "/home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/compiled/Assets/envmaps/env_World_radiance" --output0params hdr,rgbe,latlong --silent
#512x256
#256x128
#128x64
#64x32
#32x16
#16x8
#8x4
#4x2
#2x1
#1x1
/home/sheemeh/armsdk/nodejs/node-linux64 /home/sheemeh/armsdk/Kha/make krom -g opengl --shaderversion 330 --parallelAssetConversion -1 --to build_logic_event_fromhaxe/debug --quiet
Finished in 11.502s
/home/sheemeh/armsdk/Krom/Krom /home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/debug/krom /home/sheemeh/armory_examples-22.06/logic_event_fromhaxe/build_logic_event_fromhaxe/debug/krom-resources
/home/sheemeh/armsdk/Krom/Krom: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /home/sheemeh/armsdk/Krom/Krom)
WARNING: Player exited code 1
```

Running `/lib/x86_64-linux-gnu/libc.so.6` outputs:

```
GNU C Library (Ubuntu GLIBC 2.35-0ubuntu3.5) stable release version 2.35.
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 11.4.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
.
```

**To Reproduce**
1. Run Blender with the Armory Addon installed on an Ubuntu LTS system, 22.04
2. Open an example `.blend` file
3. Hit Play button

**Expected behavior**
The example plays successfully.

**System**
Blender: `./blender --version` output:

```
Blender 3.6.5
build date: 2023-10-18
build time: 23:31:25
build commit date: 2023-10-16
build commit time: 14:30
build hash: cf1e1ed46b7e
build platform: Linux
build type: release
build c flags: -Wall -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wno-stringop-overread -Wno-stringop-overflow -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5 -std=gnu11 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2
build c++ flags: -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wundef -Wmissing-declarations -Wimplicit-fallthrough=5 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off -msse2
build link flags: -Wl,--version-script='/home/blender/git/blender-v360/blender.git/source/creator/symbols_unix.map'
build system: CMake
```
Armory: `v2023.12($Id: a37ffcb4d907facd1fac49da73140d27381e689a $)`
OS: `$ uname -a` output:

```
Linux emptyspace 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
```

Graphics card: `lspci | grep VGA` output:

```
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)
```

**Test File**
`armory_examples-22.06.zip/logic_event_fromhaxe/logic_event_fromhaxe.blend`

P.S. I successfully built the Krom player from the `armocore` repo, although it needed a few `-dev` packages I was missing on my system. I have renamed the output binary in `./Deployment` directory, `Armory`, to `Krom` and replaced the one in Armory SDK. The latest commit built fails with the following error:

```
Using OpenGL version 4.6 (forward-compatible).
Trace: TypeError: Krom.createFragmentShader is not a function
at new kha_graphics4_FragmentShader (:45931:23)
at kha_Shaders.init (:27419:36)
at kha_SystemImpl.init (:28006:15)
at kha_System.start (:27686:18)
at start (:2866:15)
at armory_system_Starter.main (:2876:3)
at Main.main (:79:25)
at :51545:6
at :51546:3

#
# Fatal error in v8::Function::Call
# Function to be called is a null pointer
#
```

and the one suggested by @MoritzBrueckner in [armocore issue #71](https://github.com/armory3d/armorcore/issues/71#issuecomment-1823308968) (91203c36994a770de878aa234aec7f52f46aff1a):

```
Using OpenGL version 4.6 (forward-compatible).
Trace: TypeError: Krom.setAudioCallback is not a function
at kha_SystemImpl.init (:28038:8)
at kha_System.start (:27686:18)
at start (:2866:15)
at armory_system_Starter.main (:2876:3)
at Main.main (:79:25)
at :51545:6
at :51546:3
```

Using `LD_PRELOAD` trick on a compiled glibc somewhere in `/opt/` could work, but the amount of libs needed to manually list is ridiculously large. Chrooting Armory with a custom glibc could also work, but also too much hassle. I don't feel comfortable at just installing this compiled version over the system one. Distro upgrade is also not really an option.

tl;dr: which armorcore commit should one build in order to have a Krom that links against one's system glibc?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with Blender 3.6.5 and armory_examples-22.06.zip/logic_event_fromhaxe/logic_event_fromhaxe.blend, then inspect the Krom build in the armocore repository. Compare the suggested commit 91203c36994a770de878aa234aec7f52f46aff1a and the current build, including the Krom API errors reported in the issue. Done means a Krom binary runs on Ubuntu 22.04 with glibc 2.35 and the example plays successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
blender, cpp, linux, ubuntu
Domain
build-system, game-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.