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

graal/vm suite uses the fcntl module, which is not supported on Windows. #795

Closed
JornVernee opened this issue Nov 9, 2018 · 4 comments
Closed
Assignees

Comments

@JornVernee
Copy link
Member

The vm suite is importing the fcntl module, but on Windows this causes an error:

PS J:\Projects\graal\vm> mx build
Traceback (most recent call last):
  File "J:\Projects\mx\mx.py", line 18829, in <module>
    main()
  File "J:\Projects\mx\mx.py", line 18717, in main
    primary = _discover_suites(primarySuiteMxDir, load=should_load_suites)
  File "J:\Projects\mx\mx.py", line 18583, in _discover_suites
    _register_visit(primary)
  File "J:\Projects\mx\mx.py", line 18581, in _register_visit
    s._load()
  File "J:\Projects\mx\mx.py", line 8205, in _load
    self._load_extensions()
  File "J:\Projects\mx\mx.py", line 8630, in _load_extensions
    mod = __import__(extensionsName)
  File "J:\Projects\graal\vm\mx.vm\mx_vm.py", line 29, in <module>
    import fcntl
ImportError: No module named fcntl

It looks like fcntl is a unix only module [1].

There is currently only place where this module is used, by a function called lock_directory [2]. I worked around this problem by moving the import into that function. (but mx build is still failing with other errors)

[1] : https://stackoverflow.com/q/1422368
[2] : https://github.com/oracle/graal/blob/master/vm/mx.vm/mx_vm.py#L930

@dougxc
Copy link
Member

dougxc commented Nov 9, 2018

@ansalond fcntl is used by lock_directory which itself appears to be unused. Can we remove it?

@ansalond
Copy link
Member

ansalond commented Nov 9, 2018

@JornVernee, thanks for the report!
@dougxc, yes, it can be removed

I have some pending fixes to have the vm suite support Windows, but we are not there yet.
The biggest problem is that the vm suite statically imports truffle, which includes Truffle NFI, which ATM cannot be easily compiled on Windows.

As a temporary workaround, if you want to produce an artifact similar to the "Windows GraalVM Preview" available from the GraalVM OTN page, you could run mx makegraaljdk from the compiler suite.

@JornVernee
Copy link
Member Author

@ansalond Thanks, I will try out mx makegraaljdk as well.

After working around this (and some other problem with os.symlink) It looks like I can build the vm suite without problems. It looks like the TRUFFLE_NFI_NATIVE dependency can use my MSYS toolchain to do the compilation :-)

@olpaw
Copy link
Member

olpaw commented Mar 15, 2019

Fixed since d9fb898

@olpaw olpaw closed this as completed Mar 15, 2019
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

4 participants