jacob-carlborg / dstep

A tool for converting C and Objective-C headers to D modules
205 stars 37 forks source link

dub run failure - ld cannot find @linker_flags.txt #265

Open JesseKPhillips opened 3 years ago

JesseKPhillips commented 3 years ago

~This is likely caused by the version of libclang, readme says 9 or 10 but Debian 10 only has 6 and 7 available.~

Logging this so that the error is at least searchable for others.

dmd --version

DMD64 D Compiler v2.095.1

cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

dub run dstep -- lctype.h -o lctype.di

## Warning for package dstep, configuration test-functional ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass custom flags
to the compiler, or use one of the suggestions below:

debugMode: Call DUB with --build=debug
debugInfo: Call DUB with --build=debug
unittests: Call DUB with --build=unittest

## Warning for package dstep, configuration test-unit ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass custom flags
to the compiler, or use one of the suggestions below:

debugMode: Call DUB with --build=debug
debugInfo: Call DUB with --build=debug
unittests: Call DUB with --build=unittest

Running pre-generate commands for dstep...
Performing "debug" build using /usr/bin/dmd for x86_64.
dstep 1.0.2: building configuration "default"...
Running pre-build commands...
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Enum.d(264,5): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/MacroDefinition.d(674,9): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Output.d(144,5): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Output.d(1203,13): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Output.d(1295,9): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Record.d(114,9): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
../../.dub/packages/dstep-1.0.2/dstep/dstep/translator/Record.d(146,5): Deprecation: opIn is deprecated.  Use opBinary(string op)(...) if (op == "in") instead.
Linking...
/usr/bin/ld: cannot find @linker_flags.txt: No such file or directory
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.
jacob-carlborg commented 3 years ago

This is likely caused by the version of libclang, readme says 9 or 10 but Debian 10 only has 6 and 7 available.

libclang 6 should work as well, it's even being tested [1]. It's just not something I want to officially support.

Here are a couple of things you can try:

[1] https://github.com/jacob-carlborg/dstep/blob/90d3e23440a32e9912160df77daf41a3444634ca/.travis.yml#L28

JesseKPhillips commented 3 years ago

Utilizing Dstep via the first suggestion (dub build, bin/dstep) works. Failure is thus concluded to be due to using dub run.

Obviously close if this is not desired to be looked at further (I do not ask for such)

mw66 commented 2 years ago

Same issue on a new machine:

$ dub run dstep
Building package dstep in /home/xxx/.dub/packages/dstep-1.0.3/dstep/

## Warning for package dstep, configuration test-functional ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass custom flags
to the compiler, or use one of the suggestions below:

debugMode: Call DUB with --build=debug
debugInfo: Call DUB with --build=debug
unittests: Call DUB with --build=unittest

## Warning for package dstep, configuration test-unit ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass custom flags
to the compiler, or use one of the suggestions below:

debugMode: Call DUB with --build=debug
debugInfo: Call DUB with --build=debug
unittests: Call DUB with --build=unittest

Running pre-generate commands for dstep...
Performing "debug" build using /usr/bin/dmd for x86_64.
dstep 1.0.3: building configuration "default"...
Running pre-build commands...
Linking...
/usr/bin/ld: cannot find @linker_flags.txt: No such file or directory
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.
jacob-carlborg commented 2 years ago

@mw66 Running through Dub is currently not supported.