armory3d / armortools

3D Content Creation Tools
https://armorpaint.org
Other
3.23k stars 334 forks source link

Linux build breaks with clang16 (?) #1585

Closed lylythechosenone closed 10 months ago

lylythechosenone commented 1 year ago

ArmorPaint version: b91d7b9

OS/device including version: OS: Arch 6.3.8-zen1-1-zen, Mesa 23.1.2-1, Kwin Wayland 5.27.5 Hardware: Ryzen 7 5800X, Radeon 6750 XT, 32GB DDR4

Issue description: Attempting to build for Linux with OpenGL spawns a host of clang compile errors. Compiling with Vulkan results in different JS errors. The errors follow.

OpenGL:

../../../armorcore/Sources/zui/zui_ext.c:501:38: error: incompatible pointer to integer conversion passing 'char[1]' to parameter of type 'int' [-Wint-conversion]                                 zui_text(label, ZUI_ALIGN_RIGHT, "");                                                                  ^~
../../../armorcore/Sources/zui/zui_nodes.c:411:25: error: incompatible pointer to integer conversion assigning to 'int' from 'void *' [-Wint-conversion]
                        but_handle->position = but->default_value;
                                             ^ ~~~~~~~~~~~~~~~~~~
../../../armorcore/Sources/zui/zui_nodes.c:577:153: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
                float to_y = to == NULL ? current->input_y : wy + ZUI_NODE_Y(to) + ZUI_INPUT_Y(canvas, to->inputs, to->inputs_count, link->to_socket) + ZUI_OUTPUTS_H(to->outputs, to->outputs_count) + ZUI_BUTTONS_H(to);
                                                                                                                                                                      ^~~~~~~~~~~
../../../armorcore/Sources/zui/zui_nodes.c:629:108: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
                                                        float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, k) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
                                                                                                                                                            ^~~~
../../../armorcore/Sources/zui/zui_nodes.c:718:106: error: incompatible pointer to integer conversion passing 'zui_node_socket_t **' (aka 'struct zui_node_socket **') to parameter of type 'int' [-Wint-conversion]
                                        float sy = wy + ZUI_NODE_Y(node) + ZUI_INPUT_Y(canvas, inps, node->inputs_count, j) + ZUI_OUTPUTS_H(outs, node->outputs_count) + ZUI_BUTTONS_H(node);
                                                                                                                                            ^~~~

Vulkan:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:119:11)
    at Object.resolve (node:path:1098:7)
    at node:kmake/Project:106:45
    at new Promise (<anonymous>)
    at loadProject (node:kmake/Project:73:12)
    at Project.addProject (node:kmake/Project:635:31)
    at Object.flags.on_project_created (eval at <anonymous> (eval at <anonymous> (node:kmake/Project:109:27)), <anonymous>:18:17)
    at eval (eval at <anonymous> (node:kmake/Project:109:27), <anonymous>:238:14)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
Error: kfile did not call resolve, no project created.
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:119:11)
    at Object.resolve (node:path:1098:7)
    at node:kmake/Project:106:45
    at new Promise (<anonymous>)
    at loadProject (node:kmake/Project:73:12)
    at Project.addProject (node:kmake/Project:635:31)
    at Object.flags.on_project_created (eval at <anonymous> (eval at <anonymous> (node:kmake/Project:109:27)), <anonymous>:18:17)
    at eval (eval at <anonymous> (node:kmake/Project:109:27), <anonymous>:238:14)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Steps to reproduce:

  1. git clone --recurse-submodules -j8 --depth 1 https://github.com/armory3d/armortools.git
  2. cd armortools/armorpaint
  3. ../armorcore/Kinc/make --from ../armorcore -g [opengl|vulkan] --compiler clang --compile
ikonnow commented 1 year ago

I am experiencing the same problem - the Linux build fails even though I have installed the required dependencies correctly. Perhaps they are outdated and need to be updated!

luboslenco commented 10 months ago

Fix at https://github.com/armory3d/armorcore/commit/76147c3852a715fa7de0ad4983695a4209c525d6, thanks for report.