Possible SetEnv Mac OS X Yosemite issue

Monkey Forums/Monkey Bug Reports/Possible SetEnv Mac OS X Yosemite issue

dawlane(Posted 2014) [#1]
Hi Mark
I think that I have stumbled across what may be the possible cause of the 'ant not found' problem while I was looking at a TeX related GUI issue and I suspect that it is this, that is causing the problems with Monkey and Yosemite.

I did a little test with one simple C++ Tool program to set the PATH variable to include the HOME directory, and another C++Tool program that executes that program then display the contents with the result being that only the default system path is being retrieved.

Note I haven fully explored this yet.

Currently using 80c


marksibly(Posted 2014) [#2]
Interesting theory, but this works here:

Import os

Function Main()
	SetEnv "PATH","/Users/marksibly:"+GetEnv( "PATH" )
	Print GetEnv( "PATH" )
	Execute "a.out"
	Execute "ha"
End


'a.out' is a binary, and 'ha' is a shell script with +x. Both are successfully executed.


marksibly(Posted 2014) [#3]
Actually, it works with 'ant' too!

Import os

Function Main()
'	SetEnv "PATH","/Users/marksibly/apache-ant-1.9.2/bin:"+GetEnv( "PATH" ) 'either works...
	SetEnv "PATH",GetEnv( "PATH" )+":/Users/marksibly/apache-ant-1.9.2/bin" 'either works...
	Print GetEnv( "PATH" )
	Execute "ant"
End


This should be pretty much what transcc is doing...not sure what's gone wrong.


dawlane(Posted 2014) [#4]
Trans, when executed from a terminal works as expected. I did a bit of hacking of trans to see exactly what the PATH variable was when ant was executed using Execute "echo $PATH && ant". The echo command returned the correct path, but when you open the IDE app bundle via finder it just returns the default systems paths. If you open the contents of the bundle and execute the IDE executable directly then the path is is correct.

Edit: I starting to wonder if the real problem lies with the Mac Open command or the routines that handle app bundles. I'm not a Mac guru so I don't know if finder uses the open function. I've seen some threads about launchd problems, but that as far as I am aware it is used for launching daemons and was removed from Yosemite for security reasons.