Bug #1987

Python unit tests fail if creation of symbolic link fails due to read-only filesystem

Added by Knödlseder Jürgen about 7 years ago. Updated about 7 years ago.

Status:ClosedStart date:04/05/2017
Priority:UrgentDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.3.0
Duration:

Description

It can happen on some specific virtual machine setup that creation of a symbolic link fails due to read-only filesystem, while the creation of files actually works.

This poses a problem in pyext/setup.py which creates a symbolic link for the Python unit tests:

# Post-processing. A symbolic link is created to the directory containing the
# shared wrapper libraries so that we can add this directory to the PYTHONPATH
# for testing.
if is_build:
    try:
        os.chdir('build')
        os.remove('gammalib')
        print('Removed symbolic link build/gammalib.')
    except:
        pass
    try:
        path = glob.glob('lib.*/gammalib')
        os.symlink(path[0], 'gammalib')
        print('Created symbolic link build/gammalib.')
    except:
        print('WARNING: Failed to create symbolic link build/gammalib.')
If the creation of the symbolic link fails the folder containing the _*.so files will not be added to the PYTHONPATH.

Here the reason why the problem may occur:

It should be investigated whether there is a workaround the creation of the symbolic link. One option would be to simply copy the files over.

The same problem occurs when the symbolic links for the cscripts are created. So one should probably copy the scripts instead of creating symbolic links.


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

The symbolic links have been replaced by copies. Merged into devel.

Also available in: Atom PDF