diff -Nru rust-jobserver-0.1.21/Cargo.toml rust-jobserver-0.1.24/Cargo.toml --- rust-jobserver-0.1.21/Cargo.toml 2020-01-30 07:46:09.000000000 +0000 +++ rust-jobserver-0.1.24/Cargo.toml 1970-01-01 00:00:01.000000000 +0000 @@ -13,7 +13,7 @@ [package] edition = "2018" name = "jobserver" -version = "0.1.21" +version = "0.1.24" authors = ["Alex Crichton "] description = "An implementation of the GNU make jobserver for Rust\n" homepage = "https://github.com/alexcrichton/jobserver-rs" diff -Nru rust-jobserver-0.1.21/Cargo.toml.orig rust-jobserver-0.1.24/Cargo.toml.orig --- rust-jobserver-0.1.21/Cargo.toml.orig 2020-01-30 07:45:55.000000000 +0000 +++ rust-jobserver-0.1.24/Cargo.toml.orig 1973-11-29 21:33:09.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "jobserver" -version = "0.1.21" +version = "0.1.24" authors = ["Alex Crichton "] license = "MIT/Apache-2.0" repository = "https://github.com/alexcrichton/jobserver-rs" diff -Nru rust-jobserver-0.1.21/.cargo_vcs_info.json rust-jobserver-0.1.24/.cargo_vcs_info.json --- rust-jobserver-0.1.21/.cargo_vcs_info.json 2020-01-30 07:46:09.000000000 +0000 +++ rust-jobserver-0.1.24/.cargo_vcs_info.json 1970-01-01 00:00:01.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "e6701fe3b642252be7ca592654b5b45804daa4eb" + "sha1": "476763724c4ca4db0853eb5ddcea282959ba95cd" } } diff -Nru rust-jobserver-0.1.21/debian/cargo-checksum.json rust-jobserver-0.1.24/debian/cargo-checksum.json --- rust-jobserver-0.1.21/debian/cargo-checksum.json 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/cargo-checksum.json 2021-10-23 18:35:22.000000000 +0000 @@ -1 +1 @@ -{"package":"5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2","files":{}} +{"package":"af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa","files":{}} diff -Nru rust-jobserver-0.1.21/debian/changelog rust-jobserver-0.1.24/debian/changelog --- rust-jobserver-0.1.21/debian/changelog 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/changelog 2021-10-23 18:35:22.000000000 +0000 @@ -1,3 +1,9 @@ +rust-jobserver (0.1.24-1) unstable; urgency=medium + + * Package jobserver 0.1.24 from crates.io using debcargo 2.4.4 + + -- Ximin Luo Sat, 23 Oct 2021 19:35:22 +0100 + rust-jobserver (0.1.21-1) unstable; urgency=medium * Package jobserver 0.1.21 from crates.io using debcargo 2.4.3 diff -Nru rust-jobserver-0.1.21/debian/compat rust-jobserver-0.1.24/debian/compat --- rust-jobserver-0.1.21/debian/compat 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/compat 2021-10-23 18:35:22.000000000 +0000 @@ -1 +1 @@ -11 +12 diff -Nru rust-jobserver-0.1.21/debian/control rust-jobserver-0.1.24/debian/control --- rust-jobserver-0.1.21/debian/control 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/control 2021-10-23 18:35:22.000000000 +0000 @@ -1,8 +1,8 @@ Source: rust-jobserver Section: rust Priority: optional -Build-Depends: debhelper (>= 11), - dh-cargo (>= 18), +Build-Depends: debhelper (>= 12), + dh-cargo (>= 24), cargo:native , rustc:native , libstd-rust-dev , @@ -10,10 +10,11 @@ Maintainer: Debian Rust Maintainers Uploaders: Ximin Luo -Standards-Version: 4.4.1 +Standards-Version: 4.5.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/jobserver] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/jobserver Homepage: https://github.com/alexcrichton/jobserver-rs +Rules-Requires-Root: no Package: librust-jobserver-dev Architecture: any @@ -27,8 +28,8 @@ librust-jobserver-0+default-dev (= ${binary:Version}), librust-jobserver-0.1-dev (= ${binary:Version}), librust-jobserver-0.1+default-dev (= ${binary:Version}), - librust-jobserver-0.1.21-dev (= ${binary:Version}), - librust-jobserver-0.1.21+default-dev (= ${binary:Version}) + librust-jobserver-0.1.24-dev (= ${binary:Version}), + librust-jobserver-0.1.24+default-dev (= ${binary:Version}) Description: The GNU make jobserver for Rust - Rust source code This package contains the source for the Rust jobserver crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-jobserver-0.1.21/debian/copyright rust-jobserver-0.1.24/debian/copyright --- rust-jobserver-0.1.21/debian/copyright 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/copyright 2021-10-23 18:35:22.000000000 +0000 @@ -9,8 +9,8 @@ Files: debian/* Copyright: - 2018-2020 Debian Rust Maintainers - 2018-2020 Ximin Luo + 2018-2021 Debian Rust Maintainers + 2018-2021 Ximin Luo License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-jobserver-0.1.21/debian/copyright.debcargo.hint rust-jobserver-0.1.24/debian/copyright.debcargo.hint --- rust-jobserver-0.1.21/debian/copyright.debcargo.hint 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/copyright.debcargo.hint 2021-10-23 18:35:22.000000000 +0000 @@ -21,8 +21,8 @@ Files: debian/* Copyright: - 2018-2020 Debian Rust Maintainers - 2018-2020 Ximin Luo + 2018-2021 Debian Rust Maintainers + 2018-2021 Ximin Luo License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-jobserver-0.1.21/debian/tests/control rust-jobserver-0.1.24/debian/tests/control --- rust-jobserver-0.1.21/debian/tests/control 2020-10-01 22:23:34.000000000 +0000 +++ rust-jobserver-0.1.24/debian/tests/control 2021-10-23 18:35:22.000000000 +0000 @@ -1,9 +1,14 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test jobserver 0.1.21 --all-targets --all-features -Features: test-name=@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test jobserver 0.1.24 --all-targets --all-features +Features: test-name=rust-jobserver:@ Depends: dh-cargo (>= 18), librust-futures-0.1+default-dev, librust-num-cpus-1+default-dev, librust-tempdir-0.3+default-dev, librust-tokio-core-0.1+default-dev, librust-tokio-process-0.2+default-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test jobserver 0.1.21 --all-targets --no-default-features -Features: test-name=librust-jobserver-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test jobserver 0.1.24 --all-targets +Features: test-name=librust-jobserver-dev:default +Depends: dh-cargo (>= 18), librust-futures-0.1+default-dev, librust-num-cpus-1+default-dev, librust-tempdir-0.3+default-dev, librust-tokio-core-0.1+default-dev, librust-tokio-process-0.2+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test jobserver 0.1.24 --all-targets --no-default-features +Features: test-name=librust-jobserver-dev: Depends: dh-cargo (>= 18), librust-futures-0.1+default-dev, librust-num-cpus-1+default-dev, librust-tempdir-0.3+default-dev, librust-tokio-core-0.1+default-dev, librust-tokio-process-0.2+default-dev, @ Restrictions: allow-stderr, skip-not-installable diff -Nru rust-jobserver-0.1.21/.github/dependabot.yml rust-jobserver-0.1.24/.github/dependabot.yml --- rust-jobserver-0.1.21/.github/dependabot.yml 1970-01-01 00:00:00.000000000 +0000 +++ rust-jobserver-0.1.24/.github/dependabot.yml 1973-11-29 21:33:09.000000000 +0000 @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: daily + time: "08:00" + open-pull-requests-limit: 10 diff -Nru rust-jobserver-0.1.21/README.md rust-jobserver-0.1.24/README.md --- rust-jobserver-0.1.21/README.md 2019-09-09 13:41:22.000000000 +0000 +++ rust-jobserver-0.1.24/README.md 1973-11-29 21:33:09.000000000 +0000 @@ -35,5 +35,5 @@ ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be +for inclusion in jobserver-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff -Nru rust-jobserver-0.1.21/src/lib.rs rust-jobserver-0.1.24/src/lib.rs --- rust-jobserver-0.1.21/src/lib.rs 2020-01-30 07:44:35.000000000 +0000 +++ rust-jobserver-0.1.24/src/lib.rs 1973-11-29 21:33:09.000000000 +0000 @@ -226,8 +226,8 @@ /// any number of times. pub unsafe fn from_env() -> Option { let var = match env::var("CARGO_MAKEFLAGS") - .or(env::var("MAKEFLAGS")) - .or(env::var("MFLAGS")) + .or_else(|_| env::var("MAKEFLAGS")) + .or_else(|_| env::var("MFLAGS")) { Ok(s) => s, Err(_) => return None, @@ -268,7 +268,7 @@ let data = self.inner.acquire()?; Ok(Acquired { client: self.inner.clone(), - data: data, + data, disabled: false, }) } @@ -294,7 +294,7 @@ // Older implementations of make use `--jobserver-fds` and newer // implementations use `--jobserver-auth`, pass both to try to catch // both implementations. - let value = format!("--jobserver-fds={0} --jobserver-auth={0}", arg); + let value = format!("-j --jobserver-fds={0} --jobserver-auth={0}", arg); cmd.env("CARGO_MAKEFLAGS", &value); self.inner.configure(cmd); } diff -Nru rust-jobserver-0.1.21/src/unix.rs rust-jobserver-0.1.24/src/unix.rs --- rust-jobserver-0.1.21/src/unix.rs 2020-01-30 07:43:31.000000000 +0000 +++ rust-jobserver-0.1.24/src/unix.rs 1973-11-29 21:33:09.000000000 +0000 @@ -26,7 +26,7 @@ // I don't think the character written here matters, but I could be // wrong! for _ in 0..limit { - (&client.write).write(&[b'|'])?; + (&client.write).write_all(&[b'|'])?; } Ok(client) } @@ -122,10 +122,11 @@ // fds are set to nonblocking and combined with `pselect` // internally. // - // Here we try to be compatible with both strategies. We - // unconditionally expect the file descriptor to be in nonblocking - // mode and if it happens to be in blocking mode then most of this - // won't end up actually being necessary! + // Here we try to be compatible with both strategies. We optimistically + // try to read from the file descriptor which then may block, return + // a token or indicate that polling is needed. + // Blocking reads (if possible) allows the kernel to be more selective + // about which readers to wake up when a token is written to the pipe. // // We use `poll` here to block this thread waiting for read // readiness, and then afterwards we perform the `read` itself. If @@ -139,17 +140,6 @@ fd.fd = self.read.as_raw_fd(); fd.events = libc::POLLIN; loop { - fd.revents = 0; - if libc::poll(&mut fd, 1, -1) == -1 { - let e = io::Error::last_os_error(); - match e.kind() { - io::ErrorKind::Interrupted => return Ok(None), - _ => return Err(e), - } - } - if fd.revents == 0 { - continue; - } let mut buf = [0]; match (&self.read).read(&mut buf) { Ok(1) => return Ok(Some(Acquired { byte: buf[0] })), @@ -160,10 +150,25 @@ )) } Err(e) => match e.kind() { - io::ErrorKind::WouldBlock | io::ErrorKind::Interrupted => return Ok(None), + io::ErrorKind::WouldBlock => { /* fall through to polling */ } + io::ErrorKind::Interrupted => return Ok(None), _ => return Err(e), }, } + + loop { + fd.revents = 0; + if libc::poll(&mut fd, 1, -1) == -1 { + let e = io::Error::last_os_error(); + return match e.kind() { + io::ErrorKind::Interrupted => Ok(None), + _ => Err(e), + }; + } + if fd.revents != 0 { + break; + } + } } } } @@ -184,7 +189,7 @@ } pub fn string_arg(&self) -> String { - format!("{},{} -j", self.read.as_raw_fd(), self.write.as_raw_fd()) + format!("{},{}", self.read.as_raw_fd(), self.write.as_raw_fd()) } pub fn configure(&self, cmd: &mut Command) { @@ -299,9 +304,7 @@ } fn is_valid_fd(fd: c_int) -> bool { - unsafe { - return libc::fcntl(fd, libc::F_GETFD) != -1; - } + unsafe { libc::fcntl(fd, libc::F_GETFD) != -1 } } fn set_cloexec(fd: c_int, set: bool) -> io::Result<()> { diff -Nru rust-jobserver-0.1.21/tests/client-of-myself.rs rust-jobserver-0.1.24/tests/client-of-myself.rs --- rust-jobserver-0.1.21/tests/client-of-myself.rs 2019-09-09 13:43:22.000000000 +0000 +++ rust-jobserver-0.1.24/tests/client-of-myself.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,5 +1,3 @@ -extern crate jobserver; - use std::env; use std::io::prelude::*; use std::io::BufReader; diff -Nru rust-jobserver-0.1.21/tests/client.rs rust-jobserver-0.1.24/tests/client.rs --- rust-jobserver-0.1.21/tests/client.rs 2020-01-30 07:43:31.000000000 +0000 +++ rust-jobserver-0.1.24/tests/client.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,10 +1,3 @@ -extern crate futures; -extern crate jobserver; -extern crate num_cpus; -extern crate tempdir; -extern crate tokio_core; -extern crate tokio_process; - use std::env; use std::fs::File; use std::io::Write; @@ -41,7 +34,7 @@ Test { name: "no j args", make_args: &[], - rule: &|me| format!("{}", me), + rule: &|me| me.to_string(), f: &|| { assert!(unsafe { Client::from_env().is_none() }); }, @@ -124,7 +117,7 @@ let me = t!(env::current_exe()); let me = me.to_str().unwrap(); - let filter = env::args().skip(1).next(); + let filter = env::args().nth(1); let mut core = t!(Core::new()); @@ -146,7 +139,7 @@ (test.rule)(me) ); t!(t!(File::create(td.path().join("Makefile"))).write_all(makefile.as_bytes())); - let prog = env::var("MAKE").unwrap_or("make".to_string()); + let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string()); let mut cmd = Command::new(prog); cmd.args(test.make_args); cmd.current_dir(td.path()); @@ -174,7 +167,7 @@ Ok(()) }))); - if failures.len() == 0 { + if failures.is_empty() { println!("\ntest result: ok\n"); return; } diff -Nru rust-jobserver-0.1.21/tests/helper.rs rust-jobserver-0.1.24/tests/helper.rs --- rust-jobserver-0.1.21/tests/helper.rs 2020-01-30 07:43:31.000000000 +0000 +++ rust-jobserver-0.1.24/tests/helper.rs 1973-11-29 21:33:09.000000000 +0000 @@ -20,7 +20,7 @@ drop(client.clone().into_helper_thread(|_| ()).unwrap()); drop(client.clone().into_helper_thread(|_| ()).unwrap()); drop(client.clone().into_helper_thread(|_| ()).unwrap()); - drop(client.clone().into_helper_thread(|_| ()).unwrap()); + drop(client.into_helper_thread(|_| ()).unwrap()); } #[test] diff -Nru rust-jobserver-0.1.21/tests/make-as-a-client.rs rust-jobserver-0.1.24/tests/make-as-a-client.rs --- rust-jobserver-0.1.21/tests/make-as-a-client.rs 2019-09-09 13:43:22.000000000 +0000 +++ rust-jobserver-0.1.24/tests/make-as-a-client.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,6 +1,3 @@ -extern crate jobserver; -extern crate tempdir; - use std::env; use std::fs::File; use std::io::prelude::*; @@ -42,7 +39,7 @@ let c = t!(Client::new(1)); let td = TempDir::new("foo").unwrap(); - let prog = env::var("MAKE").unwrap_or("make".to_string()); + let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string()); let me = t!(env::current_exe()); let me = me.to_str().unwrap(); diff -Nru rust-jobserver-0.1.21/tests/server.rs rust-jobserver-0.1.24/tests/server.rs --- rust-jobserver-0.1.21/tests/server.rs 2019-09-09 13:43:22.000000000 +0000 +++ rust-jobserver-0.1.24/tests/server.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,6 +1,3 @@ -extern crate jobserver; -extern crate tempdir; - use std::env; use std::fs::File; use std::io::prelude::*; @@ -61,7 +58,7 @@ let c = t!(Client::new(1)); let td = TempDir::new("foo").unwrap(); - let prog = env::var("MAKE").unwrap_or("make".to_string()); + let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string()); let mut cmd = Command::new(prog); cmd.current_dir(td.path()); @@ -115,7 +112,7 @@ let c = t!(Client::new(1)); let td = TempDir::new("foo").unwrap(); - let prog = env::var("MAKE").unwrap_or("make".to_string()); + let prog = env::var("MAKE").unwrap_or_else(|_| "make".to_string()); let mut cmd = Command::new(prog); cmd.current_dir(td.path());