MantisBT - Doomseeker
View Issue Details
0003243Doomseeker[All Projects] Bugpublic2017-09-01 16:172018-10-27 22:55
WubTheCaptain 
Zalewa 
normalminoralways
closedfixed 
x86_64Debian GNU/Linuxbuster/sid
1.1 
1.21.2 
0003243: Dubious default configuration path for Zandronum testing releases
The default configuration sets TestingPath for Zandronum to $HOME/Documents/doomseeker/plugins/zandronum. Typically the downloaded testing releases include an executable binary and shared data (Skulltag PK3 files), which is a bit dubious to fit in the $XDG_DOCUMENTS_DIR directory.

I expected $XDG_DOCUMENTS_DIR to be reserved for paper documents, literature at best.

  1. Ensure no existing user-specific configuration is present (e.g. remove $HOME/.doomseeker).

  2. Run Doomseeker with its libzandronum installed. A message should popup about first-time configuration check.

  3. Check the "Directory for testing releases" under Engines → Zandronum in configuration.

'https://www.freedesktop.org/wiki/Software/xdg-user-dirs/ [^]'

I couldn't find an official specification related to XDG user directories. Needs support from issue 0003233 (XDG Base Directory Specification).
No tags attached.
child of 0003279acknowledged  List of Debian issues (misc/non-policy) 
Issue History
2017-09-01 16:17WubTheCaptainNew Issue
2017-09-01 16:31ZalewaRelationship addedchild of 0003246
2017-09-09 19:00ZalewaNote Added: 0018251
2017-09-10 13:16WubTheCaptainNote Added: 0018256
2017-09-10 13:22WubTheCaptainNote Added: 0018257
2017-09-10 13:35WubTheCaptainNote Added: 0018259
2017-09-27 22:07WubTheCaptainRelationship addedchild of 0003279
2017-09-27 22:07WubTheCaptainRelationship deletedchild of 0003246
2017-10-06 23:23WubTheCaptainAssigned To => WubTheCaptain
2017-10-06 23:23WubTheCaptainStatusnew => acknowledged
2017-10-06 23:23WubTheCaptainAssigned ToWubTheCaptain =>
2017-12-11 15:56ZalewaNote Added: 0018951
2017-12-11 15:56ZalewaAssigned To => Zalewa
2017-12-11 15:56ZalewaStatusacknowledged => feedback
2017-12-12 11:42WubTheCaptainNote Added: 0018955
2017-12-12 11:42WubTheCaptainStatusfeedback => assigned
2017-12-12 11:50WubTheCaptainStatusassigned => needs review
2017-12-12 12:03WubTheCaptainNote Added: 0018956
2017-12-12 16:06ZalewaNote Added: 0018958
2017-12-12 16:06ZalewaStatusneeds review => assigned
2017-12-13 00:37WubTheCaptainNote Added: 0018960
2017-12-15 15:32ZalewaNote Added: 0018965
2017-12-15 15:32ZalewaStatusassigned => needs testing
2017-12-15 15:33ZalewaNote Edited: 0018965bug_revision_view_page.php?bugnote_id=18965#r11356
2018-08-27 03:27WubTheCaptainNote Added: 0019425
2018-08-27 03:27WubTheCaptainStatusneeds testing => feedback
2018-08-27 03:30WubTheCaptainNote Added: 0019426
2018-08-27 03:30WubTheCaptainStatusfeedback => assigned
2018-08-27 03:30WubTheCaptainStatusassigned => feedback
2018-08-27 03:32WubTheCaptainNote Added: 0019427
2018-08-27 03:32WubTheCaptainStatusfeedback => assigned
2018-08-27 03:32WubTheCaptainStatusassigned => feedback
2018-08-27 03:37WubTheCaptainTarget Version => 1.2
2018-08-27 07:26ZalewaNote Added: 0019432
2018-08-28 03:36WubTheCaptainNote Added: 0019443
2018-08-28 03:36WubTheCaptainStatusfeedback => assigned
2018-08-28 03:36WubTheCaptainStatusassigned => resolved
2018-08-28 03:36WubTheCaptainFixed in Version => 1.2
2018-08-28 03:36WubTheCaptainResolutionopen => fixed
2018-10-27 22:55WubTheCaptainStatusresolved => closed

Notes
(0018251)
Zalewa   
2017-09-09 19:00   
Will QStandardPaths::DataLocation be a good place to store the builds, then?
(0018256)
WubTheCaptain   
2017-09-10 13:16   
The documentation link you posted says QStandardPaths::DataLocation is deprecated and returns QStandardPaths::AppLocalDataLocation.

I know the torbrowser-launcher package in Debian GNU/Linux uses it ($HOME/.local/share/torbrowser) also for binaries, but that package is "not part of Debian" because of contrib section. It's acceptable, but not maybe the best choice. .local/share is meant to be for architecture independent files, after all.

Seeing how QStandardPaths::ApplicationsLocation is not always writable and it's used differently on Windows, it's also probably not a good choice.

I think QStandardPaths::AppLocalDataLocation ($HOME/.local/share/doomseeker) is still a more sensible choice, but that's arguable. Someone else may have a better idea.
(0018257)
WubTheCaptain   
2017-09-10 13:22   
QStandardPaths::DownloadLocation or its subfolder may also be a sensible choice, excluding the generated shell script which should go to $HOME/.local/bin in my opinion. (Note, $HOME/.local/bin is not part of default $PATH.)
(0018259)
WubTheCaptain   
2017-09-10 13:35   
Eh, excluding the Qt options: I've personally kept my testing path to "$HOME/.local/games/zandronum-testing/", despite some shortcomings.
(0018951)
Zalewa   
2017-12-11 15:56   
Since this commit we now abstract the OS "local user data" location with Doomseeker's DataPaths::dataDirectory.

We can use dataDirectory to store plugin managed data by following a path pattern like this:


$dataDirectory/plugins/$plugin/<plugin-does-whatever-it-wants-here>


so, for testing releases it can be:


  $dataDirectory/plugins/zandronum/testing/3.0-alpha-r160814-2010
  $dataDirectory/plugins/zandronum/testing/3.0-alpha-r160814-2010.(sh|bat)


Example paths we would get:


Linux:
  /home/test/.local/share/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010
  /home/test/.local/share/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010.sh

Mac (I'm guessing this one):
  /Users/CaptainKirk/Library/Application Support/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010
  /Users/CaptainKirk/Library/Application Support/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010.sh

Windoze:
  C:/Users/Robert/AppData/Local/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010
  C:/Users/Robert/AppData/Local/doomseeker/plugins/zandronum/testing/3.0-alpha-r160814-2010.bat


Does this look right?
(0018955)
WubTheCaptain   
2017-12-12 11:42   
That should be fine (for GNU/Linux at least).
(0018956)
WubTheCaptain   
2017-12-12 12:03   
One caveat: Zandronum testing releases really shouldn't dump its arch-dependent binary and libs (x86 or x86_64) under one arch-independent .local/share directory, but that's out of scope for this ticket. This is partly an upstream issue of packaging too.

e.g. Python 2.7 uses $HOME/.local/lib/python2.7 (but has byte-compiled libs). nvim uses $HOME/.local/share/site/plugin (arch-independent scripts).
(0018958)
Zalewa   
2017-12-12 16:06   
I'll go with ~/.local/share, because it's better than Documents and QStandardPaths doesn't offer anything even better. No more #ifdefs, not for something that the user can change from the config box
(0018960)
WubTheCaptain   
2017-12-13 00:37   
Zalewa: Yes, $HOME/.local/share is fine for now I think. The caveat I mentioned isn't "fixable" with the config option, and it's out of scope for this ticket.

For me, this ticket is resolved... for now, at least.
(0018965)
Zalewa   
2017-12-15 15:32   
(edited on: 2017-12-15 15:33)
Done:'https://bitbucket.org/Doomseeker/doomseeker/commits/8998d075e79f6d9edccab40373977a7ebed73927 [^]'

Note that this changes the behavior for --portable mode and testing binaries will now be installed to <progdir>/.static/plugins/zandronum.

(0019425)
WubTheCaptain   
2018-08-27 03:27   
It struck me that there might actually be a better place for this: /opt/ on GNU/Linux globally (or $HOME/.local/opt/ for the local user as a non-standard location). /opt/ doesn't exist on OpenBSD, though.

It's still less ideal than seperating everything under .local/bin, .local/lib etc seperately, but it's not our issue to handle upstream issues. 😕
(0019426)
WubTheCaptain   
2018-08-27 03:30   
But without /opt/, $HOME/.local/lib/ is more standard or a better location – even though still not ideal. (/usr/local/opt/ isn't a thing, so it's not sensible to have $HOME/.local/opt/ either.)
(0019427)
WubTheCaptain   
2018-08-27 03:32   
Oh, but QStandardPaths also doesn't give us an option to use $HOME/.local/lib unfortunately.
(0019432)
Zalewa   
2018-08-27 07:26   
I haven't actually seen a distro where /opt/ would exist by default, let alone have write permissions for the current user.

~/.local/share is the best compromise given how QStandardPaths works. I'm inclined not to change it anymore.
(0019443)
WubTheCaptain   
2018-08-28 03:36   
Guess that's how it needs to be, then.