-
Notifications
You must be signed in to change notification settings - Fork 0
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
rdmd --build-only --force -c main.d fails: ./main: No such file or directory #154
Comments
Comment author: Timothee Cour <timothee.cour2@gmail.com> main.d: rdmd --build-only --force -c main.d fails: ./main: No such file or directory also tried with -of=main.o and -ofmain.o IIRC that used to work. rdmd build 20161118 std.file.FileException@ std/file.d(679): ./main: No such file or directory4 rdmd 0x000000010d8648ca @ trusted bool std.file.cenforce!(bool).cenforce(bool, const(char)[], const(char), immutable(char)[], ulong) + 150 |
Comment author: Timothee Cour <timothee.cour2@gmail.com> these also fail: mkdir temp rdmd --build-only --force -lib -of=temp/main.a main.d rdmd --build-only --force -lib -oftemp/main.a main.d rdmd --build-only --force -lib -odtemp/ main.d |
Comment author: Timothee Cour <timothee.cour2@gmail.com> as well as: rdmd --build-only --force -lib -odtemp/ -o- main.d |
Comment author: Timothee Cour <timothee.cour2@gmail.com> also broken: std.file.FileException@ std/file.d(679): =/tmp/bar/main: No such file or directory the only thing that works is: rdmd --build-only --force -lib -od/tmp/bar/ main.d but NOT these: |
Comment author: Andrej Mitrovic <andrej.mitrovich@gmail.com> dlang/tools@a63233c seems to have caused the regression for the first test-case. |
Comment author: Andrej Mitrovic <andrej.mitrovich@gmail.com> (In reply to Andrej Mitrovic from comment BZ#4)
That's a merge commit, it was specifically 10ca158. |
Comment author: ag0aep6g@gmail.com Found another one while looking into this: Regarding the bugs here: The -of=/-od= thing (comment 3) seems to be a simple oversight. rdmd has just not been thought of when the feature was implemented in dmd. Should be easy to fix. -o- not working (comment 2) seems to a deliberate restriction. Supporting -c as in the summary may be some work. I must have missed that scenario completely when doing dlang/tools#194. Problem is that rdmd now treats the root module specially: compiles it separately, links everything together in a separate step. That doesn't go naturally with -c, as far as I see. May have to detect -c and do things completely different then. -lib not working with relative paths (comment 3) seems odd. I hope it's just a simple bug, and not a design flaw. I haven't investigated. I'm going to look into this further, but it may take me a while. If anyone else wants to have a go, that would be great. |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> Sorry, what is the use case of using -c ? I think it working was a mere accident. If you want to syntax-check the file, use dmd (not rdmd) with -o-. Or do you want to compile everything into a single object file for some reason? |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> There is a known problem with -lib and -od: https://issues.dlang.org/show_bug.cgi?id=14296 Admittedly it's my fault as my commit introduced the regression, however the underlying bug is that DMD treats -od differently depending on whether -lib is passed or not, which I did not expect. |
Comment author: Timothee Cour <timothee.cour2@gmail.com>
Use case: when dmd's built-in linker magic isn't good enough (eg |
Comment author: @andralex It may indeed be worthwhile to support -c as in "solve all dependencies and produce a big .o file ready for linking". There is no easy way to do that with either dmd or rdmd. Alternatively we could use a --no-link flag but -c seems more direct. Vladimir, what do you think? |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ag0aep6g: Since implementing -c directly is more complicated with the recent changes, can we emulate by using -lib and extracting the lib file's contents or such? Timothee, can you substitute -c with -lib in your use case? If so, we could fix the -od problem and make -c an explicitly unsupported switch like -o-. |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ag0aep6g: There is now an outdated comment in rdmd: // When building libraries, DMD does not generate object files. DMD will now use -c even with -lib. Was this something that changed due to your recent changes? |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> (In reply to Vladimir Panteleev from comment BZ#12)
rdmd, not DMD |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> Another regression: issue 16978 Since there has been no reply from ag0aep6g for 5 days, I am going to revert that PR and add tests for the regressions. Then they or anyone else can have a go at it. |
Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> |
Comment author: github-bugzilla@puremagic.com Commits pushed to stable at https://github.com/dlang/tools dlang/tools@b6ec807 The actual fix was done by the revert. This simply adds a test. dlang/tools@bfbcd08 rdmd fixes (issues 14296, 16962 and 16978) |
Comment author: github-bugzilla@puremagic.com Commits pushed to master at https://github.com/dlang/tools dlang/tools@b6ec807 dlang/tools@bfbcd08 |
Comment author: Timothee Cour <timothee.cour2@gmail.com> Split of the bug pertaining to -of= -od= to https://issues.dlang.org/show_bug.cgi?id=17064 |
Comment author: github-bugzilla@puremagic.com Commits pushed to newCTFE at https://github.com/dlang/tools dlang/tools@b6ec807 dlang/tools@bfbcd08 |
Note: the issue was created automatically migrated from https://issues.dlang.org
Original bug ID: BZ#16962
From: Timothee Cour <timothee.cour2@gmail.com>
Reported version: D2
CC: ag0aep6g@gmail.com, @andralex, andrej.mitrovich@gmail.com, dlang-bugzilla@thecybershadow.net, timothee.cour2@gmail.com
See also: BZ#16978
The text was updated successfully, but these errors were encountered: