Skip to content

Cannot cache build in the presence of __FILE_FULL_PATH__ #2840

@Geod24

Description

@Geod24

Reported by @kinke .

#!/usr/bin/env dub
/++ dub.json:
   {
       "name": "build"
   }
+/

import std.format;

immutable FullPath = __FILE_FULL_PATH__;

void main (string[] args)
{
    assert(args.length == 2, "Expected a single argument");
    assert(args[1] == FullPath, format("%s != %s -- %s", args[1], FullPath, args[0]));
}
echo "$CODE" > build.d && chmod +x build.d
./build.d $(pwd)/build.d
mkdir nested && cp build.d nested/ && cd nested
./build.d $(pwd)/build.d

Results in:

[email protected](15): /home/mlang/projects/dlang/dub/foo/nested/build.d != /home/mlang/projects/dlang/dub/foo/build.d -- /tmp/.dub/build/build-~master/application-debug-zjWJHxauIHQN4hH1LrZ2uA/build
----------------
??:? [0x563be84e1f06]
??:? [0x563be84e1b82]
??:? [0x563be85080d6]
??:? [0x563be84e96ef]
??:? [0x563be84e0bd3]
build.d:15 [0x563be84a7b4f]
??:? [0x563be84e93bc]
??:? [0x563be84e92b6]
??:? [0x563be84e910d]
/home/mlang/dlang/ldc-1.35.0/bin/../import/core/internal/entrypoint.d:42 [0x563be84a7d41]
??:? [0x7faca72c3d8f]
??:? __libc_start_main [0x7faca72c3e3f]
??:? [0x563be84a7984]
Error Program exited with code 1

Because the program does not get rebuilt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions