Skip to content

Commit efc5f30

Browse files
committed
Try to shorten config_directory path
Conda has limitations in the length of the placehodler path. This can be easilly used up on OSX, since OSX provides a long tmpdir path. If that is the case, we can try to use mkdtemp with the /tmp directory. May be a workaroudn for #433
1 parent 069e7ba commit efc5f30

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

planemo/galaxy/config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ def config_join(*args):
143143
if not config_directory:
144144
created_config_directory = True
145145
config_directory = mkdtemp()
146+
# the following makes sure the transient config_dir path is short
147+
# enough for conda linking (https://github.com/conda/conda-build/pull/877)
148+
if len(config_directory) > 20:
149+
try:
150+
short_config_directory = mkdtemp(dir="/tmp")
151+
os.rmdir(config_directory)
152+
config_directory = short_config_directory
153+
except OSError:
154+
# path doesn't exist or permission denied, keep the long config_dir
155+
pass
146156
try:
147157
latest_galaxy = False
148158
install_env = {}

0 commit comments

Comments
 (0)