Skip to content

Commit

Permalink
🔥 tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
zeenix committed Apr 22, 2024
1 parent 60862fd commit 344921f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 56 deletions.
40 changes: 1 addition & 39 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ jobs:
RUST_LOG: trace
PKG_CONFIG: C:\bin\pkg-config.exe
PKG_CONFIG_PATH: C:\lib\pkgconfig
DBUS_SESSION_BUS_ADDRESS: tcp:host=127.0.0.1,port=9876
ZBUS_GDBUS_TEST: 1
steps:
- uses: actions/checkout@v4

Expand All @@ -115,25 +113,11 @@ jobs:
c:/lib/*dbus*
c:/bin/*pkg-config*
c:/var/lib/*dbus*
c:/lib/*glib*
c:/lib/*gio*
c:/lib/*gobject*
c:/lib/*gmodule*
c:/lib/*gthread*
c:/lib/*gspawn*
c:/lib/*gresource*
c:/lib/*pcre*
c:/lib/*z*
c:/lib/*ffi*
c:/lib/*intl*
c:/lib/*pkgconfig*
c:/bin/*glib*
c:/bin/*gio*
c:/bin/*gobject*
c:/bin/*gmodule*
c:/bin/*gthread*
c:/bin/*gspawn*
c:/bin/*gresource*
c:/bin/*pcre*
c:/bin/*z*
c:/bin/*ffi*
Expand All @@ -157,17 +141,6 @@ jobs:
if: steps.cache-deps.outputs.cache-hit != 'true'
uses: ilammy/msvc-dev-cmd@v1

- name: Build & Install GLib
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
(New-Object System.Net.WebClient).DownloadString('https://wrapdb.mesonbuild.com/v2/pcre_8.37-2/get_patch') >$null
(New-Object System.Net.WebClient).DownloadString('https://zlib.net/fossils/') >$null
git clone --depth 1 --branch 2.74.1 https://gitlab.gnome.org/GNOME/glib.git \glib
cd -Path \glib
meson setup builddir
meson compile -C builddir
meson install --no-rebuild -C builddir
- name: Build & Install libexpat
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
Expand All @@ -194,22 +167,11 @@ jobs:
- name: Test
run: |
$env:PATH += ";C:\bin"
Start-Process dbus-daemon.exe --config-file=CI/win32-session.conf
Start-Process dbus-daemon.exe '--config-file=CI/win32-session.conf --address=autolaunch:'
cargo --locked test
# tokio feature
cargo --locked test --no-default-features --features tokio
- name: Test gdbus feature
run: |
$env:DBUS_SESSION_BUS_ADDRESS = $null
$env:PATH += ";C:\bin"
# This is an undocumented implementation detail, but easier and faster than calling the gdbus C library
Start-Process gdbus.exe _win32_run_session_bus
# The gdbus process above will exit when idle for more than three seconds, usually right in the middle
# of the doc tests. This process will keep it alive.
Start-Process gdbus.exe 'monitor -e -d org.freedesktop.DBus'
cargo --locked test --features zbus/windows-gdbus
zvariant_fuzz:
runs-on: ubuntu-latest
env:
Expand Down
18 changes: 3 additions & 15 deletions zbus/src/connection/handshake/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,10 @@ impl Handshake for Client {
if can_pass_fd {
commands.push(Command::NegotiateUnixFD);
};
commands.push(Command::Begin);

let expected_n_responses;
// `gdbus` is unable to handle multiple commands in a single message, it seems.
#[cfg(not(all(windows, feature = "windows-gdbus")))]
{
commands.push(Command::Begin);
// Server replies to all commands except `BEGIN`.
expected_n_responses = commands.len() - 1;
}
#[cfg(all(windows, feature = "windows-gdbus"))]
{
expected_n_responses = commands.len();
}
// Server replies to all commands except `BEGIN`.
let expected_n_responses = commands.len() - 1;
self.common.write_commands(&commands).await?;

if expected_n_responses > 0 {
Expand All @@ -215,9 +206,6 @@ impl Handshake for Client {
}
}

#[cfg(all(windows, feature = "windows-gdbus"))]
self.common.write_command(Command::Begin).await?;

trace!("Handshake done");
#[allow(unused_variables)]
let (socket, recv_buffer, cap_unix_fd, _) = self.common.into_components();
Expand Down
4 changes: 2 additions & 2 deletions zbus/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1300,9 +1300,9 @@ mod tests {
use ntest::timeout;
use test_log::test;

#[cfg(all(windows, feature = "windows-gdbus"))]
#[cfg(windows)]
#[test]
fn connect_gdbus_session_bus() {
fn connect_autolaunch_session_bus() {
let addr = crate::win32::autolaunch_bus_address()
.expect("Unable to get GDBus session bus address");

Expand Down

0 comments on commit 344921f

Please sign in to comment.