Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posix: use /etc/dub/settings.json if in /usr #2203

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

WebFreak001
Copy link
Member

Fix #1472

/etc/dub/settings.json overrides /usr/etc/dub/settings.json (as
suggested by the man hier manpage)

@WebFreak001
Copy link
Member Author

another idea would be to have /etc/dub.conf which could be considered better than /etc/dub/settings.json because dub only has a single config file (and probably won't get much more that belongs in /etc)

@Geod24
Copy link
Member

Geod24 commented Dec 7, 2021

Yeah I think /etc/dub.json is better

@PetarKirov
Copy link
Member

PetarKirov commented Dec 7, 2021

I think /etc/dub.json is better

I disagree. dub.json sounds just like dub.sdl - package metadata. Here we're talking about (global) configuration of the dub program itself. If people find it strange that dub.conf is a JSON file, then I suggest dub.config.json.

@WebFreak001
Copy link
Member Author

I would suggest dub.conf - maybe it should be a SDL file too though

@WebFreak001
Copy link
Member Author

WebFreak001 commented Feb 16, 2022

I asked on the discord and got these preferences by users: (mostly weak preferences)

  • /etc/dub/settings.json (Wild, Snarwin, MoonlightSentinel) - Reasons:
    • consistency with the existing ~/.dub/settings.json
    • If dub ever needs an additional file for something, already having a folder make that easier (x2)
    • Wild: I generally think of /etc/*.* of being more system configs, while /etc/*/*.* is more program configs. But ofc there are always outlieers
  • /etc/dub.conf (WebFreak) - Reasons:
    • consistency with a lot of other linux package config files

adr doesn't really care but after asking about /etc/dub/settings.json thinks it's good enough for him, it would be easy to find as /etc/dub will find it anyway.

So I would be for putting it in /etc/dub/settings.json as final decision to avoid stretching this bikeshed for longer.

The reasons that most influenced me on this decision: (in this order)

  • consistency with existing ~/.dub/settings.json
  • /etc/dub.json would be confusing with dub recipe filename, /etc/dub.conf might not be obviously json and /etc/dub.json.conf is not much nicer
  • a lot of (modern) linux apps use folders as well, it's convenient for the user to store more than one settings file in there which they can swap out as needed

@rikkimax
Copy link
Contributor

I do like dub.conf.json/dub.conf.sdl, but yes let's just go with /etc/dub/settings.json.

This does need documenting though.

Fix dlang#1472

/etc/dub/settings.json overrides /usr/etc/dub/settings.json (as
suggested by the `man hier` manpage)
WebFreak001 added a commit to dlang/dub-docs that referenced this pull request Feb 17, 2022
@WebFreak001
Copy link
Member Author

@rikkimax added changelog entry and made PR to dub-docs (though I doubt that PRs there will be merged any time soon with deployment being broken)

@PetarKirov
Copy link
Member

I'm on board with /etc/dub/settings.json as well.

@WebFreak001
Copy link
Member Author

can someone approve the PR so I can merge it?

@ljmf00
Copy link
Member

ljmf00 commented Mar 29, 2022

Moving towards the XDG standard is preferable tho. ~/.dub/settings.json is not XDG compliant. See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html .

@WebFreak001
Copy link
Member Author

WebFreak001 commented Mar 30, 2022

~/.dub/settings.json has already been used and is not touched by this PR, I would suggest talking about that in a separate issue or e.g. plan that for a second version of dub.

I think how I PRd it here is best for how the current structure is.

So if anyone could approve the PR that would be nice.

@ljmf00
Copy link
Member

ljmf00 commented Mar 30, 2022

~/.dub/settings.json has already been used and is not touched by this PR, I would suggest talking about that in a separate issue or e.g. plan that for a second version of dub.

I think how I PRd it here is best for how the current structure is.

So if anyone could approve the PR that would be nice.

Right, my bad.

Copy link
Member

@ljmf00 ljmf00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the change, but I'm not part of dub development and I may miss something, although LGTM.

@WebFreak001
Copy link
Member Author

ok seems like I would need someone of the dub team to approve to be able to merge

@dlang-bot dlang-bot merged commit 059f7a2 into dlang:master Mar 31, 2022
WebFreak001 added a commit to dlang/dub-docs that referenced this pull request Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not read settings from /etc/dub/settings.json
7 participants