wilzbach / tools-test

1 stars 0 forks source link

RDMD fails at building a lib when the source is in a subdir #125

Closed wilzbach closed 7 years ago

wilzbach commented 9 years ago

Note: the issue was created automatically migrated from https://issues.dlang.org

Original bug ID: BZ#14296 From: Nick Sabalausky <bus_dbugzilla@semitwist.com> Reported version: D2 CC: bugzilla@digitalmars.com, dlang-bugzilla@thecybershadow.net

Depends on: BZ#14305

wilzbach commented 9 years ago

Comment author: Nick Sabalausky <bus_dbugzilla@semitwist.com>

$ mkdir src $ touch src/test.d $ rdmd --build-only -lib src/test.d std.file.FileException@ std/file.d(409): src/test.a: No such file or directory $ ls src/ src test.d $ ls src/src/ test.a.tmp

This used to work with the RDMD packaged in DMD v2.064.2, but fails starting with RDMD 2.065.0.

wilzbach commented 9 years ago

Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net>

(In reply to Nick Sabalausky from comment BZ#0)

This used to work with the RDMD packaged in DMD v2.064.2, but fails starting with RDMD 2.065.0.

It didn't exactly work as one would expect in 2.064.2 either, did it? It still repeated the leading path component, it just didn't crash.

The real bug is in DMD: it interprets -of / -od differently depending on whether -lib is supplied.

There isn't much that can be done on rdmd's side, other than adding detection for .lib and explicitly working around the DMD bug, so it should be fixed in DMD instead.

https://issues.dlang.org/show_bug.cgi?id=14305

wilzbach commented 9 years ago

Comment author: Nick Sabalausky <bus_dbugzilla@semitwist.com>

https://github.com/D-Programming-Language/dmd/pull/4753

wilzbach commented 9 years ago

Comment author: Nick Sabalausky <bus_dbugzilla@semitwist.com>

This can be worked around by giving -of an absolute path:

$ rdmd --build-only -lib src/test.d Fails

$ rdmd --build-only -lib -oflib/hi.a src/test.d Fails

$ rdmd --build-only -lib -ofpwd/lib/hi.a src/test.d/ OK

wilzbach commented 9 years ago

Comment author: Nick Sabalausky <bus_dbugzilla@semitwist.com>

(In reply to Nick Sabalausky from comment BZ#3)

$ rdmd --build-only -lib -ofpwd/lib/hi.a src/test.d/ OK

That should've been:

$ rdmd --build-only -lib -ofpwd/lib/hi.a src/test.d OK

wilzbach commented 9 years ago

Comment author: Walter Bright <bugzilla@digitalmars.com>

A better solution for now is to have rdmd not use both -od and -of.

wilzbach commented 9 years ago

Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net>

(In reply to Walter Bright from comment BZ#5)

A better solution for now is to have rdmd not use both -od and -of.

That would mean to either put the intermediary object files in the current directory or to put the .lib file in a temporary directory. Again it would mean special logic in rdmd depending on whether -lib is supplied to work around the DMD bug.

wilzbach commented 9 years ago

Comment author: Walter Bright <bugzilla@digitalmars.com>

(In reply to Vladimir Panteleev from comment BZ#6)

(In reply to Walter Bright from comment BZ#5)

A better solution for now is to have rdmd not use both -od and -of.

That would mean to either put the intermediary object files in the current directory or to put the .lib file in a temporary directory. Again it would mean special logic in rdmd depending on whether -lib is supplied to work around the DMD bug.

dmd is not going to change the behavior of -od or -of. Their behavior is confusing enough - breaking peoples' makefiles will make things even worse. Best case is adding a new switch with the desired behavior.

rdmd can work by using fully qualified output file names.

wilzbach commented 9 years ago

Comment author: Walter Bright <bugzilla@digitalmars.com>

BTW, every file name generation algorithm in DMD is different from every other one. It is extremely bad design. Frankly, we should design a new set of flags and do it consistently, and then undocument the existing ones.

Meanwhile, rdmd should simply use fully qualified names and avoid the issue entirely.

wilzbach commented 7 years ago

Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net>

https://github.com/dlang/tools/pull/207

wilzbach commented 7 years ago

Comment author: github-bugzilla@puremagic.com

Commits pushed to stable at https://github.com/dlang/tools

https://github.com/dlang/tools/commit/e245e29d8bebe4d3965dbee40216135df513bccf Fix Issue 14296 - RDMD fails at building a lib when the source is in a subdir

https://github.com/dlang/tools/commit/bfbcd086bad634066ba142964823f1689e879aaf Merge pull request BZ#207 from CyberShadow/issue-16962

rdmd fixes (issues 14296, 16962 and 16978) merged-on-behalf-of: Martin Nowak <code@ dawg.eu>

wilzbach commented 7 years ago

Comment author: github-bugzilla@puremagic.com

Commits pushed to master at https://github.com/dlang/tools

https://github.com/dlang/tools/commit/e245e29d8bebe4d3965dbee40216135df513bccf Fix Issue 14296 - RDMD fails at building a lib when the source is in a subdir

https://github.com/dlang/tools/commit/bfbcd086bad634066ba142964823f1689e879aaf Merge pull request BZ#207 from CyberShadow/issue-16962

wilzbach commented 7 years ago

Comment author: github-bugzilla@puremagic.com

Commits pushed to newCTFE at https://github.com/dlang/tools

https://github.com/dlang/tools/commit/e245e29d8bebe4d3965dbee40216135df513bccf Fix Issue 14296 - RDMD fails at building a lib when the source is in a subdir

https://github.com/dlang/tools/commit/bfbcd086bad634066ba142964823f1689e879aaf Merge pull request BZ#207 from CyberShadow/issue-16962