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

rdmd doesn't respect DFLAGS for its cache hash #424

Open
dlang-bugzilla-migration opened this issue Jan 9, 2021 · 0 comments · May be fixed by #343
Open

rdmd doesn't respect DFLAGS for its cache hash #424

dlang-bugzilla-migration opened this issue Jan 9, 2021 · 0 comments · May be fixed by #343
Labels
Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense

Comments

@dlang-bugzilla-migration

Transferred from: https://issues.dlang.org/show_bug.cgi?id=18433

User @marler8997 reported (2018-Feb-13 16:41:59):

rdmd currently ignores DFLAGS. These flags should be treated like all the other compiler flags.

User @wilzbach responded (2018-Mar-27 22:48:04):

Hmm I think the problem is more in DMD not respecting everything from DFLAGS:
However, this has been in master:

$ cat > foo.d << EOF
void main(){
    import std.stdio;
    version(Foo)
    {
        "foo".writeln;
    }
    else
    {
        "bar".writeln;
    }
}
EOF
$ dmd -version=Foo foo.d && ./foo
foo
$ DFLAGS="-version=Foo" dmd foo.d && ./foo
bar
$ DFLAGS="-version=Foo" rdmd --force foo.d
bar

(with ~master this correctly yields foo for all commands)

But it looks like rdmd's caching doesn't include a hash of DFLAGS.

$ DFLAGS="-version=Foo" rdmddev foo.d
foo
$ DFLAGS="-version=Bar" rdmddev foo.d
foo

(so I'm renaming this)

User @wilzbach responded (2018-Mar-27 23:16:22):

Argh, apparently this hasn't been fixed in master and DFLAGS is only looked at when -conf= is set:

$ DFLAGS="-version=Foo" ../dmd/generated/linux/release/64/dmd -v foo.d && ./foo
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binary    ../dmd/generated/linux/release/64/dmd
version   v2.079.0-284-g23b2e2e0d
config    ../dmd/generated/linux/release/64/dmd.conf
DFLAGS    -I../dmd/generated/linux/release/64/../../../../../druntime/import -I../dmd/generated/linux/release/64/../../../../../phobos -L-L../dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64 -L--export-dynamic -fPIC
$ DFLAGS="-version=Foo" dmd -conf= -I~/dlang/phobos -I~/dlang/druntime/import -c -v foo.d
predefs   Foo DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binary    /home/seb/dlang/dmd/generated/linux/release/64/dmd
version   v2.079.0-284-g23b2e2e0d
config
DFLAGS    -version=Foo

User @wilzbach responded (2018-Mar-27 23:31:42):

#343

@dlang-bugzilla-migration dlang-bugzilla-migration added Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd labels Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant