atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
231 stars 31 forks source link

unable to process gcc 10.1.0 stdint.h #265

Open Laeeth opened 4 years ago

Laeeth commented 4 years ago
(ldc-1.21.0)➜  libzfs-core git:(master) ✗ dub build                                                                     git:(master|…
WARNING: A deprecated branch based version specification is used for the dependency taggedalgebraic. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Running pre-generate commands for libzfs-core-d...
/tank3/data/symmetry/develop/SIL-zfs/libzfs-core /tank3/data/symmetry/develop/SIL-zfs/libzfs-core
Error: Error parsing '/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include/stdint.h':
error: typedef redefinition with different types ('short' vs 'unsigned short')
error: typedef redefinition with different types ('int' vs 'unsigned int')
error: typedef redefinition with different types ('long long' vs 'unsigned long long')
error: unknown type name '_'
error: expected identifier or '('
Command failed with exit code 1: pushd /tank3/data/symmetry/develop/SIL-zfs/libzfs-core && d++ --preprocess-only --include-path include/libzfs --include-path include source/symmetry/api/libzfs_core.dpp && popd
(ldc-1.21.0)➜  libzfs-core git:(master) ✗ git remote show origin                                                        git:(master|…
* remote origin
  Fetch URL: ssh://git@git.kaleidic.io:1022/integrate/libzfs-core.git
atilaneves commented 4 years ago

I can't reproduce this. I just tried this:

// oops.dpp
#include <stdint.h>

And it worked fine. My gcc is also gcc 10.1.0.

I also cloned libzfs-core and dub build worked. I opened dub.sdl to see what was going on and uncommented d++ actually running after fixing the preGenerateCommands to the below:

preGenerateCommands "d++ --preprocess-only --include-path $PACKAGE_DIR/include/libzfs --include-path $PACKAGE_DIR/include source/symmetry/api/libzfs_core.dpp

No errors. I noticed that the version of dpp listed as a dependency (and it shouldn't, there should probably be a dub fetch instead in the preGenerateCommands) is 0.2.3. That is very old. It's possible that version had an issue. The current doesn't seem to.

Laeeth commented 4 years ago

I tried dpp master. Git pull and my d++ is symlinked to the built executable. I will try again shortly.