From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id +KGxNooQO2R6WwEASxT56A (envelope-from ) for ; Sat, 15 Apr 2023 23:00:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SLi5NooQO2TsRgAAauVa8A (envelope-from ) for ; Sat, 15 Apr 2023 23:00:58 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A0C553AF86 for ; Sat, 15 Apr 2023 23:00:58 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnn0r-0005CU-6n; Sat, 15 Apr 2023 17:00:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnn0n-0005CE-0N for guix-devel@gnu.org; Sat, 15 Apr 2023 17:00:45 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnn0k-00036u-Mt for guix-devel@gnu.org; Sat, 15 Apr 2023 17:00:44 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D04E5209B; Sat, 15 Apr 2023 23:00:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JPHjmuadnWFq; Sat, 15 Apr 2023 23:00:30 +0200 (CEST) Received: from jurong (unknown [IPv6:2001:861:c4:f2f0::c64]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A275F37A; Sat, 15 Apr 2023 23:00:30 +0200 (CEST) Date: Sat, 15 Apr 2023 23:00:29 +0200 From: Andreas Enge To: Kaelyn Cc: guix-devel , Maxim Cournoyer , Simon Tournier Subject: Re: wget on i686 in core-updates Message-ID: References: <86mt3br087.fsf@gmail.com> <871qkm6k8p.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zk8QwDHSdCnC2lGC" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Received-SPF: pass client-ip=185.233.100.1; envelope-from=andreas@enge.fr; helo=hera.aquilenet.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681592458; a=rsa-sha256; cv=none; b=DPuGXJrLaElw5Vq+zSvyYxly0IXrh6h47ydRA0hLk8FkKj8aqLwpb5C1ld7l/Avttxqniw zdz39ldv2SzXzypvNN3L+cXBiYEQSHjKjOB84jmAd20ef5ixb+SVcLMFEtx2t8NH7FmgTT RSg9HSx563aSTPBc7KG38XT54Vuu/GWLSBSKx7qZWtqXC6kwBtEobCTdjzhhcNV4ooQyil BH5NAiD4copHpZ9dAlPm/LowWakFr/jftrZiSpwx1TXEYq/yle5GlRMa0HRafzg1xY8Bjm gG4M0eWFGMGNdlJ1rvYDPl/CfB3Xs/LZyauTsVhkl2UTVO2UmS+BqCHpqrv0Mg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681592458; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m5O3X7lNfiVo85U9mY7ZeEM5XOi3EYl9zE+4b8hFbGM=; b=eK8gSGlOCBQLknmJjfjL4BWm2M/+q03mWWjRbVVldJyRNEZYlU/PT60gY1Vz1GPFjdUucQ DDvZ2oKjUxMCWoehQSXDgLRDor1Uhgg6SqnSXTDdGwSFWU3ZfpiUuSQo1fSBkvr8iI/Ov0 gE7blPU3scq6jV1Nm8CjTCCkitJPwkplidybBvsoGNycCpvHn5IGYIRwdr5alD/v/mqfvd yohFw9tHexSHyAmQpNub9y596tOTocjoKhC+WEkiD5wXV06PfMg10iYEWd+JOb3H7jNvwn x6rFwvQd7XIrKD7+l01o0aAErmrukWM0PZqllGY1emD+dFnQAEEuEF0TqLInqA== X-Migadu-Queue-Id: A0C553AF86 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -0.82 X-Spam-Score: -0.82 X-TUID: lpc85/DFHqNV --zk8QwDHSdCnC2lGC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Am Sat, Apr 15, 2023 at 06:25:52PM +0000 schrieb Kaelyn: > I tried to update the package definition to be able to build from git but it became a much bigger rabbit hole than I have the energy for at the moment. I also tried to cherry-pick the commit from the merge request without luck. I just downloaded the commit, which is in uniform diff format and can serve as a patch to be applied to the tarball. The result is attached, but it does not work: The tests fail as before with the "file not found" messages. But thanks for digging through the wget issues! Andreas --zk8QwDHSdCnC2lGC Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-wget-Add-patch-needed-for-i686.patch" Content-Transfer-Encoding: 8bit >From 0991a0daf74c0a3754618f99b7a7cb812debfa1a Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Sat, 15 Apr 2023 22:52:39 +0200 Subject: [PATCH] gnu: wget: Add patch needed for i686. * gnu/packages/patches/wget-hsts-portability.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. * gnu/packages/wget.scm (wget)[origin]: Apply patch. --- gnu/local.mk | 1 + .../patches/wget-hsts-portability.patch | 223 ++++++++++++++++++ gnu/packages/wget.scm | 4 +- 3 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/wget-hsts-portability.patch diff --git a/gnu/local.mk b/gnu/local.mk index 73756a8c49..8dd0c45cea 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2021,6 +2021,7 @@ dist_patch_DATA = \ %D%/packages/patches/webrtc-audio-processing-big-endian.patch \ %D%/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch \ %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \ + %D%/packages/patches/wget-hsts-portability.patch \ %D%/packages/patches/wmctrl-64-fix.patch \ %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \ %D%/packages/patches/wordnet-CVE-2008-2149.patch \ diff --git a/gnu/packages/patches/wget-hsts-portability.patch b/gnu/packages/patches/wget-hsts-portability.patch new file mode 100644 index 0000000000..62dabd7fae --- /dev/null +++ b/gnu/packages/patches/wget-hsts-portability.patch @@ -0,0 +1,223 @@ +From 9a3479a23c15cd7234a54296ae50c48f29c427ec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim=20R=C3=BChsen?= +Date: Sun, 20 Mar 2022 12:18:20 +0100 +Subject: [PATCH] Fix HSTS portability by using int64_t instead of time_t. + +* src/hsts.c: Use int64_t instead of time_t. +* src/http.c: Use int64_t for parsing Strict-Transport-Security. +--- + src/hsts.c | 41 ++++++++++++++++++++--------------------- + src/hsts.h | 2 +- + src/http.c | 24 ++++++++++++------------ + 3 files changed, 33 insertions(+), 34 deletions(-) + +diff --git a/src/hsts.c b/src/hsts.c +index 0a014401..72c5e936 100644 +--- a/src/hsts.c ++++ b/src/hsts.c +@@ -61,8 +61,8 @@ struct hsts_kh { + }; + + struct hsts_kh_info { +- time_t created; +- time_t max_age; ++ int64_t created; ++ int64_t max_age; + bool include_subdomains; + }; + +@@ -166,7 +166,7 @@ end: + static bool + hsts_new_entry_internal (hsts_store_t store, + const char *host, int port, +- time_t created, time_t max_age, ++ int64_t created, int64_t max_age, + bool include_subdomains, + bool check_validity, + bool check_expired, +@@ -216,21 +216,21 @@ bail: + static bool + hsts_add_entry (hsts_store_t store, + const char *host, int port, +- time_t max_age, bool include_subdomains) ++ int64_t max_age, bool include_subdomains) + { +- time_t t = time (NULL); ++ int64_t t = (int64_t) time (NULL); + + /* It might happen time() returned -1 */ +- return (t == (time_t)(-1) ? ++ return (t == -1) ? + false : +- hsts_new_entry_internal (store, host, port, t, max_age, include_subdomains, false, true, false)); ++ hsts_new_entry_internal (store, host, port, t, max_age, include_subdomains, false, true, false); + } + + /* Creates a new entry, unless an identical one already exists. */ + static bool + hsts_new_entry (hsts_store_t store, + const char *host, int port, +- time_t created, time_t max_age, ++ int64_t created, int64_t max_age, + bool include_subdomains) + { + return hsts_new_entry_internal (store, host, port, created, max_age, include_subdomains, true, true, true); +@@ -245,7 +245,7 @@ hsts_remove_entry (hsts_store_t store, struct hsts_kh *kh) + static bool + hsts_store_merge (hsts_store_t store, + const char *host, int port, +- time_t created, time_t max_age, ++ int64_t created, int64_t max_age, + bool include_subdomains) + { + enum hsts_kh_match match_type = NO_MATCH; +@@ -276,11 +276,11 @@ hsts_read_database (hsts_store_t store, FILE *fp, bool merge_with_existing_entri + size_t len = 0; + int items_read; + bool result = false; +- bool (*func)(hsts_store_t, const char *, int, time_t, time_t, bool); ++ bool (*func)(hsts_store_t, const char *, int, int64_t, int64_t, bool); + + char host[256]; + int port; +- time_t created, max_age; ++ int64_t created, max_age; + int include_subdomains; + + func = (merge_with_existing_entries ? hsts_store_merge : hsts_new_entry); +@@ -326,10 +326,9 @@ hsts_store_dump (hsts_store_t store, FILE *fp) + struct hsts_kh *kh = (struct hsts_kh *) it.key; + struct hsts_kh_info *khi = (struct hsts_kh_info *) it.value; + +- if (fprintf (fp, "%s\t%d\t%d\t%lu\t%lu\n", ++ if (fprintf (fp, "%s\t%d\t%d\t%" PRId64 "\t%" PRId64 "\n", + kh->host, kh->explicit_port, khi->include_subdomains, +- (unsigned long) khi->created, +- (unsigned long) khi->max_age) < 0) ++ khi->created, khi->max_age) < 0) + { + logprintf (LOG_ALWAYS, "Could not write the HSTS database correctly.\n"); + break; +@@ -439,7 +438,7 @@ hsts_match (hsts_store_t store, struct url *u) + bool + hsts_store_entry (hsts_store_t store, + enum url_scheme scheme, const char *host, int port, +- time_t max_age, bool include_subdomains) ++ int64_t max_age, bool include_subdomains) + { + bool result = false; + enum hsts_kh_match match = NO_MATCH; +@@ -464,9 +463,9 @@ hsts_store_entry (hsts_store_t store, + * 'created' field too. The RFC also states that we have to + * update the entry each time we see HSTS header. + * See also Section 11.2. */ +- time_t t = time (NULL); ++ int64_t t = (int64_t) time (NULL); + +- if (t != (time_t)(-1) && t != entry->created) ++ if (t != -1 && t != entry->created) + { + entry->created = t; + entry->max_age = max_age; +@@ -792,7 +791,7 @@ test_hsts_read_database (void) + hsts_store_t table; + char *file = NULL; + FILE *fp = NULL; +- time_t created = time(NULL) - 10; ++ int64_t created = time(NULL) - 10; + + if (opt.homedir) + { +@@ -801,9 +800,9 @@ test_hsts_read_database (void) + if (fp) + { + fputs ("# dummy comment\n", fp); +- fprintf (fp, "foo.example.com\t0\t1\t%lu\t123\n",(unsigned long) created); +- fprintf (fp, "bar.example.com\t0\t0\t%lu\t456\n", (unsigned long) created); +- fprintf (fp, "test.example.com\t8080\t0\t%lu\t789\n", (unsigned long) created); ++ fprintf (fp, "foo.example.com\t0\t1\t%" PRId64 "\t123\n", created); ++ fprintf (fp, "bar.example.com\t0\t0\t%" PRId64 "\t456\n", created); ++ fprintf (fp, "test.example.com\t8080\t0\t%" PRId64 "\t789\n", created); + fclose (fp); + + table = hsts_store_open (file); +diff --git a/src/hsts.h b/src/hsts.h +index 6ecd5060..be048944 100644 +--- a/src/hsts.h ++++ b/src/hsts.h +@@ -46,7 +46,7 @@ bool hsts_store_has_changed (hsts_store_t); + + bool hsts_store_entry (hsts_store_t, + enum url_scheme, const char *, int, +- time_t, bool); ++ int64_t, bool); + bool hsts_match (hsts_store_t, struct url *); + + #endif /* HAVE_HSTS */ +diff --git a/src/http.c b/src/http.c +index f61c99a7..87b51b00 100644 +--- a/src/http.c ++++ b/src/http.c +@@ -1300,7 +1300,7 @@ parse_content_disposition (const char *hdr, char **filename) + + #ifdef HAVE_HSTS + static bool +-parse_strict_transport_security (const char *header, time_t *max_age, bool *include_subdomains) ++parse_strict_transport_security (const char *header, int64_t *max_age, bool *include_subdomains) + { + param_token name, value; + const char *c_max_age = NULL; +@@ -1330,7 +1330,7 @@ parse_strict_transport_security (const char *header, time_t *max_age, bool *incl + * Also, time_t is normally defined as a long, so this should not break. + */ + if (max_age) +- *max_age = (time_t) strtol (c_max_age, NULL, 10); ++ *max_age = (int64_t) strtoll (c_max_age, NULL, 10); + if (include_subdomains) + *include_subdomains = is; + +@@ -3184,9 +3184,6 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, + #else + extern hsts_store_t hsts_store; + #endif +- const char *hsts_params; +- time_t max_age; +- bool include_subdomains; + #endif + + int sock = -1; +@@ -3674,21 +3671,24 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, + #ifdef HAVE_HSTS + if (opt.hsts && hsts_store) + { +- hsts_params = resp_header_strdup (resp, "Strict-Transport-Security"); ++ int64_t max_age; ++ const char *hsts_params = resp_header_strdup (resp, "Strict-Transport-Security"); ++ bool include_subdomains; ++ + if (parse_strict_transport_security (hsts_params, &max_age, &include_subdomains)) + { + /* process strict transport security */ + if (hsts_store_entry (hsts_store, u->scheme, u->host, u->port, max_age, include_subdomains)) +- DEBUGP(("Added new HSTS host: %s:%u (max-age: %lu, includeSubdomains: %s)\n", ++ DEBUGP(("Added new HSTS host: %s:%" PRIu32 " (max-age: %" PRId64 ", includeSubdomains: %s)\n", + u->host, +- (unsigned) u->port, +- (unsigned long) max_age, ++ (uint32_t) u->port, ++ max_age, + (include_subdomains ? "true" : "false"))); + else +- DEBUGP(("Updated HSTS host: %s:%u (max-age: %lu, includeSubdomains: %s)\n", ++ DEBUGP(("Updated HSTS host: %s:%" PRIu32 " (max-age: %" PRId64 ", includeSubdomains: %s)\n", + u->host, +- (unsigned) u->port, +- (unsigned long) max_age, ++ (uint32_t) u->port, ++ max_age, + (include_subdomains ? "true" : "false"))); + } + xfree (hsts_params); +-- +GitLab + diff --git a/gnu/packages/wget.scm b/gnu/packages/wget.scm index 083cf27212..6774fd477f 100644 --- a/gnu/packages/wget.scm +++ b/gnu/packages/wget.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Michael Rohleder +;;; Copyright © 2023 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,7 +55,8 @@ (define-public wget version ".tar.lz")) (sha256 (base32 - "19afmyr1i3zwdwr8wkyz8q6z5764ik3dm87as194g78l8xggplnv")))) + "19afmyr1i3zwdwr8wkyz8q6z5764ik3dm87as194g78l8xggplnv")) + (patches (search-patches "wget-hsts-portability.patch")))) (build-system gnu-build-system) (inputs (list gnutls libidn2 libpsl)) -- 2.39.2 --zk8QwDHSdCnC2lGC--