[Issue 6431] [RDMD] Modifying a library doesn't trigger a rebuild

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 7 08:46:37 UTC 2017


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

--- Comment #8 from Timothee Cour <timothee.cour2 at gmail.com> ---
ok the existing behavior is definitely buggy: when the dependent library is in
a directory not equal to ".", a change to that library will not trigger
recompilation:

```
./setup.sh:

## buggy behavior (correct behavior only with build_dir=.)
build_dir=temp

build_lib(){
        mkdir -p temp
        dmd -of=$build_dir/libfoo.a -lib bar/foo.d
}

build_main(){
        exe=./main
        rdmd -v --build-only -of$exe -L-lfoo -L-L$build_dir --exclude=bar
main.d
        $exe
}

build_all(){
        build_lib
        build_main
        touch $build_dir/libfoo.a
        build_main
}



./main.d:
pragma(msg, "compiling...");
import bar.foo;
pragma(lib, "foo");
void main(){ fun(); }


./bar/foo.d:
module bar.foo;
void fun(){
        import std.stdio;
        writeln("ok1");
}
```

--


More information about the Digitalmars-d-bugs mailing list