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

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

Open
JesseKPhillips opened this issue Mar 8, 2021 · 4 comments
Open

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

JesseKPhillips opened this issue Mar 8, 2021 · 4 comments

Comments

@JesseKPhillips
Copy link

JesseKPhillips commented Mar 8, 2021

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
Copy link
Owner

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:

  • Don't invoke DStep via dub run, I've never tried that. Instead, clone the repository, run dub build and then invoke the binary in the bin directory.
  • Manually invoke the configure script in the DStep project root. It will hopefully print any errors it encounters. This script is automatically run by Dub when building DStep.
  • Manually invoke the configure and specify the path to the root of the LLVM directory using the --llvm-path flag.

[1]

- LLVM_VERSION=6.0.0 # Used by Sociomantic

@JesseKPhillips
Copy link
Author

JesseKPhillips commented Mar 17, 2021

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)

@JesseKPhillips JesseKPhillips changed the title ld cannot find @linker_flags.txt dub run failure - ld cannot find @linker_flags.txt Mar 17, 2021
@mw66
Copy link

mw66 commented Jun 3, 2022

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
Copy link
Owner

@mw66 Running through Dub is currently not supported.

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