CyberShadow / Digger

A tool to build D and bisect old D versions
Other
57 stars 9 forks source link

why not build by default in ~/.digger/ instead of $PWD/ ? #44

Closed timotheecour closed 7 years ago

timotheecour commented 7 years ago

this is the usual behavior of other tools (eg dub, which builds in ~/.dub/ etc) or any other name... otherwise it's easy to end up with many installations in different directories wherever they were run...

at least an option for that?

CyberShadow commented 7 years ago

Tools which are downloaded and unpacked (as opposed to installed) generally operate in the current directory. This workflow is common for Windows tools.

Note that you can set workDir in the configuration file to any path you want.

timotheecour commented 7 years ago

digger build still builds in $PWD

grep workDir ~/.config/digger.ini
workDir=~/.config/digger/

also tried to put it in dir where digger binary is, but doesn't work.

These should as per instructions in: https://github.com/CyberShadow/Digger/blob/master/digger.ini.sample#L16

# Additionally, for compatibility with previous versions,
# the following locations are searched:
# - ~/.digger/digger.ini

$XDG_CONFIG_HOME/digger (default ~/.config) (i don't have XDG_CONFIG_HOME set so i'd assume it'd use ~/.config)

[i'm on OSX]

CyberShadow commented 7 years ago

If that's true, it indicates a bug...

CyberShadow commented 7 years ago

I can't reproduce this.

I pushed a commit that adds printing the configuration file and work directory paths to the help screen. See what results you get with it.

timotheecour commented 7 years ago

i can't rebuild after the commit you pushed, see https://github.com/CyberShadow/Digger/issues/45

Also, I confirmed on another OS (ubuntu) that the above problem is there:

grep workDir ~/.config/digger.ini
workDir=~/.config/digger/

is ignored.

am i supposed to explicitly pass in the path to ~/.config/digger.ini in digger build?

CyberShadow commented 7 years ago

You mean to say that you initially tested on a different version than latest git? No wonder.

timotheecour commented 7 years ago

uname Darwin

git rev-parse HEAD 64df671aa5ecd2a552d25a2503c1602b97f3504e (should include "I pushed a commit that adds printing the configuration file ")

rdmd --build-only -debug digger

pwd /Users/timothee/temp/d02

/Users/timothee/git_clone/D/Digger/digger Configuration file: (not present) Working directory: /Users/timothee/temp/d02

grep workDir ~/.config/digger.ini workDir=~/.config/digger/

am i missing something?

timotheecour commented 7 years ago

that's what i did, see above (/Users/timothee/git_clone/D/Digger/digger)

/Users/timothee/git_clone/D/Digger/digger Configuration file: (not present) Working directory: /Users/timothee/temp/d02

/Users/timothee/git_clone/D/Digger/digger --config-file=$HOME/.config/digger.ini Configuration file: /Users/timothee/.config/digger.ini Working directory: /Users/timothee/.config/digger

CyberShadow commented 7 years ago

No idea why it's not finding the configuration file for you.

Try adding some debug writeln's here, to make it print the full locations it checks: https://github.com/CyberShadow/Digger/blob/master/config.d#L65

timotheecour commented 7 years ago

there were 2 cases:

CyberShadow commented 7 years ago

Oh, I see. I had missed that as well. Glad to know it's resolved.

timotheecour commented 7 years ago

maybe this would be just a bit clearer in digger.ini.sample:

$XDG_CONFIG_HOME/digger (default ~/.config)
to:
$XDG_CONFIG_HOME/digger (XDG_CONFIG_HOME defaults to ~/.config)
likewise with
$XDG_CONFIG_DIRS/digger (default /etc/xdg)
timotheecour commented 7 years ago

related to case 1: above: https://issues.dlang.org/show_bug.cgi?id=16595

CyberShadow commented 7 years ago

maybe this would be just a bit clearer in digger.ini.sample:

e08d3fc11d26185dbeb59f13aa840b0e1dace3ac