[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Iain Buclaw changed: What|Removed |Added Priority|P2 |P1 --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Mike Franklinchanged: What|Removed |Added See Also||https://issues.dlang.org/sh ||ow_bug.cgi?id=18710 --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Mikechanged: What|Removed |Added CC||slavo5...@yahoo.com See Also||https://issues.dlang.org/sh ||ow_bug.cgi?id=3541 --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 --- Comment #7 from Timothee Cour--- For windows: > Please do not forget about Windows - how would you propose handling `dmd -c -od=mydir -op C:\bla.d D:\bla.d` then? ;) => creates: mydir/C/bla.o mydir/D/bla.o but again, as in the proposal user can also write: dmd -c -od=mydir -op=C:\ C:\bla.d D:\bla.d => creates: mydir/bla.o mydir/D/bla.o it's nice and consistent. Another possiblity is to disallow the combo(windows+op+absolute files), but that doesn't seem necessary. But whatever is decided on windows, hopefully we can at least do what's proposed here on mac/linux. --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 --- Comment #6 from ki...@gmx.net --- (In reply to Timothee Cour from comment #5) > * dmd -od=mydir -op /absolute_path/fun.d should write to: > mydir/absolute_path/fun.o (eg: -od=/tmp/ => /tmp/absolute_path/fun.o) > > this behavior is useful when users don't want to pollute a source repository > with .o files, or when they want to keep multiple cached versions of object > files (eg for different compilation options): the current behavior > (/absolute_path/fun.o) won't allow that. Please do not forget about Windows - how would you propose handling `dmd -c -od=mydir -op C:\bla.d D:\bla.d` then? ;) --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 --- Comment #5 from Timothee Cour--- Expected behavior: * dmd -h | grep '\-od' should be accurate (currently: "write object & library files to directory" is not true when source path is absolute or contains ..; but would be under my proposed points below) * `rdmd -c ` should place .o/.a files in same place as `dmd -c` (not the case currently) * dmd -op (path with ..)/fun.d should be an error: it's dangerous and unexpected to have something writing BELOW dir when user gives '-od=mydir'. But this won't restrict any use case, see below. * `dmd` should be equivalent to `dmd -od=.` * dmd -od=mydir -op /absolute_path/fun.d should write to: mydir/absolute_path/fun.o (eg: -od=/tmp/ => /tmp/absolute_path/fun.o) this behavior is useful when users don't want to pollute a source repository with .o files, or when they want to keep multiple cached versions of object files (eg for different compilation options): the current behavior (/absolute_path/fun.o) won't allow that. * Also introduce an optional value for -op=dir (multiple are possible, eg: -op=mydir1 -op=mydir2) to make paths be relative to the first (if any) directory where the absolute path is found: dmd -c -od=/tmp/ -op=/absolute_path/ -op=import/ /absolute_path/std/fun.d import/core/bar.d source/core/bar.d /tmp/std/fun.o (thanks to -op=/absolute_path/) /tmp/core/bar.o (thanks to -op=import/) /tmp/source/core/bar.o (no match inside -op=) There is a value to both -oq and -op (with the above fixes): -op: allows compiling multiple source files with same module name (eg: core.bar), which can be useful -oq: should be used most of the time (when we don't expect such module name clashes), because all builds are simply under 1 directory, simpler to reason about. --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Andrei Alexandrescuchanged: What|Removed |Added CC||and...@erdani.com --- Comment #4 from Andrei Alexandrescu --- (In reply to Timothee Cour from comment #3) > still completely broken: > > dmd --version > DMD64 D Compiler v2.073.0-devel-a2b772f > rdmd | grep build > rdmd build 20170107 > > fun.d: > void main(){} > > # with absolute path_to_file.d: > dmd -op -od/tmp/d01 /path/bug_12116/fun.d > creates ./fun and /path/bug_12116/fun.o (BUG: /tmp/d01 is ignored) > > dmd -c -op -od/tmp/d01 /path/bug_12116/fun.d > creates /path/bug_12116/fun.o (BUG: /tmp/d01 is ignored) > > rdmd -c -op -od/tmp/d01 /path/bug_12116/fun.d > creates /tmp/d01/fun.o (BUG: inconsistent with dmd) > > # with .. in path_to_file.d: > mkdir temp && cd temp > dmd -op -od/tmp/d01 ../bug_12116/fun.d > creates ./fun and /tmp/bug_12116/fun.o (BUG: expected: something under > /tmp/d01) > > rdmd -op -od/tmp/d01 ../bug_12116/fun.d > creates /tmp/d01/fun (BUG: inconsistent with dmd) and the .o under > */.rdmd-501/* (OK) > > > # with -c: > dmd -c -op -od/tmp/d01 ../bug_12116/fun.d > /tmp/bug_12116/fun.o (BUG) > > rdmd -c -op -od/tmp/d01 ../bug_12116/fun.d > creates /tmp/d01/fun.o (BUG: inconsistent with dmd) > > > # with no absolute path and not .. in file.d: > dmd -c -op -od/tmp/d01 bug_12116/fun.d > creates /tmp/d01/bug_12116/fun.o (OK) > > rdmd -c -op -od/tmp/d01 bug_12116/fun.d > creates /tmp/d01/fun.o (BUG:inconsistent with dmd) > > Other argument why -op is much less useful compared to -oq: > * forces you be at the root of module import paths > * if you have multiple module roots, it can't work: > > dmd -c -op -od/tmp/d01/ -Iroot1/import -Ipath2/root2/import/ > root1/import/std/path.d path2/root2/import/core/stdio.d > > => will create: > /tmp/d01/root1/import/std/path.o > /tmp/d01/path2/root2/import/core/stdio.o > > with -oq semantics are a lots easier, predictable, no weird edge cases, and > easy to implement: > /tmp/d01/std.path.o > /tmp/d01/core.stdio.o Could you please paste this entire post along with what _should_ be the behavior? Thanks. --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Timothee Courchanged: What|Removed |Added CC||timothee.co...@gmail.com --- Comment #3 from Timothee Cour --- still completely broken: dmd --version DMD64 D Compiler v2.073.0-devel-a2b772f rdmd | grep build rdmd build 20170107 fun.d: void main(){} # with absolute path_to_file.d: dmd -op -od/tmp/d01 /path/bug_12116/fun.d creates ./fun and /path/bug_12116/fun.o (BUG: /tmp/d01 is ignored) dmd -c -op -od/tmp/d01 /path/bug_12116/fun.d creates /path/bug_12116/fun.o (BUG: /tmp/d01 is ignored) rdmd -c -op -od/tmp/d01 /path/bug_12116/fun.d creates /tmp/d01/fun.o (BUG: inconsistent with dmd) # with .. in path_to_file.d: mkdir temp && cd temp dmd -op -od/tmp/d01 ../bug_12116/fun.d creates ./fun and /tmp/bug_12116/fun.o (BUG: expected: something under /tmp/d01) rdmd -op -od/tmp/d01 ../bug_12116/fun.d creates /tmp/d01/fun (BUG: inconsistent with dmd) and the .o under */.rdmd-501/* (OK) # with -c: dmd -c -op -od/tmp/d01 ../bug_12116/fun.d /tmp/bug_12116/fun.o (BUG) rdmd -c -op -od/tmp/d01 ../bug_12116/fun.d creates /tmp/d01/fun.o (BUG: inconsistent with dmd) # with no absolute path and not .. in file.d: dmd -c -op -od/tmp/d01 bug_12116/fun.d creates /tmp/d01/bug_12116/fun.o (OK) rdmd -c -op -od/tmp/d01 bug_12116/fun.d creates /tmp/d01/fun.o (BUG:inconsistent with dmd) Other argument why -op is much less useful compared to -oq: * forces you be at the root of module import paths * if you have multiple module roots, it can't work: dmd -c -op -od/tmp/d01/ -Iroot1/import -Ipath2/root2/import/ root1/import/std/path.d path2/root2/import/core/stdio.d => will create: /tmp/d01/root1/import/std/path.o /tmp/d01/path2/root2/import/core/stdio.o with -oq semantics are a lots easier, predictable, no weird edge cases, and easy to implement: /tmp/d01/std.path.o /tmp/d01/core.stdio.o --
[Issue 12116] dmd -op -od broken
https://issues.dlang.org/show_bug.cgi?id=12116 Richard Cattermole alphaglosi...@gmail.com changed: What|Removed |Added CC||alphaglosi...@gmail.com --- Comment #2 from Richard Cattermole alphaglosi...@gmail.com --- Similar again to https://issues.dlang.org/show_bug.cgi?id=13206 but for generated interface files. --
[Issue 12116] dmd -op -od broken
https://d.puremagic.com/issues/show_bug.cgi?id=12116 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added CC||andrej.mitrov...@gmail.com --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2014-02-10 04:57:23 PST --- Related or dupe of: http://d.puremagic.com/issues/show_bug.cgi?id=3541 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---