autolaunch: is broken on Windows in version 1.15.0 and newer
To reproduce
Steps to reproduce the behavior:
- Build dbus (1.15.8 or master) on Windows
- Ensure no dbus-daemon is running
- Ensure DBUS_SESSION_BUS_ADDRESS is not set or is set to autolaunch:
- Run dbus-monitor
Expected result
dbus-monitor launches and autolaunches dbus-daemon. dbus-monitor prints output like this:
signal time=1712430237.764250 sender=org.freedesktop.DBus -> destination=:1.1 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.1"
signal time=1712430237.764250 sender=org.freedesktop.DBus -> destination=:1.1 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.1"
Actual result
dbus-monitor fails with the following output:
Failed to open connection to session bus: dbus-daemon exited before signalling ready
Additional context
The error is caused by commit f20a05f6, introduced in dbus-1.15.0, which adds static const char *autolaunch_custom_command_line_parameter = ""
and then uses a ternary autolaunch_custom_command_line_parameter ? autolaunch_custom_command_line_parameter : "--session"
to provide the default. `autolaunch_custom_command_line_parameter`` is only set by an auto test.