Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX build errors (branch deps?) #72

Open
paulicka opened this issue Aug 24, 2020 · 9 comments
Open

OSX build errors (branch deps?) #72

paulicka opened this issue Aug 24, 2020 · 9 comments

Comments

@paulicka
Copy link

paulicka commented Aug 24, 2020

The README.md and 02_build-voxel-tools.md says to build godot_voxel module with same branch as godot.
However, godot master is now 4.0 I believe.
I built godot branch 3.2 and ran the executable on some sample projects without problems. All good.
I then moved godot_voxel into modules/, renaming to modules/voxel/, and tried to build and get errors:

Christophers-iMac:godot christopherpaulicka$ scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu)
scons: Reading SConscript files ...
Building for macOS 10.9+, platform x86-64.
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[ 33%] Compiling ==> modules/voxel/streams/voxel_block_serializer.cpp
[ 33%] Compiling ==> modules/voxel/generators/graph/voxel_graph_runtime.cpp
[ 33%] Compiling ==> modules/voxel/terrain/voxel_lod_terrain.cpp
[ 33%] Compiling ==> modules/voxel/terrain/voxel_map.cpp
modules/voxel/streams/voxel_block_serializer.cpp:101:21: error: conversion from
      'const size_t' (aka 'const unsigned long') to 'const Variant' is ambiguous
                                        .format(varray(metadata_size, (i...
                                                       ^~~~~~~~~~~~~
./core/error_macros.h:314:115: note: expanded from macro 'CRASH_COND_MSG'
  ..."FATAL: Condition \"" _STR(m_cond) "\" is true.", DEBUG_STR(m_msg)); \
                                                                 ^~~~~
./core/error_macros.h:116:26: note: expanded from macro 'DEBUG_STR'
#define DEBUG_STR(m_msg) m_msg
                         ^~~~~
./core/variant.h:251:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant.h:252:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant.h:253:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant.h:259:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant.h:260:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant.h:261:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant.h:262:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant.h:263:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant.h:264:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant.h:265:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant.h:266:2: note: candidate constructor
        Variant(double p_double);
        ^
1 error generated.
scons: *** [modules/voxel/streams/voxel_block_serializer.osx.tools.x86_64.o] Error 1
modules/voxel/generators/graph/voxel_graph_runtime.cpp:477:40: error: 
      conversion from 'unsigned long' to 'const Variant' is ambiguous
  ....format(varray(_program.size() * sizeof(float), _memory.size() * sizeof(...
                    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
modules/voxel/generators/graph/../../util/macros.h:10:14: note: expanded from
      macro 'PRINT_VERBOSE'
                print_line(msg);                            \
                           ^~~
./core/variant.h:251:2: note: candidate constructor
        Variant(bool p_bool);
        ^
./core/variant.h:252:2: note: candidate constructor
        Variant(signed int p_int); // real one
        ^
./core/variant.h:253:2: note: candidate constructor
        Variant(unsigned int p_int);
        ^
./core/variant.h:259:2: note: candidate constructor
        Variant(signed short p_short); // real one
        ^
./core/variant.h:260:2: note: candidate constructor
        Variant(unsigned short p_short);
        ^
./core/variant.h:261:2: note: candidate constructor
        Variant(signed char p_char); // real one
        ^
./core/variant.h:262:2: note: candidate constructor
        Variant(unsigned char p_char);
        ^
./core/variant.h:263:2: note: candidate constructor
        Variant(int64_t p_int); // real one
        ^
./core/variant.h:264:2: note: candidate constructor
        Variant(uint64_t p_int);
        ^
./core/variant.h:265:2: note: candidate constructor
        Variant(float p_float);
        ^
./core/variant.h:266:2: note: candidate constructor
        Variant(double p_double);
        ^
1 error generated.
scons: *** [modules/voxel/generators/graph/voxel_graph_runtime.osx.tools.x86_64.o] Error 1
scons: building terminated because of errors.

I tried building from godot master, but that didn't work either.

Any thoughts?

@TokisanGames
Copy link
Contributor

Build only with Godot 3.2. Godot 4 isn't anywhere close to stable or complete, and voxel tools doesn't support it yet.

@paulicka
Copy link
Author

Thanks, @tinmanjuggernaut...I tried that and it didn't work: godot 3.2 and godot_voxel master.
I made sure to update to latest XCode, same errors.
(Heh...I went to verify on Windows yet can't even get godot 3.2 to build using scoop libraries...)

@Zylann
Copy link
Owner

Zylann commented Aug 24, 2020

I bet you're using clang? People have reported problems several times when trying to pass uint64_t or size_t to Variant on OSX and Javascript builds, it is quite infuriating Zylann/godot_voxel#170

One dumb fix is to cast to int I guess, but it's not clean, I wonder what the correct fix should be.

@TokisanGames
Copy link
Contributor

TokisanGames commented Aug 24, 2020 via email

@paulicka
Copy link
Author

@Zylann I'm not sure if I am using clang...how do I check? I followed the build directions on Compiling for mac OS using 'brew'.
Or perhaps, more importantly, how do I use something else that works? ;-)

@tinmanjuggernaut I was building from source because I tried to run blocky_game/blocky_game.tscn and got Invalid call. Nonexistent function 'get_voxel_index_from_name' in base 'VoxelLibrary'.
Perhaps you could make a new binary? ;-)

Thanks for the quick feedback.

@Zylann
Copy link
Owner

Zylann commented Aug 24, 2020

@tinmanjuggernaut in case you do make a new build, it's going to be marked as the 3.2.3 version (currently master), as I made a changelog to reflect what's in each version https://github.com/Zylann/godot_voxel/blob/master/CHANGELOG.md#master-godot-323 . I'm going to make a branch to tag it in the Git history as well based on the current last commit

@paulicka I don't know^^" OSX uses clang AFAIK, I wish there was a proper fix than casting all the problematic variant conversions to int

@TokisanGames
Copy link
Contributor

@Zylann I'm not sure if I am using clang...how do I check? I followed the build directions on Compiling for mac OS using 'brew'.

Brew is a package manager, not a compiler.
Read your build log. It will tell you what compiler its using. Or look in your package manager and see what compilers are installed. Clang/llvm is usually the default.

@tinmanjuggernaut I was building from source because I tried to run blocky_game/blocky_game.tscn and got Invalid call. Nonexistent function 'get_voxel_index_from_name' in base 'VoxelLibrary'.
Perhaps you could make a new binary? ;-)

You can edit the gdscript to comment out that line. Or use my demos, which work with my build. Seems like a lot of work to avoid a few lines of gdscript in a demo.

@paulicka
Copy link
Author

paulicka commented Aug 24, 2020

Okey dokey...3 lines with some casts to int and it builds (and runs blocky game ;-) for me.

@tinmanjuggernaut Do you want the binary?

(I tried adding env.Append(CPPDEFINES = ['NEED_LONG_INT']) to platform/osx/SCsub but that didn't work, so I'm not sure if a) I'm defining the flag incorrectly, or b) NEED_LONG_INT doesn't solve the problem, and c) I couldn't figure out a way to debug that easily)

@Zylann Should I add an addendum to Issue 170 (since it only mentions javascript), and/or keep this open until it's fixed in master?

@Zylann
Copy link
Owner

Zylann commented Aug 24, 2020

@Zylann Should I add an addendum to Issue 170 (since it only mentions javascript), and/or keep this open until it's fixed in master?

Probably. I still haven't got an answer from Godot devs about this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants