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

Meson sets global config path incorrectly #10882

Closed
hurzl opened this issue Nov 17, 2022 · 12 comments
Closed

Meson sets global config path incorrectly #10882

hurzl opened this issue Nov 17, 2022 · 12 comments
Assignees

Comments

@hurzl
Copy link

hurzl commented Nov 17, 2022

... even with --keep-open=no, both on "Enter" or ">" keys.
Expected: 0.34 closed the program when I pressed "Enter" on single file or on last file on playlist.

FreeBSD 13.1
mpv 0.35.0 Copyright © 2000-2022 mpv/MPlayer/mplayer2 projects
built on Thu Nov 17 04:25:08 2022

@CounterPillow
Copy link
Contributor

Where is your --log-file? Do not ignore the issue template please.

@hurzl
Copy link
Author

hurzl commented Nov 17, 2022

mpvlog.txt

@sfan5
Copy link
Member

sfan5 commented Nov 19, 2022

[ 1.281][d][cplayer] Run command: playlist-next, flags=73, args=[flags="weak"]

       playlist-next <flags>
              Go to the next entry on the playlist.

              First argument:

              weak (default)
                     If the last file on the playlist is currently played, do nothing.

              force  Terminate playback if there are no more files on the playlist.

This is working as intended and the keybindings for this have not changed in years.

@sfan5 sfan5 closed this as completed Nov 19, 2022
@hurzl
Copy link
Author

hurzl commented Nov 19, 2022

So before 0.35 it wasn't?

In /usr/local/etc/mpv/input.conf I have
ENTER playlist_next force
Apparently this was obeyed by 0.34, but not by 0.35 (without --no-config of course)

In the 0.35 log file I see
[ 0.006][d][global] config path: 'input.conf' -/-> 'etc/mpv/input.conf'
where the absolute path is missing
It works when I put that line into ~/.config/mpv/input.conf

@sfan5
Copy link
Member

sfan5 commented Nov 19, 2022

A look into config.h reveals that meson.build sets the config path incorrectly:

~/mpv $ grep CONFDIR build/config.h 
#define MPV_CONFDIR "etc/mpv"

for comparison (waf):

/tmp/mpv $ grep CONFDIR build/config.h
#define MPV_CONFDIR "/usr/local/etc/mpv"

@sfan5 sfan5 reopened this Nov 19, 2022
@sfan5 sfan5 changed the title 0.35 does not quit after end of playlist Meson sets global config path incorrectly Nov 19, 2022
@Dudemanguy
Copy link
Member

Oh so this is actually different defaults that I guess favors Linux distros over BSDs. Meson uses the sysconfdir option which will default to etc + /mpv. If the prefix is set to /usr, then this path becomes /etc/mpv. Apparently on waf, the default is always just the prefix + /etc/mpv.

@sfan5
Copy link
Member

sfan5 commented Nov 19, 2022

My example is with prefix set to /usr/local, the path set by meson is just plain wrong and not even absolute.

@Dudemanguy
Copy link
Member

Apparently it magically works if you just join the paths of prefix and sysconfdir and it doesn't result in /usr/etc for the -Dprefix=/usr case.

@brad0
Copy link

brad0 commented Nov 21, 2022

I happened to notice this commit. For OpenBSD we use prefix=/usr/local and sysconfdir=/etc. For WAF we were using..

CONFIGURE_ARGS =	--confloaddir=${SYSCONFDIR}/mpv \
			--confdir=${LOCALBASE}/share/examples/mpv

which is /etc/mpv and /usr/local/share/examples/mpv.

@Dudemanguy
Copy link
Member

If you were already explicitly setting the path anyway, it will work the same way before and after this commit. This just makes the default not a wrong path in some cases.

@brad0
Copy link

brad0 commented Nov 21, 2022

If you were already explicitly setting the path anyway, it will work the same way before and after this commit. This just makes the default not a wrong path in some cases.

Well we just converted over to using Meson. But with that commit it appears as if the path is now hardcoded so if we use prefix=/usr/local and sysconf=/etc that the conf path is /usr/local/etc/mpv instead of /etc/mpv. I don't mind whichever is the default. Just as long as there is a way of overriding the path.

@Dudemanguy
Copy link
Member

Dudemanguy commented Nov 21, 2022

It's not hardcoded. I don't know about how the ports work but essentially you'll want to pass: meson setup build -Dprefix=/usr/local -Dsysconfdir=/etc As long as you pass an absolute path to sysconfdir, it'll override the prefix part of it.

sfan5 pushed a commit that referenced this issue Jan 24, 2023
Meson uses the sysconfdir option for setting the global config
directory. This conveniently defaults to /etc if the prefix is set to
/usr which is nice for linux distros. BSDs tend to use /usr/local which
causes this value to become 'etc' by default which is not an absolute
path so you would need to set something like -Dsysconfdir=/usr/local/etc
as well in the configuration step. It turns out we can have our cake and
eat it too by just joining the paths of prefix and sysconfdir together.
In the case where -Dprefix=/usr, this still results in /etc/mpv as the
path since the path joining logic just drops the leading '/usr/'. For
the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This
fixes #10882.
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
Meson uses the sysconfdir option for setting the global config
directory. This conveniently defaults to /etc if the prefix is set to
/usr which is nice for linux distros. BSDs tend to use /usr/local which
causes this value to become 'etc' by default which is not an absolute
path so you would need to set something like -Dsysconfdir=/usr/local/etc
as well in the configuration step. It turns out we can have our cake and
eat it too by just joining the paths of prefix and sysconfdir together.
In the case where -Dprefix=/usr, this still results in /etc/mpv as the
path since the path joining logic just drops the leading '/usr/'. For
the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This
fixes mpv-player#10882.
dyphire pushed a commit to dyphire/mpv that referenced this issue Feb 22, 2023
Meson uses the sysconfdir option for setting the global config
directory. This conveniently defaults to /etc if the prefix is set to
/usr which is nice for linux distros. BSDs tend to use /usr/local which
causes this value to become 'etc' by default which is not an absolute
path so you would need to set something like -Dsysconfdir=/usr/local/etc
as well in the configuration step. It turns out we can have our cake and
eat it too by just joining the paths of prefix and sysconfdir together.
In the case where -Dprefix=/usr, this still results in /etc/mpv as the
path since the path joining logic just drops the leading '/usr/'. For
the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This
fixes mpv-player#10882.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants