[Issue 13716] New: Phobos std.file fails to build

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Nov 12 00:49:17 PST 2014


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

          Issue ID: 13716
           Summary: Phobos std.file fails to build
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at digitalmars.com

The error message is:

std\file.d(1503): Error: safe function 'std.file.mkdir' cannot call system
function 'std.windows.syserror.wenforce!(int, const(char)[]).wenforce'

And in std\file.d:
--------------------------------------
void mkdir(in char[] pathname) @safe
{
    version(Windows)
    {
        static auto trustedCreateDirectoryW(in char[] path) @trusted
        {
            return CreateDirectoryW(path.tempCStringW(), null);
        }
        wenforce(trustedCreateDirectoryW(pathname), pathname);
    }
    else version(Posix)
    {
        static auto trustedMkdir(in char[] path, mode_t mode) @trusted
        {
            return core.sys.posix.sys.stat.mkdir(path.tempCString(), mode);
        }
        cenforce(trustedMkdir(pathname, octal!777) == 0, pathname);
    }
}
------------------------------------
And in std\windows\syserror.d:
------------------------------------
T wenforce(T, S)(T value, lazy S msg = null,
    string file = __FILE__, size_t line = __LINE__) if (isSomeString!S)
{
    if (!value)
        throw new WindowsException(GetLastError(), to!string(msg), file, line);
    return value;
}
------------------------------------

Yep, it's a system function. This is the current HEAD. I have no idea how any
of this passes the build tester; it won't build on my machine.

--


More information about the Digitalmars-d-bugs mailing list