godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.68k stars 20.11k forks source link

Cannot build Godot with most modules disabled - error in linking step #83947

Closed qarmin closed 10 months ago

qarmin commented 10 months ago

Godot version

v4.2.beta.custom_build. e8d57afae

System information

Ubuntu 22.04 CI

Issue description

 scons -j2 dev_build=yes target=editor use_asan=yes use_ubsan=yes linker=gold module_basis_universal_enabled=no module_bmp_enabled=no module_camera_enabled=no module_csg_enabled=no module_cvtt_enabled=no module_dds_enabled=no module_denoise_enabled=no module_enet_enabled=no module_etcpak_enabled=no brotli=no module_gltf_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_jpg_enabled=no module_lightmapper_rd_enabled=no module_mbedtls_enabled=no module_meshoptimizer_enabled=no module_minimp3_enabled=no module_mobile_vr_enabled=no module_msdfgen_enabled=no module_multiplayer_enabled=no module_noise_enabled=no module_ogg_enabled=no module_openxr_enabled=no module_raycast_enabled=no module_regex_enabled=no module_squish_enabled=no graphite=no module_text_server_adv_enabled=no module_tga_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_upnp_enabled=no module_vhacd_enabled=no module_vorbis_enabled=no module_webp_enabled=no module_webrtc_enabled=no module_websocket_enabled=no module_webxr_enabled=no module_xatlas_unwrap_enabled=no
Linking Static Library core/libcore.linuxbsd.editor.dev.x86_64.san.a ...
Ranlib Library core/libcore.linuxbsd.editor.dev.x86_64.san.a ...
Linking Program bin/godot.linuxbsd.editor.dev.x86_64.san ...
main/main.cpp:1557: error: undefined reference to 'GDScriptLanguageServer::port_override'
main/main.cpp:1557: error: undefined reference to 'GDScriptLanguageServer::port_override'
collect2: error: ld returned 1 exit status
scons: *** [bin/godot.linuxbsd.editor.dev.x86_64.san] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:44:31.753]

Steps to reproduce

Above

Minimal reproduction project

Above

AThousandShips commented 10 months ago

This is caused by that the LSP is only compiled if: env["module_jsonrpc_enabled"] and env["module_websocket_enabled"]

Should check the same in main I suspect, currently the following is checked:

#if defined(TOOLS_ENABLED) && !defined(GDSCRIPT_NO_LSP)
#include "modules/gdscript/language_server/gdscript_language_server.h"
#endif // TOOLS_ENABLED && !GDSCRIPT_NO_LSP

GDSCRIPT_NO_LSP is defined if the above condition is false, but in env_gdscript, so unsure if this propagates to the context of main

AThousandShips commented 10 months ago

This originates in:

CC @ryanabx