vlang / vinix

Vinix is an effort to write a modern, fast, and useful operating system in the V programming language
https://vlang.io
GNU General Public License v2.0
1.9k stars 120 forks source link

Make distro not working #36

Closed wilsonk closed 2 years ago

wilsonk commented 2 years ago

I just pulled the repo today (upgrade mlibc - d6bd12987ba0d660c8bd8a47c59b0c2647075b2a) and tried to build on an Arch based distro of Linux. I had the same errors in the wget subdir when trying to build with both clang-12.0.1 and gcc-11.1.0:

/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c: In function 'c_strcasecmp':
/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c:49:7: error: 'UCHAR_MAX' undeclared (first use in this function)
   49 |   if (UCHAR_MAX <= INT_MAX)
      |       ^~~~~~~
/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c:25:1: note: 'UCHAR_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
   24 | #include "c-ctype.h"
  +++ |+#include <limits.h>
   25 | 
/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c:49:7: note: each undeclared identifier is reported only once for each function it appears in
   49 |   if (UCHAR_MAX <= INT_MAX)
      |       ^~~~~~~~~
/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c:49:20: error: 'INT_MAX' undeclared (first use in this function)
   49 |   if (UCHAR_MAX <= INT_MAX)
      |                    ^~~~~~~
/home/wilsonk/Downloads/vinix/build/../3rdparty/wget/lib/c-strcasecmp.c:49:20: note: 'INT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?

I tried to just remove the wget directory and maybe get things built that way, but I ran into some similar errors with another package. Not sure why this is happening, but it is a bit of a show stopper :)

Any suggestions?

mintsuki commented 2 years ago

Define "when trying to build with both clang-12.0.1 and gcc-11.1.0"

wilsonk commented 2 years ago

I tried to build once with clang and when it didn't work I deleted the entire vinix directory, pulled everything again and did another 'make distro' with gcc as my compiler. Both builds failed with the same errors above.

mintsuki commented 2 years ago

How are you picking the compiler, exactly? You're not really supposed to do that, you should just have to install the required dependencies (listed in the Readme) and run make distro without any extra flags or exported CC variables.

JalonSolov commented 2 years ago

Strange. It's compiling fine for me right now, on Manjaro.

wilsonk commented 2 years ago

Yep, that was the problem...I set CC/CXX in my .bashrc to clang-12.0.1 and that was the problem (I need clang for a couple other projects so I just default to it). Sorry to bother.