Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Things we want from Linux/FreeBSD release archives
Re: Things we want from Linux/FreeBSD release archives [message #53466 is a reply to message #53465] Sat, 04 April 2020 18:46 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
log-files are still stored in ~/.upp Smile
Unsure that they should go into .config, but definitely not into ~/.upp ...


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53468 is a reply to message #53462] Sat, 04 April 2020 21:06 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
mirek wrote on Sat, 04 April 2020 15:08

Done: SetAppGroup, default is "u++". So unless you use SetAppGroup, all is now stored into .config/u++/GetAppName()


Does it affect only MacOS or Linux apps as well?
And if both, is there a way to get back to old path (~/.upp/AppName)?
Re: Things we want from Linux/FreeBSD release archives [message #53471 is a reply to message #53468] Sun, 05 April 2020 00:49 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
This does affect Mac and Linux apps.
You can call SetConfigDirectory("~/.upp/AppName"). Probably, you also need to expand/normalize "~/.upp/AppName" first.


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53474 is a reply to message #53471] Sun, 05 April 2020 11:12 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
Novo wrote on Sun, 05 April 2020 00:49
This does affect Mac and Linux apps.


What is technical reason of this change?
To be honest I pissed off by changes like this. I have many embedded apps that keep their settings in .upp directory and the last thing I need is to loose their settings, because default ConfigFile() has changed.

Re: Things we want from Linux/FreeBSD release archives [message #53475 is a reply to message #53462] Sun, 05 April 2020 11:46 Go to previous messageGo to next message
amrein is currently offline  amrein
Messages: 278
Registered: August 2008
Location: France
Experienced Member
Hi

I don't understand why we use ~/.config and ~/.cache and not directories in the current source directory when U++ is inside user home directory.
I mean, the main idea of sandboxing is to keep everything in the same directory, right? Sad

Note: using ~/.config and ~/.cache is incompatible with deb or rpmbuild packaging if we use umk to build other packages. Confused
Re: Things we want from Linux/FreeBSD release archives [message #53476 is a reply to message #53474] Sun, 05 April 2020 13:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Zbych wrote on Sun, 05 April 2020 11:12
Novo wrote on Sun, 05 April 2020 00:49
This does affect Mac and Linux apps.


What is technical reason of this change?
To be honest I pissed off by changes like this. I have many embedded apps that keep their settings in .upp directory and the last thing I need is to loose their settings, because default ConfigFile() has changed.



It was suggested right in this thread by Posix gurus. I am just trying to deliver...
Re: Things we want from Linux/FreeBSD release archives [message #53477 is a reply to message #53475] Sun, 05 April 2020 13:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amrein wrote on Sun, 05 April 2020 11:46
Hi

I don't understand why we use ~/.config and ~/.cache and not directories in the current source directory when U++ is inside user home directory.
I mean, the main idea of sandboxing is to keep everything in the same directory, right? Sad



You have missed the description of the process. It is quite more complicated then just using ~/.config / ~.cache.

String  ConfigFile(const char *file) {
	if(sConfigFolder.GetCount())
		return AppendFileName(sConfigFolder, file);
#if defined(PLATFORM_WIN32)
	if(sHomecfg) {
		String p = GetHomeDirFile(GetAppName());
		ONCELOCK
			RealizeDirectory(p);
		return AppendFileName(p, file);
	}
	return GetExeDirFile(file);
#elif defined(PLATFORM_POSIX)
	static String cfgdir;
	ONCELOCK {
		String h = GetExeFolder();
		if(!sHomecfg)
			while(h.GetCount() > 1 && DirectoryExists(h)) {
				String pp = AppendFileName(h, ".config");
				FindFile ff(pp);
				if(ff && ff.IsFolder() && ff.CanWrite()) {
					cfgdir = pp;
					break;
				}
				h = GetFileFolder(h);
			}
		if(IsNull(cfgdir))
			cfgdir = GetEnv("XDG_CONFIG_HOME");
		if(IsNull(cfgdir) || !DirectoryExists(cfgdir))
			cfgdir = GetHomeDirFile(".config");
		if(sConfigGroup.GetCount())
			cfgdir = AppendFileName(cfgdir, sConfigGroup);
	}
	String pp = AppendFileName(cfgdir, GetAppName());
	RealizeDirectory(pp);
	return AppendFileName(pp, file);
#else
	NEVER();
	return GetExeDirFile(file);
#endif//PLATFORM
}
Re: Things we want from Linux/FreeBSD release archives [message #53478 is a reply to message #53474] Sun, 05 April 2020 13:10 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Zbych wrote on Sun, 05 April 2020 11:12
Novo wrote on Sun, 05 April 2020 00:49
This does affect Mac and Linux apps.


What is technical reason of this change?
To be honest I pissed off by changes like this. I have many embedded apps that keep their settings in .upp directory and the last thing I need is to loose their settings, because default ConfigFile() has changed.



Thinking about it... I can actually change ConfigFile further so that it will use ~/.upp config if it finds it instead of ~/.config.

Do we want that?

Mirek
Re: Things we want from Linux/FreeBSD release archives [message #53481 is a reply to message #53478] Sun, 05 April 2020 13:22 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Sun, 05 April 2020 13:10
Zbych wrote on Sun, 05 April 2020 11:12
Novo wrote on Sun, 05 April 2020 00:49
This does affect Mac and Linux apps.


What is technical reason of this change?
To be honest I pissed off by changes like this. I have many embedded apps that keep their settings in .upp directory and the last thing I need is to loose their settings, because default ConfigFile() has changed.



Thinking about it... I can actually change ConfigFile further so that it will use ~/.upp config if it finds it instead of ~/.config.

Do we want that?

Mirek

Well, it would solve the backwards compatibility issue, quite smoothly. Only new apps or new installations of existing apps would start to use the old directory. Possible alternative would be to make the code migrate the files from ~/.upp to ~/.config, but that seems quite invasive and could result in some broken apps, e.g. when both new and older version would be run on same machine.

Honza
Re: Things we want from Linux/FreeBSD release archives [message #53488 is a reply to message #53481] Mon, 06 April 2020 06:33 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Ide is still opening log-file from ~/.upp Sad
Although it is stored in .config/u++ now ...


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53492 is a reply to message #53488] Mon, 06 April 2020 10:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 06 April 2020 06:33
Ide is still opening log-file from ~/.upp Sad
Although it is stored in .config/u++ now ...


Have you recompiled it?

Mirek
Re: Things we want from Linux/FreeBSD release archives [message #53501 is a reply to message #53492] Mon, 06 April 2020 15:31 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Mon, 06 April 2020 04:12
Novo wrote on Mon, 06 April 2020 06:33
Ide is still opening log-file from ~/.upp Sad
Although it is stored in .config/u++ now ...


Have you recompiled it?

Mirek

Double-checked. Full rebuild. Alt-l opens a log-file located in ~/.upp
GIT rev. 74249e7
It is easy to check. Timestamp is "04.04.2020 15:30:37"


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53506 is a reply to message #53501] Tue, 07 April 2020 05:34 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Another problem with Mac.
It looks like GetExeFolder() doesn't resolve links on Mac.
The way I check that: I created a link to umk in ~/.local/bin
~/.local/bin/umk -> ~/dvlp/cpp/upp/out/uppsrc/CLANG.Blitz.Shared/umk
Config dir is located in ~/dvlp/cpp/upp/
This perfectly works on Linux but Mac.
On Mac I need to create a link to config dir in ~/.local/
I guess the problem is with GetExeFolder() -> GetExeFilePath() ...
Not sure who is supposed to resolve links, OS or Upp ...
Debugger doesn't work on Mac, so, it is a little bit difficult to track an origin of the problem.


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53510 is a reply to message #53501] Tue, 07 April 2020 14:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 06 April 2020 15:31
mirek wrote on Mon, 06 April 2020 04:12
Novo wrote on Mon, 06 April 2020 06:33
Ide is still opening log-file from ~/.upp Sad
Although it is stored in .config/u++ now ...


Have you recompiled it?

Mirek

Double-checked. Full rebuild. Alt-l opens a log-file located in ~/.upp
GIT rev. 74249e7
It is easy to check. Timestamp is "04.04.2020 15:30:37"


Bug in theide, should be now fixed.
Re: Things we want from Linux/FreeBSD release archives [message #53512 is a reply to message #53510] Tue, 07 April 2020 15:48 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Tue, 07 April 2020 08:36
Bug in theide, should be now fixed.

Thanks. It is fixed now.


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53513 is a reply to message #53474] Tue, 07 April 2020 16:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Zbych wrote on Sun, 05 April 2020 11:12
Novo wrote on Sun, 05 April 2020 00:49
This does affect Mac and Linux apps.


What is technical reason of this change?
To be honest I pissed off by changes like this. I have many embedded apps that keep their settings in .upp directory and the last thing I need is to loose their settings, because default ConfigFile() has changed.



OK sorry again. To make the deal sweeter, I have now adopted dolik's suggestion and settings get "migrated" (really copied) from .upp to .config/u++ as long as configuration in .upp exists and in .config does not.

Mirek
Re: Things we want from Linux/FreeBSD release archives [message #53544 is a reply to message #53506] Fri, 10 April 2020 17:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 07 April 2020 05:34
Another problem with Mac.
It looks like GetExeFolder() doesn't resolve links on Mac.
The way I check that: I created a link to umk in ~/.local/bin
~/.local/bin/umk -> ~/dvlp/cpp/upp/out/uppsrc/CLANG.Blitz.Shared/umk
Config dir is located in ~/dvlp/cpp/upp/
This perfectly works on Linux but Mac.
On Mac I need to create a link to config dir in ~/.local/
I guess the problem is with GetExeFolder() -> GetExeFilePath() ...
Not sure who is supposed to resolve links, OS or Upp ...
Debugger doesn't work on Mac, so, it is a little bit difficult to track an origin of the problem.


Hopefully fixed in the trunk. Looks like BSD magic did not really work in MacOS... Smile
Re: Things we want from Linux/FreeBSD release archives [message #53545 is a reply to message #53544] Fri, 10 April 2020 18:02 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 10 April 2020 11:34

Hopefully fixed in the trunk. Looks like BSD magic did not really work in MacOS... Smile

Thanks a lot! It works now.


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53546 is a reply to message #53545] Fri, 10 April 2020 18:06 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
#include <mach-o/dyld.h>

This won't compile outside of Mac ... Smile


Regards,
Novo
Re: Things we want from Linux/FreeBSD release archives [message #53547 is a reply to message #53546] Fri, 10 April 2020 18:37 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ops, thanks, hopefully fixed (but please retest that GetExeFilePath fix still works...)
Previous Topic: U++ does not appear to like playing nice with the Boost algorithm string library?
Next Topic: [POLL] Should we upgrade umk command line behavior ?
Goto Forum:
  


Current Time: Thu Mar 28 13:00:24 CET 2024

Total time taken to generate the page: 0.01334 seconds