testing/read-it-later: update the cargo dependencies

Update all of the Cargo dependencies. This makes read-it-later more
reliable and fixes crate fetch failures.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
This commit is contained in:
Alistair Francis 2021-09-07 20:56:05 +10:00 committed by Leo
parent 14fd540bad
commit bcd218dcf6
5 changed files with 4432 additions and 1776 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
From b0049b419efb41f05c0350dbf42fe5924e9312f8 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair@alistair23.me>
Date: Wed, 25 Aug 2021 20:26:18 +1000
Subject: [PATCH 3/4] gitlab-ci.yml: Update the containers
Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
.gitlab-ci.yml | 4 ++--
build-aux/com.belmoussaoui.ReadItLaterDevel.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aa093aa..bbfb685 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,9 +1,9 @@
include:
- project: 'gnome/citemplates'
- file: 'flatpak/flatpak-ci-initiative-sdk-extensions.yml'
+ file: 'flatpak/flatpak_ci_initiative.yml'
flatpak:
- image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:3.36'
+ image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:40'
variables:
BUNDLE: "read-it-later-nightly.flatpak"
MANIFEST_PATH: "build-aux/com.belmoussaoui.ReadItLaterDevel.json"
diff --git a/build-aux/com.belmoussaoui.ReadItLaterDevel.json b/build-aux/com.belmoussaoui.ReadItLaterDevel.json
index 7e6171b..0eef02f 100644
--- a/build-aux/com.belmoussaoui.ReadItLaterDevel.json
+++ b/build-aux/com.belmoussaoui.ReadItLaterDevel.json
@@ -1,7 +1,7 @@
{
"app-id": "com.belmoussaoui.ReadItLaterDevel",
"runtime": "org.gnome.Platform",
- "runtime-version": "3.36",
+ "runtime-version": "40",
"sdk": "org.gnome.Sdk",
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
"command": "read-it-later",
--
2.31.1

View File

@ -0,0 +1,114 @@
From b958ed12ae15ee681f1c208b6962bd3d558134cc Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair@alistair23.me>
Date: Wed, 25 Aug 2021 21:01:40 +1000
Subject: [PATCH 4/4] Cargo.toml: Update isahc
Update isahc. As part of this we need to convert copy_to_file() to not
be async due to: https://github.com/sagebind/isahc/issues/283
Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
Cargo.lock | 30 +++++++++++++++++++++++++++---
Cargo.toml | 2 +-
src/models/preview_image.rs | 4 ++--
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 42f21e6..ec3602a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1413,7 +1413,7 @@ dependencies = [
"deadpool",
"futures",
"http-types",
- "isahc",
+ "isahc 0.9.14",
"js-sys",
"log",
"wasm-bindgen",
@@ -1494,13 +1494,37 @@ dependencies = [
"crossbeam-utils",
"curl",
"curl-sys",
- "encoding_rs",
"flume",
"futures-lite",
"http",
"log",
+ "once_cell",
+ "slab",
+ "sluice",
+ "tracing",
+ "tracing-futures",
+ "url",
+ "waker-fn",
+]
+
+[[package]]
+name = "isahc"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "431445cb4ba85a80cb1438a9ae8042dadb78ae4046ecee89ad027b614aa0ddb7"
+dependencies = [
+ "async-channel",
+ "crossbeam-utils",
+ "curl",
+ "curl-sys",
+ "encoding_rs",
+ "event-listener",
+ "futures-lite",
+ "http",
+ "log",
"mime",
"once_cell",
+ "polling",
"slab",
"sluice",
"tracing",
@@ -2461,7 +2485,7 @@ dependencies = [
"gtk-macros",
"html2pango",
"http-client",
- "isahc",
+ "isahc 1.5.0",
"lazy_static",
"libhandy",
"log",
diff --git a/Cargo.toml b/Cargo.toml
index 51e5850..ed29a18 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ pretty_env_logger = "0.4"
diesel = { version = "1.4", features = ["sqlite", "r2d2", "chrono"] }
diesel_migrations = { version = "1.4", features = ["sqlite"] }
anyhow = "1.0"
-isahc = "0.9"
+isahc = "1.5"
sanitize_html = "0.7"
regex = "1.5"
secret-service = "1.0"
diff --git a/src/models/preview_image.rs b/src/models/preview_image.rs
index 3b9b7c4..b9900e7 100644
--- a/src/models/preview_image.rs
+++ b/src/models/preview_image.rs
@@ -1,7 +1,7 @@
use anyhow::Result;
use crypto::digest::Digest;
use crypto::sha1::Sha1;
-use isahc::ResponseExt;
+use isahc::prelude::*;
use std::path::PathBuf;
use std::rc::Rc;
use url::Url;
@@ -33,7 +33,7 @@ impl PreviewImage {
}
pub async fn download(&self, client: Rc<isahc::HttpClient>) -> Result<()> {
- if let Ok(mut resp) = client.get_async(&self.url.to_string()).await {
+ if let Ok(mut resp) = client.get(&self.url.to_string()) {
info!("Downloading preview image {} into {:#?}", self.url, self.cache);
resp.copy_to_file(self.cache.clone())?;
}
--
2.31.1

View File

@ -2,17 +2,20 @@
# Maintainer: Alistair Francis <alistair@alistair23.me>
pkgname=read-it-later
pkgver=0.0.2
pkgrel=0
pkgrel=1
pkgdesc="Wallabag Client built with GTK"
url="https://gitlab.gnome.org/World/read-it-later"
arch="all !s390x !mips64 !riscv64" # cargo, rust not found
arch="" # Fails to fetch wallabag-api
license="GPL-3.0-only"
makedepends="meson bash rust cargo webkit2gtk-dev libhandy-dev sqlite-dev
makedepends="meson bash rust cargo webkit2gtk-dev libhandy1-dev sqlite-dev
gettext-dev openssl-dev"
source="read-it-later-$pkgver.tar.gz::https://gitlab.gnome.org/World/read-it-later/-/archive/$pkgver/read-it-later-$pkgver.tar.gz
fix-wallabag-api.patch
source="read-it-later-692cf638e1284bcf31031421e6951c767bed6139.tar.gz::https://gitlab.gnome.org/World/read-it-later/-/archive/692cf638e1284bcf31031421e6951c767bed6139/read-it-later-692cf638e1284bcf31031421e6951c767bed6139.tar.gz
0001-Cargo-Update-the-glib-dependencies.patch
0002-Cargo-Update-most-remainig-dependencies.patch
0003-gitlab-ci.yml-Update-the-containers.patch
0004-Cargo.toml-Update-isahc.patch
"
builddir="$srcdir/read-it-later-692cf638e1284bcf31031421e6951c767bed6139"
options="!check" # no tests
build() {
@ -29,6 +32,9 @@ package() {
}
sha512sums="
fce6d6896e434793c03b65c9f960a3006af807084cbc1538a3e1324e2b1aac22ffb284e41e8a4ee94c533cd3cb900256cbf65c97f5e61e6b0938566d2850e459 read-it-later-0.0.2.tar.gz
4eb0d9ed2427189f854886ef4611a2d4c1e98885ceea8a41c8be3cd1b571ad09d8dbf0d3dbfe3128e511391209407388cd1caa4e12ea15ef0c4117eb769ec824 fix-wallabag-api.patch
8c0b6a608230feb57612b06ea993f0f03d25ba90959376cfd80709190e4939c88edeadd3071a70006ad84879604682ac47f87e3e72cbb5a300d0f505084bf37e read-it-later-692cf638e1284bcf31031421e6951c767bed6139.tar.gz
12e26a50f155e13e8704b1eb5a7858baf2fe54e59374518f77225172694b40c716801e4bc868c4af03feb71acd85ee34e8ad0e5497c69360943618abb18f823e 0001-Cargo-Update-the-glib-dependencies.patch
c74dcbb4413b30c336d8b421f1d82a4516409e76c936b126491418914cdf287d91ba80557799c86e7c874ef74538011416e5aefa5bcf73d4946dcae58b2f3f7a 0002-Cargo-Update-most-remainig-dependencies.patch
7d1327995d9c4e8eb9b0774ea3d54c338bb16ec0fd3f9724655e54f28ac38c9e6623661ff9313bdb4e3aab3131d6a384f6c60c7499a3e3891b57a13e9750ac3f 0003-gitlab-ci.yml-Update-the-containers.patch
0638d8270b3666fdb149ef0e4c6e23dc33e48bad2b2294d2484240560933560e9500c34ddba44b7f4972062d0c0e618149d448e4bb0c83dd17220a1e3f0d8d41 0004-Cargo.toml-Update-isahc.patch
"