nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.52k stars 29.03k forks source link

getuid() needs unistd.h #54519

Open moubctez opened 3 weeks ago

moubctez commented 3 weeks ago

Version

22.7.0

Platform

Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64
NetBSD 10.99.11 NetBSD 10.99.11 (GENERIC64) #0: Sun Aug  4 09:02:47 CEST 2024  adam@Apollo.local:/tmp/pkgsrc/obj.aarch64/sys/arch/evbarm/compile/GENERIC64 evbarm

Subsystem

No response

What steps will reproduce the bug?

Compile 22.7.0 on BSD or Darwin (22.6.0 is fine).

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Compiles fine

What do you see instead?

Compilation fails with: ../src/compile_cache.cc:42:31: error: use of undeclared identifier 'getuid'

Additional information

Fix:

--- src/compile_cache.cc.orig   2024-08-23 09:02:08.124809520 +0000
+++ src/compile_cache.cc
@@ -1,5 +1,6 @@
 #include "compile_cache.h"
 #include <string>
+#include <unistd.h>
 #include "debug_utils-inl.h"
 #include "env-inl.h"
 #include "node_file.h"
RedYetiDev commented 3 weeks ago

Hi! If you'd like to submit a change, please open a PR.