flecs-hub/flecs-systems-civetweb

Build fails on the latest commit

3demax opened this issue · 0 comments

On e293727 Sander Mertens Update civetweb to bleeding_edge:

flecs-systems-civetweb.git  $ bake
[  build] package flecs.systems.civetweb => '.'
[    50%] civet.c
./src/civet.c: In function ‘do_reply’:
./src/civet.c:96:5: error: unknown type name ‘ecs_strbuf_t’; did you mean ‘ecs_table_t’?
   96 |     ecs_strbuf_t buf = ECS_STRBUF_INIT;
      |     ^~~~~~~~~~~~
      |     ecs_table_t
./src/civet.c:96:24: error: ‘ECS_STRBUF_INIT’ undeclared (first use in this function); did you mean ‘UT_STRBUF_INIT’?
   96 |     ecs_strbuf_t buf = ECS_STRBUF_INIT;
      |                        ^~~~~~~~~~~~~~~
      |                        UT_STRBUF_INIT
./src/civet.c:96:24: note: each undeclared identifier is reported only once for each function it appears in
./src/civet.c:97:5: warning: implicit declaration of function ‘ecs_strbuf_append’; did you mean ‘ut_strbuf_append’? [-Wimplicit-function-declaration]
   97 |     ecs_strbuf_append(&buf, "HTTP/1.1 %d OK\r\nAccess-Control-Allow-Origin: *\r\n", status);
      |     ^~~~~~~~~~~~~~~~~
      |     ut_strbuf_append
./src/civet.c:99:9: warning: implicit declaration of function ‘ecs_strbuf_appendstr_zerocpy’; did you mean ‘ut_strbuf_appendstr_zerocpy’? [-Wimplicit-function-declaration]
   99 |         ecs_strbuf_appendstr_zerocpy(&buf, header);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         ut_strbuf_appendstr_zerocpy
./src/civet.c:101:5: warning: implicit declaration of function ‘ecs_strbuf_appendstr’; did you mean ‘ut_strbuf_appendstr’? [-Wimplicit-function-declaration]
  101 |     ecs_strbuf_appendstr(&buf, "\r\n");
      |     ^~~~~~~~~~~~~~~~~~~~
      |     ut_strbuf_appendstr
./src/civet.c:103:17: warning: implicit declaration of function ‘ecs_strbuf_get’; did you mean ‘ut_strbuf_get’? [-Wimplicit-function-declaration]
  103 |     char *msg = ecs_strbuf_get(&buf);
      |                 ^~~~~~~~~~~~~~
      |                 ut_strbuf_get
./src/civet.c:103:17: warning: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
./src/civet.c: In function ‘eval_endpoints’:
./src/civet.c:146:21: warning: implicit declaration of function ‘ecs_lock’; did you mean ‘ecs_lookup’? [-Wimplicit-function-declaration]
  146 |                     ecs_lock(world);
      |                     ^~~~~~~~
      |                     ecs_lookup
./src/civet.c:154:21: warning: implicit declaration of function ‘ecs_unlock’ [-Wimplicit-function-declaration]
  154 |                     ecs_unlock(world);
      |                     ^~~~~~~~~~
./src/civet.c: In function ‘CivetInit’:
./src/civet.c:256:49: error: expected expression before ‘EcsHttpEndpoint’
  256 |         server_data->endpoints = ecs_vector_new(EcsHttpEndpoint, 0);
      |                                                 ^~~~~~~~~~~~~~~
./src/civet.c:256:34: error: too few arguments to function ‘ecs_vector_new’
  256 |         server_data->endpoints = ecs_vector_new(EcsHttpEndpoint, 0);
      |                                  ^~~~~~~~~~~~~~
In file included from /home/user/bake/include/flecs.h:29,
                 from ./include/flecs-systems-civetweb/bake_config.h:21,
                 from ./include/flecs_systems_civetweb.h:4,
                 from ./src/civet.c:2:
/home/user/bake/include/flecs/util/vector.h:30:15: note: declared here
   30 | ecs_vector_t* ecs_vector_new(
      |               ^~~~~~~~~~~~~~
./src/civet.c:257:57: error: expected expression before ‘ecs_entity_t’
  257 |         server_data->endpoint_entities = ecs_vector_new(ecs_entity_t, 0);
      |                                                         ^~~~~~~~~~~~
./src/civet.c:257:42: error: too few arguments to function ‘ecs_vector_new’
  257 |         server_data->endpoint_entities = ecs_vector_new(ecs_entity_t, 0);
      |                                          ^~~~~~~~~~~~~~
In file included from /home/user/bake/include/flecs.h:29,
                 from ./include/flecs-systems-civetweb/bake_config.h:21,
                 from ./include/flecs_systems_civetweb.h:4,
                 from ./src/civet.c:2:
/home/user/bake/include/flecs/util/vector.h:30:15: note: declared here
   30 | ecs_vector_t* ecs_vector_new(
      |               ^~~~~~~~~~~~~~
./src/civet.c: In function ‘CivetRegisterEndpoint’:
./src/civet.c:320:73: warning: passing argument 3 of ‘_ecs_get_ptr’ makes pointer from integer without a cast [-Wint-conversion]
  320 | CivetServerComponent *c = _ecs_get_ptr(rows->world, server, server_component_handle);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             ecs_entity_t {aka long unsigned int}

In file included from ./include/flecs-systems-civetweb/bake_config.h:21,
                 from ./include/flecs_systems_civetweb.h:4,
                 from ./src/civet.c:2:
/home/user/bake/include/flecs.h:1090:16: note: expected ‘ecs_type_t’ {aka ‘const ecs_vector_t *’} but argument is of type ‘ecs_entity_t’ {aka ‘long unsigned int’}
 1090 |     ecs_type_t type);
      |     ~~~~~~~~~~~^~~~
./src/civet.c:324:72: error: expected expression before ‘EcsHttpEndpoint’
  324 |  EcsHttpEndpoint *new_ep = ecs_vector_add(&data->endpoints, EcsHttpEndpoint);
      |                                                             ^~~~~~~~~~~~~~~

./src/civet.c:326:81: error: expected expression before ‘ecs_entity_t’
  326 | ty_t *new_entity = ecs_vector_add(&data->endpoint_entities, ecs_entity_t);
      |                                                             ^~~~~~~~~~~~

./src/civet.c: In function ‘FlecsSystemsCivetwebImport’:
./src/civet.c:348:5: warning: implicit declaration of function ‘ecs_enable_locking’; did you mean ‘ecs_enable_admin’? [-Wimplicit-function-declaration]
  348 |     ecs_enable_locking(world, true);
      |     ^~~~~~~~~~~~~~~~~~
      |     ecs_enable_admin
In file included from ./include/flecs-systems-civetweb/bake_config.h:21,
                 from ./include/flecs_systems_civetweb.h:4,
                 from ./src/civet.c:2:
/home/user/bake/include/flecs.h:2047:9: warning: unused variable ‘handles’ [-Wunused-variable]
 2047 |     id *handles = (id*)ecs_get_singleton_ptr(world, id);\
      |         ^~~~~~~
./src/civet.c:341:5: note: in expansion of macro ‘ECS_MODULE’
  341 |     ECS_MODULE(world, FlecsSystemsCivetweb);
      |     ^~~~~~~~~~
error process 149477 exited with returncode 1
 from command returned 1
   gcc -fPIC -fno-stack-protector -g -O0 -std=c99 -D_XOPEN_SOURCE=600 -Wall -D__BAKE__ -D__BAKE__ -DBAKE_PROJECT_ID="flecs.systems.civetweb" -DFLECS_SYSTEMS_CIVETWEB_IMPL -I./include -I /home/user/bake/include -c ./src/civet.c -o .bake_cache/x64-Linux-debug/obj/civet.o
 from command for task 'civet.c' failed
 from dependency 'objects' failed
 from failed to build rule 'ARTEFACT'
[  error] build interrupted for flecs.systems.civetweb in .
error project 'flecs.systems.civetweb' built with errors, skipping

However, it builds fine on commit 4f7c52f Sander Mertens Fix memory leak, change ut_strbuf to ecs_strbuf:

flecs-systems-civetweb.git  $ bake
[  build] package flecs.systems.civetweb => '.'
[    50%] civet.c
[   100%] civetweb.c