nodejs / uvwasi

WASI syscall API built atop libuv
MIT License
226 stars 50 forks source link

Conflicting types for 'uvwasi_serdes_read_uint{32,16,8}_t' (from #145

Closed triaxx closed 4 years ago

triaxx commented 4 years ago

At least NetBSD 8.2 is subject to a build failure for nodejs 14.6.0: https://github.com/nodejs/node/issues/34510. @addaleax provides a patch that fixes the issue:

diff --git a/deps/uvwasi/include/wasi_serdes.h b/deps/uvwasi/include/wasi_serdes.h
index f927b82bac9c..746fb72b123e 100644
--- a/deps/uvwasi/include/wasi_serdes.h
+++ b/deps/uvwasi/include/wasi_serdes.h
@@ -9,17 +9,16 @@
   void uvwasi_serdes_write_##name(void* ptr, size_t offset, type value);      \
   type uvwasi_serdes_read_##name(const void* ptr, size_t offset);             \

-#define BASIC_TYPE(type) BASIC_TYPE_(type, type)
 #define BASIC_TYPE_UVWASI(type) BASIC_TYPE_(type, uvwasi_##type)

 #define UVWASI_SERDES_SIZE_uint8_t sizeof(uint8_t)
-BASIC_TYPE(uint8_t)
+BASIC_TYPE_(uint8_t, uint8_t)
 #define UVWASI_SERDES_SIZE_uint16_t sizeof(uint16_t)
-BASIC_TYPE(uint16_t)
+BASIC_TYPE_(uint16_t, uint16_t)
 #define UVWASI_SERDES_SIZE_uint32_t sizeof(uint32_t)
-BASIC_TYPE(uint32_t)
+BASIC_TYPE_(uint32_t, uint32_t)
 #define UVWASI_SERDES_SIZE_uint64_t sizeof(uint64_t)
-BASIC_TYPE(uint64_t)
+BASIC_TYPE_(uint64_t, uint64_t)

 #define UVWASI_SERDES_SIZE_advice_t sizeof(uvwasi_advice_t)
 BASIC_TYPE_UVWASI(advice_t)
cjihrig commented 4 years ago

@triaxx have you tried this patch locally? If so, did it work? I'm just asking because NetBSD isn't tested in the CI.

triaxx commented 4 years ago

Argh, I tested it but on NetBSD 9.0 that is not concerned by the issue. I need to reboot the box this evening to test 8.2.

triaxx commented 4 years ago

@cjihrig the patch of @addaleax fixes the issue on NetBSD 8.2 too.