From nobody Sun Jan 08 11:52:44 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nqb6h4vfhz2sGRm; Sun, 8 Jan 2023 11:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nqb6h4MnVz3jCv; Sun, 8 Jan 2023 11:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673178764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73XNSckorLtXrHdutVwLy3rRSnBqzRQRPCh6NMa4zao=; b=J358yhPri14c30/2IlTUwf9jetY69yuKd9nSYo/ZSuQmYE2Xa2Ym9cHI5XKEJrsqZqnMAC M8HgXgScMIyJDTheZbeV3B6we0ogfCuMCrzugDilDO5MAywzuQWOIzeJSB8C+ZGT3v51dn FqacTe6ekyihzHiRrBDzFihAGCTAc1kUIz7GnWqAPFmRQBh7/uGqOmM/VrY0h9S7Oh54N/ fxSgfr+Na9Kq8llEbIBwViDOjjPY1CrW3hRC83ZsUpsTJt5cVzTU5IeHnWFll/VQm8qOk4 0JoGfgSMKO39+1zrFZqIsTu5mvI8zp565T9kioysfdC6MIUkq9L+EjIAAbyZ0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673178764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73XNSckorLtXrHdutVwLy3rRSnBqzRQRPCh6NMa4zao=; b=P5EpYDnb3pYdLK6t/6bFTSiCgrEpaRtILngkKdMGM7vp6IwZiBlA6/+8ZaD8r6CCZVQykY cfZl9ETq59fdHenswjT2HajKZYvCamC4QdCxO87Maep3DnaRRxq9PwQpVTY5AhGK/qWuPN kN4E2oD4sMfWT81t4a4ViFDkwN7QnCmskvljtJGXSZs3/vvcGQLFR57hwZzt3evWv2KM3F BpCA2CrLhi9IZbs3ASwbfjh4btPH+bxDZSav0V0dYW4MwkW+2RuVNOvpVdihXYsouzpuaN bR2qHvQ2wpXzlKJ/AjJ2wc9f/Hg+MXOnB8ibxpZv1/5CBXjBw3baUVxG5v8QhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673178764; a=rsa-sha256; cv=none; b=mboLutAskKiOt8AQlhHfLpCkMQY2hP2GcoHPAADb8Yg7WA03TNZCho6LZ6aW0yRhT/PaC5 3upZH8dOXcaVGIKtw35jVzDxyFTYBJxRXMhUi+h4ohp33T+95WdV4yhVQdXmvViaxAD7xa SqfZ9MFx+hO2VMz7ZZPMZIcC3l2HZKJvU2qcNkzh9XmPjev/j6dwEny4Le7czV6mRr22yw ossR2iDBWJnq7SJrKKVc0Hfw/QABtyMswNAn5cb6+PYLgH5WrxAJKZIt90R6d1iK16kpRB OIUW+CQLG7j7HK03doMA5bAd5q+6gd1YYPuVBsWhkw2clV/gFZm0VKV3aqs+qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nqb6h3NRqznrM; Sun, 8 Jan 2023 11:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 308Bqikp001307; Sun, 8 Jan 2023 11:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 308BqieB001306; Sun, 8 Jan 2023 11:52:44 GMT (envelope-from git) Date: Sun, 8 Jan 2023 11:52:44 GMT Message-Id: <202301081152.308BqieB001306@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: 7eb89cf86e6b - main - www/varnish-libvmod-fileserver: fix build on ARM / POWER List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7eb89cf86e6b50ca33c43a9e3c733bbab131d0b0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=7eb89cf86e6b50ca33c43a9e3c733bbab131d0b0 commit 7eb89cf86e6b50ca33c43a9e3c733bbab131d0b0 Author: Piotr Kubaj AuthorDate: 2023-01-08 11:41:25 +0000 Commit: Piotr Kubaj CommitDate: 2023-01-08 11:52:39 +0000 www/varnish-libvmod-fileserver: fix build on ARM / POWER Fix build with unsigned char instead signed char: 133 | iface.ifr_name[i] = c as i8; | ----------------- ^^^^^^^ expected `u8`, found `i8` --- ...-cargo-crates_varnish-0.0.12_src_vcl_convert.rs | 14 ++++++++ ...atch-cargo-crates_varnish-0.0.12_src_vcl_ctx.rs | 38 ++++++++++++++++++++++ ...tch-cargo-crates_varnish-0.0.12_src_vcl_http.rs | 23 +++++++++++++ ...argo-crates_varnish-0.0.12_src_vcl_processor.rs | 28 ++++++++++++++++ ...patch-cargo-crates_varnish-0.0.12_src_vcl_ws.rs | 28 ++++++++++++++++ .../files/patch-src_lib.rs | 38 ++++++++++++++++++++++ 6 files changed, 169 insertions(+) diff --git a/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_convert.rs b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_convert.rs new file mode 100644 index 000000000000..f36c8f28509e --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_convert.rs @@ -0,0 +1,14 @@ +--- cargo-crates/varnish-0.0.12/src/vcl/convert.rs.orig 2023-01-08 01:32:37 UTC ++++ cargo-crates/varnish-0.0.12/src/vcl/convert.rs +@@ -139,9 +139,9 @@ impl IntoVCL for &[u8] { + // try to save some work if the buffer is already in the workspace + // and if it's followed by a null byte + if unsafe { varnish_sys::WS_Allocated(ws.raw, self.as_ptr() as *const c_void, self.len() as i64 + 1) == 1 && *self.as_ptr().add(self.len()) == b'\0' } { +- Ok(self.as_ptr() as *const i8) ++ Ok(self.as_ptr() as *const c_char) + } else { +- Ok(ws.copy_bytes_with_null(&self)?.as_ptr() as *const i8) ++ Ok(ws.copy_bytes_with_null(&self)?.as_ptr() as *const c_char) + } + } + } diff --git a/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ctx.rs b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ctx.rs new file mode 100644 index 000000000000..90ab140bde5a --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ctx.rs @@ -0,0 +1,38 @@ +--- cargo-crates/varnish-0.0.12/src/vcl/ctx.rs.orig 2023-01-08 01:41:36 UTC ++++ cargo-crates/varnish-0.0.12/src/vcl/ctx.rs +@@ -4,6 +4,7 @@ use std::os::raw::{c_uint, c_void}; + + use crate::vcl::http::HTTP; + use crate::vcl::ws::{TestWS, WS}; ++use std::os::raw::c_char; + use std::ptr; + use varnish_sys::{ + busyobj, req, sess, vrt_ctx, vsb, vsl_log, ws, VSL_tag_e_SLT_Debug, VSL_tag_e_SLT_Error, +@@ -103,7 +104,7 @@ impl<'a> Ctx<'a> { + // not great, we have to copy the string to add a null character + let c_cstring = CString::new(msg).unwrap(); + unsafe { +- VRT_fail(self.raw, "%s\0".as_ptr() as *const i8, c_cstring.as_ptr()); ++ VRT_fail(self.raw, "%s\0".as_ptr() as *const c_char, c_cstring.as_ptr()); + } + 0 + } +@@ -116,8 +117,8 @@ impl<'a> Ctx<'a> { + log(logtag, msg); + } else { + let t = varnish_sys::txt { +- b: msg.as_ptr() as *const i8, +- e: msg.as_ptr().add(msg.len()) as *const i8, ++ b: msg.as_ptr() as *const c_char, ++ e: msg.as_ptr().add(msg.len()) as *const c_char, + }; + varnish_sys::VSLbt(p.vsl, logtag.into_u32(), t); + +@@ -245,6 +246,6 @@ impl Event { + pub fn log(logtag: LogTag, msg: &str) { + unsafe { + let c_cstring = CString::new(msg).unwrap(); +- varnish_sys::VSL(logtag.into_u32(), 0, b"%s\0".as_ptr() as *const i8, c_cstring.as_ptr() as *const u8); ++ varnish_sys::VSL(logtag.into_u32(), 0, b"%s\0".as_ptr() as *const c_char, c_cstring.as_ptr() as *const u8); + } + } diff --git a/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_http.rs b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_http.rs new file mode 100644 index 000000000000..bab021b8c1f9 --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_http.rs @@ -0,0 +1,23 @@ +--- cargo-crates/varnish-0.0.12/src/vcl/http.rs.orig 2023-01-08 02:38:57 UTC ++++ cargo-crates/varnish-0.0.12/src/vcl/http.rs +@@ -12,7 +12,7 @@ + //! this [issue](https://github.com/gquintard/varnish-rs/issues/4). + + #![allow(clippy::not_unsafe_ptr_arg_deref)] +-use std::os::raw::c_uint; ++use std::os::raw::{c_char, c_uint}; + use std::slice::{from_raw_parts, from_raw_parts_mut}; + use std::str::from_utf8; + +@@ -53,9 +53,9 @@ impl<'a> HTTP<'a> { + let hdr_buf = ws.copy_bytes_with_null(&value)?; + unsafe { + let mut hd = self.raw.hd.offset(idx as isize); +- (*hd).b = hdr_buf.as_ptr() as *const i8; ++ (*hd).b = hdr_buf.as_ptr() as *const c_char; + /* -1 accounts for the null character */ +- (*hd).e = hdr_buf.as_ptr().add(hdr_buf.len() - 1) as *const i8; ++ (*hd).e = hdr_buf.as_ptr().add(hdr_buf.len() - 1) as *const c_char; + let hdf = self.raw.hdf.offset(idx as isize); + *hdf = 0; + } diff --git a/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_processor.rs b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_processor.rs new file mode 100644 index 000000000000..3ee7f7ed2243 --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_processor.rs @@ -0,0 +1,28 @@ +--- cargo-crates/varnish-0.0.12/src/vcl/processor.rs.orig 2023-01-08 02:45:31 UTC ++++ cargo-crates/varnish-0.0.12/src/vcl/processor.rs +@@ -5,6 +5,7 @@ + //! *Note:* The rust wrapper here is pretty thin and the vmod writer will most probably need to have to + //! deal with the raw Varnish internals. + ++use std::os::raw::c_char; + use std::os::raw::c_int; + use std::os::raw::c_void; + use std::ptr; +@@ -129,7 +130,7 @@ pub unsafe extern "C" fn gen_vdp_push( + /// Create a `varnish_sys::vdp` that can be fed to `varnish_sys::VRT_AddVDP` + pub fn new_vdp() -> varnish_sys::vdp { + varnish_sys::vdp { +- name: T::name().as_ptr() as *const i8, ++ name: T::name().as_ptr() as *const c_char, + init: Some(gen_vdp_init::), + bytes: Some(gen_vdp_push::), + fini: Some(gen_vdp_fini::), +@@ -246,7 +247,7 @@ pub unsafe extern "C" fn wrap_vfp_fini(ctxp: * + /// Create a `varnish_sys::vfp` that can be fed to `varnish_sys::VRT_AddVFP` + pub fn new_vfp() -> varnish_sys::vfp { + varnish_sys::vfp { +- name: T::name().as_ptr() as *const i8, ++ name: T::name().as_ptr() as *const c_char, + init: Some(wrap_vfp_init::), + pull: Some(wrap_vfp_pull::), + fini: Some(wrap_vfp_fini::), diff --git a/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ws.rs b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ws.rs new file mode 100644 index 000000000000..bf5cebff2b6d --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-cargo-crates_varnish-0.0.12_src_vcl_ws.rs @@ -0,0 +1,28 @@ +--- cargo-crates/varnish-0.0.12/src/vcl/ws.rs.orig 2023-01-08 02:53:56 UTC ++++ cargo-crates/varnish-0.0.12/src/vcl/ws.rs +@@ -10,6 +10,7 @@ + //! **Note:** unless you know what you are doing, you should probably just use the automatic type + //! conversion provided by [`crate::vcl::convert`], or store things in + //! [`crate::vcl::vpriv::VPriv`]. ++use std::os::raw::c_char; + use std::ffi::c_void; + use std::ptr; + use std::slice::from_raw_parts_mut; +@@ -213,7 +214,7 @@ impl<'a> Drop for ReservedBuf<'a> { + pub struct TestWS { + c_ws: varnish_sys::ws, + #[allow(dead_code)] +- space: Vec, ++ space: Vec, + } + + impl TestWS { +@@ -229,7 +230,7 @@ impl TestWS { + TestWS { + c_ws: varnish_sys::ws { + magic: varnish_sys::WS_MAGIC, +- id: ['t' as i8, 's' as i8, 't' as i8, '\0' as i8], ++ id: ['t' as c_char, 's' as c_char, 't' as c_char, '\0' as c_char], + s, + f: s, + r: ptr::null_mut(), diff --git a/www/varnish-libvmod-fileserver/files/patch-src_lib.rs b/www/varnish-libvmod-fileserver/files/patch-src_lib.rs new file mode 100644 index 000000000000..8823009ab880 --- /dev/null +++ b/www/varnish-libvmod-fileserver/files/patch-src_lib.rs @@ -0,0 +1,38 @@ +--- src/lib.rs.orig 2023-01-08 03:03:24 UTC ++++ src/lib.rs +@@ -5,7 +5,7 @@ use std::collections::HashMap; + use std::collections::hash_map::DefaultHasher; + use std::hash::{Hash, Hasher}; + use std::io::{BufRead, BufReader, Read}; +-use std::os::raw::{c_uint, c_void}; ++use std::os::raw::{c_char, c_uint, c_void}; + use std::os::unix::fs::MetadataExt; + use std::ptr; + +@@ -113,7 +113,7 @@ impl root { + ctx.raw, + &METHODS.methods, + info_ptr as *mut std::ffi::c_void, +- format!("{}\0", vcl_name).as_ptr() as *const i8, ++ format!("{}\0", vcl_name).as_ptr() as *const c_char, + ) + }; + +@@ -170,7 +170,7 @@ struct VfpWrapper { + } + static FILE_VFP: VfpWrapper = VfpWrapper { + vfp: varnish_sys::vfp { +- name: "fileserver\0".as_ptr() as *const i8, ++ name: "fileserver\0".as_ptr() as *const c_char, + init: None, + pull: Some(varnish::vcl::processor::wrap_vfp_pull::), + fini: Some(varnish::vcl::processor::wrap_vfp_fini::), +@@ -233,7 +233,7 @@ unsafe extern "C" fn be_gethdrs( + ); + + if (*bo.req).req_body_status != varnish_sys::BS_CACHED.as_ptr() { +- bo.no_retry = "req.body not cached\0".as_ptr() as *const i8; ++ bo.no_retry = "req.body not cached\0".as_ptr() as *const c_char; + } + + if (*bo.req).req_body_status == varnish_sys::BS_ERROR.as_ptr() {