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

mx.py uses os.symlink, which is not supported on Windows #170

Open
JornVernee opened this issue Nov 9, 2018 · 0 comments
Open

mx.py uses os.symlink, which is not supported on Windows #170

JornVernee opened this issue Nov 9, 2018 · 0 comments
Assignees

Comments

@JornVernee
Copy link
Contributor

For instance, when running mx build in the graal/vm suite (and after working around oracle/graal#795) I get the error:

Traceback (most recent call last):
  File "J:\Projects\mx\mx.py", line 18829, in <module>
    main()
  File "J:\Projects\mx\mx.py", line 18810, in main
    retcode = c(command_args)
  File "J:\Projects\mx\mx_commands.py", line 132, in __call__
    return self.command_function(*args, **kwargs)
  File "J:\Projects\mx\mx.py", line 12626, in build
    t.execute()
  File "J:\Projects\mx\mx.py", line 905, in execute
    self.build()
  File "J:\Projects\graal\vm\mx.vm\mx_vm.py", line 437, in build
    super(GraalVmLayoutDistributionTask, self).build()
  File "J:\Projects\mx\mx.py", line 1897, in build
    self.subject.make_archive()
  File "J:\Projects\mx\mx.py", line 2561, in make_archive
    self._install_source(source, output, destination, arc)
  File "J:\Projects\mx\mx.py", line 2514, in _install_source
    add_symlink(destination, link_target, absolute_destination, clean_destination)
  File "J:\Projects\mx\mx.py", line 2317, in add_symlink
    os.symlink(src, abs_dest)
AttributeError: 'module' object has no attribute 'symlink'
java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:210)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:161)
        at java.io.BufferedReader.readLine(BufferedReader.java:324)
        at java.io.BufferedReader.readLine(BufferedReader.java:389)
        at com.oracle.mxtool.compilerserver.CompilerDaemon$Connection.run(CompilerDaemon.java:137)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Which is originating from mx.py.

The problem seems to be that os.symlink is not supported on Windows, at least not before python 3.2 it seems.

Stack Overflow offers some workarounds [1], which I've tested and they seem to work, but later cause problems when trying to use os.unlink on the created links.

[1] : https://stackoverflow.com/a/15043806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants