Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Make arcyon Windows compatible #15

Open
jgr3go opened this issue May 26, 2015 · 2 comments
Open

Make arcyon Windows compatible #15

jgr3go opened this issue May 26, 2015 · 2 comments

Comments

@jgr3go
Copy link

jgr3go commented May 26, 2015

When trying to run arcyon on a Windows environment, you get the error:

$ arcyon
Traceback (most recent call last):
  File "c:/Program Files/arcanist/phabricator-tools/bin/arcyon", line 31, in <module>
    import aoncmd_arcyon  # noqa
  File "c:\Program Files\arcanist\phabricator-tools\py\aon\aoncmd_arcyon.py", line 33, in <module>
    import aoncmd_gitdiffhelper
  File "c:\Program Files\arcanist\phabricator-tools\py\aon\aoncmd_gitdiffhelper.py", line 31, in <module>
    import abdt_branch
  File "c:\Program Files\arcanist\phabricator-tools\py\abd\abdt_branch.py", line 61, in <module>
    import abdt_differ
  File "c:\Program Files\arcanist\phabricator-tools\py\abd\abdt_differ.py", line 32, in <module>
    import phlgit_diff
  File "c:\Program Files\arcanist\phabricator-tools\py\phl\phlgit_diff.py", line 26, in <module>
    import phlsys_fs
  File "c:\Program Files\arcanist\phabricator-tools\py\phl\phlsys_fs.py", line 33, in <module>
    import fcntl
ImportError: No module named fcntl

It seems that fcntl is used to get file lock permissions, but no fcntl module exists for Windows. It's worth noting that arcanist uses the EDITOR config variable to get blocking sessions (PhutilInteractiveEditor.php) so it is possible, just not with the fcntl module.

Worth noting, I have no idea if this is the only code that's not Windows compatible, so this request may be more than just what I've listed here.

@jgr3go jgr3go closed this as completed May 26, 2015
@jgr3go jgr3go reopened this May 26, 2015
@flippingtables
Copy link

I found a fix for this. Create a file called 'fcntl.py' and put it in the py/phl/ directory.
Paste this code in the file:

def fcntl(fd, op, arg=0):
    return 0

def ioctl(fd, op, arg=0, mutable_flag=True):
    if mutable_flag:
        return 0
    else:
        return ""

def flock(fd, op):
    return

def lockf(fd, operation, length=0, start=0, whence=0):
    return

@aevri
Copy link
Member

aevri commented Nov 20, 2015

Maybe we should split out the platform-dependent bits of phlsys_fs into their own module, perhaps called phlsys_fsunix or similar. That way we would still get errors if we try to use unimplemented functionality, arcyon probably doesn't need to use phlsys_fsunix and would then work on Windows.

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

No branches or pull requests

3 participants