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

Spurious test failure in t\spec\S16-filehandles\filetest.rakudo.moar #233

nanis opened this Issue Feb 15, 2017 · 1 comment


None yet
2 participants

nanis commented Feb 15, 2017

TL;DR: Test 44 is not going to succeed in a regular user's cmd.exe windows due to restrictions Windows places on symlink creation. Its failure does not indicate a failure in Rakudo or MoarVM. On Windows, the test should be optional and should only be run on versions of Windows which allow regular users to create symlinks.

As mentioned in issue #232, I get:

Failed to create symlink called 'symlink-test-source' on target 'C:\Users\sinan\src\perl6\rakudo\symlink-test-target': Failed to symlink file: operation not permitted
  in block <unit> at t\spec\S16-filehandles\filetest.rakudo.moar line 141

Actually thrown at:
  in block <unit> at t\spec\S16-filehandles\filetest.rakudo.moar line 141

# Looks like you planned 44 tests, but ran 43
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/44 subtests

While Windows indeed have symlinks, creating them is still cumbersome because you have to have started cmd.exe with "Run as Administrator". Rumor has it that Windows 10 Creators Update will allow symlinks to be created without privilege elevation, but, as things currently stand this test cannot succeed as is on Windows and its failure does not indicate a failure of any part of Rakudo or MoarVM (unless one thinks MoarVM should incorporate privilege elevation functionality).

For example, the simple following program:

#include <windows.h>
#include <stdio.h>

int main(void)
    if (CreateSymbolicLink("mylink.t", "mylink.c", 0)) {
        puts("symlink created");
        return 0;

    printf("failed to create symlink: %d\n", GetLastError());
    return 1;

fails in a regular cmd.exe window:

$ mylink
failed to create symlink: 1314

$ perl -MWin32 -E "say Win32::FormatMessage(1314)"
A required privilege is not held by the client.

but succeeds in an Administrator cmd.exe window:

$ mylink
symlink created

$ dir
2017-02-15  11:53 AM               251 mylink.c
2017-02-15  11:53 AM           113,664 mylink.exe
2017-02-15  11:53 AM             2,557 mylink.obj
2017-02-15  11:54 AM    <SYMLINK>      mylink.t [mylink.c]

This comment has been minimized.


zoffixznet commented Apr 14, 2017

Fixed in d4353b6

@zoffixznet zoffixznet closed this Apr 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment