2025-07-19 20:28 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002860Spring engineGeneralpublic2012-01-30 00:31
ReporterLicho 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target Version86.0Fixed in Version 
Summary0002860: Unitsync ignores SPRING_DATADIR and SPRING_ISOLATED
DescriptionWith those things set to some folder, it still returns default WritableDirectory after init.



TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0007993

Licho (reporter)

Can this be worked around in some way? Basically i need to tell unitsync to scan some given folder - to set extra datadir.

~0007994

abma (administrator)

you could try to set SpringData in springsettings.cfg?
https://github.com/spring/spring/blob/develop/rts/System/FileSystem/DataDirLocater.cpp#L307

i currently don't see why this code fails:

https://github.com/spring/spring/blob/develop/rts/System/FileSystem/DataDirLocater.cpp#L225

~0007996

Licho (reporter)

I also dont understand why it fails. However it does. GetWritable shows default folder instead the one in env.

~0007997

Licho (reporter)

Ignores springsettings.cfg with SpringData too.. even the local one in unitsync folder ..

Perhaps issue isnt in datadirlocater but elsewhere.

~0007998

Licho (reporter)

Also ignores HOME on windows

~0008000

abma (administrator)

Last edited: 2011-12-24 12:19

SET SPRING_ISOLATED=C:\Some\Path seems to work... (at least for spring.exe, i hope unitsync does the same...)

~0008001

Licho (reporter)

No, it does not work for unitsync. Only for spring..

Unitsync has its own mind it seems ..

~0008002

Licho (reporter)

So far it ignores all of this...

Directory.SetCurrentDirectory(paths.UnitSyncDirectory);
Environment.SetEnvironmentVariable("SPRING_DATADIR", paths.WritableDirectory, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("HOME", paths.WritableDirectory, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("SPRING_ISOLATED", paths.WritableDirectory, EnvironmentVariableTarget.Process);
File.WriteAllText(Path.Combine(paths.UnitSyncDirectory, "springsettings.cfg"), "SpringData = " + paths.WritableDirectory);

if (!NativeMethods.Init(false, 666)) throw new UnitSyncException("Unitsync initialization failed.");

Version = NativeMethods.GetSpringVersion();
var writ = NativeMethods.GetWritableDataDirectory();

~0008229

jK (developer)

https://github.com/spring/spring/commit/af9fe7e30d312932fd4928b8443477d364d3ed1a
+Notes

-Issue History
Date Modified Username Field Change
2011-12-23 13:53 Licho New Issue
2011-12-24 11:24 Licho Note Added: 0007993
2011-12-24 11:36 abma Note Added: 0007994
2011-12-24 11:52 Licho Note Added: 0007996
2011-12-24 12:01 Licho Note Added: 0007997
2011-12-24 12:01 Licho Note Added: 0007998
2011-12-24 12:12 abma Note Added: 0008000
2011-12-24 12:19 abma Note Edited: 0008000
2011-12-24 12:34 Licho Note Added: 0008001
2011-12-24 12:52 Licho Note Added: 0008002
2012-01-09 23:09 abma Target Version => 86.0
2012-01-30 00:31 jK Note Added: 0008229
2012-01-30 00:31 jK Status new => resolved
2012-01-30 00:31 jK Resolution open => fixed
2012-01-30 00:31 jK Assigned To => jK
+Issue History