LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.67k stars 628 forks source link

Build fails with zstd 1.5.6, but build without errors with 1.5.5 #968

Closed VVD closed 2 months ago

VVD commented 2 months ago

Version

3.3.4 (snapshot)

Platform

FreeBSD amd64

JDK

OpenJDK 17.0.10+7-1

Module

zstd

Bug description

After update zstd from 1.5.5 to 1.5.6 build fails in module zstd.

OS: FreeBSD 13.3 amd64.

Stacktrace or crash log output

[Compiler] /tmp/work/usr/ports/games/lwjgl3/work/lwjgl3-de8bd86/modules/lwjgl/zstd/src/generated/c/org_lwjgl_util_zstd_ZstdX.c:62:19: fatal error: 'ZSTD_generateSequences' is deprecated: For debugging only, will be replaced by ZSTD_extractSequences() [-Wdeprecated-declarations]
 [Compiler]    62 |     return (jlong)ZSTD_generateSequences(zc, outSeqs, (size_t)outSeqsSize, src, (size_t)srcSize);
 [Compiler]       |                   ^
 [Compiler] /usr/local/include/zstd.h:1583:1: note: 'ZSTD_generateSequences' has been explicitly marked deprecated here
 [Compiler]  1583 | ZSTD_DEPRECATED("For debugging only, will be replaced by ZSTD_extractSequences()")
 [Compiler]       | ^
 [Compiler] /usr/local/include/zstd.h:61:53: note: expanded from macro 'ZSTD_DEPRECATED'
 [Compiler]    61 | #    define ZSTD_DEPRECATED(message) __attribute__((deprecated(message)))
 [Compiler]       |                                                     ^
 [Compiler] 1 error generated.
  [clang++] Linking lwjgl_tootle
Spasi commented 2 months ago

Hey @VVD,

As I've already explained in #421, such issues are expected when using unsupported native code/binaries. LWJGL tries to avoid incompatibilities as much as possible, but we can't control how 3rd party libraries change. Breaking changes in the native library will always break the LWJGL bindings.

This will be fixed when the Zstd bindings get updated to 1.5.6.

VVD commented 2 months ago

The essence of this bug report (issue) is a request for support for a new version of the zstd. Maybe I create patch self and upload here. In any case, this must be done.

VVD commented 2 months ago
--- config/freebsd/build.xml.orig       2023-12-18 14:22:59 UTC
+++ config/freebsd/build.xml
@@ -410,7 +412,7 @@
         </build>

         <!-- zstd -->
-        <build module="zstd" simple="true" if:true="${binding.zstd}">
+        <build module="zstd" simple="true" flags="-Wno-deprecated-declarations" if:true="${binding.zstd}">
             <beforeCompile>
                 <compile flags="-DZSTD_MULTITHREAD">
                     <arg value="-I${module.lwjgl.rel}/xxhash/src/main/c"/>