Search code examples
makefilecygwinbuild-processfile-permissionsarangodb

File permissions changed in build process, compilation aborts because access denied (Windows, Cygwin)


I'm trying to build ArangoDB using the official build scripts and following the official Windows build instructions.

Multiple steps in the build process seem to mess around with file permissions, so that compilations fail, because required files can't be accessed anymore. I can't open them in any program either (access denied, unable to load, ...), even as admin user and with elevated rights.

My workaround so far was to run takeown /F . /R and icacls . /T /C /Q /reset on e.g. V8-4.3.61\build to own the files and reset permissions from an admin shell. But it doesn't work anymore to resolve permission issues during the final make pack-win64.

I wonder why permissions are changed in the first place. The scripts provided by ArangoDB team don't seem to change these settings. So it must be 3rd party build scripts that are invoked in the process (gyp?!), the cygwin environment (bash, make, ...) or the compiler (msbuild?). I don't think it can be related to git or cmake, but those are also involved.

  • Windows 7 64bit
  • Visual Studio 2013 Ultimate
  • Cygwin 2.2.0
  • cmake 3.3.1

Solution

  • Turning ACL off (noacl) for all mounts in cygwin fixes permission issues apparently:

    # /etc/fstab
    #
    #    This file is read once by the first process in a Cygwin process tree.
    #    To pick up changes, restart all Cygwin processes.  For a description
    #    see https://cygwin.com/cygwin-ug-net/using.html#mount-table
    
    # noacl = Ignore Access Control List and let Windows handle permissions
    
    C:/cygwin64/bin  /usr/bin   ntfs      binary,auto,noacl           0  0
    C:/cygwin64/lib  /usr/lib   ntfs      binary,auto,noacl           0  0
    C:/cygwin64      /          ntfs      override,binary,auto,noacl  0  0
    none             /cygdrive  cygdrive  binary,posix=0,user,noacl   0  0