Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] icecat: fix build
Date: Mon, 07 Oct 2019 23:48:13 +0200	[thread overview]
Message-ID: <20191007214813.DzF3ebMT_tHU0J2cJOasaftO8du84amhnq_Rho1E3eM@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15221@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 414 bytes --]

There is an updated pull request by jnbr against master on the void-packages repository

https://github.com/jnbr/void-packages icecat
https://github.com/void-linux/void-packages/pull/15221

icecat: fix build
- the vendored version of cssparser fails to build with current rust
- glibc-2.30 introduced gettid as a function

A patch file from https://github.com/void-linux/void-packages/pull/15221.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-icecat-15221.patch --]
[-- Type: text/x-diff, Size: 6607 bytes --]

From b7c9b281ab3fb2d8a2edd5a08a808ed69507f58c Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Mon, 7 Oct 2019 22:48:22 +0200
Subject: [PATCH] icecat: fix build

- the vendored version of cssparser fails to build with current rust
- glibc-2.30 introduced gettid as a function

[ci skip]
---
 .../{fix-musl.patch => fix-gettid.patch}      |  5 +-
 srcpkgs/icecat/patches/rust-cssparser.patch   | 90 +++++++++++++++++++
 srcpkgs/icecat/template                       | 12 +++
 3 files changed, 106 insertions(+), 1 deletion(-)
 rename srcpkgs/icecat/patches/{fix-musl.patch => fix-gettid.patch} (61%)
 create mode 100644 srcpkgs/icecat/patches/rust-cssparser.patch

diff --git a/srcpkgs/icecat/patches/fix-musl.patch b/srcpkgs/icecat/patches/fix-gettid.patch
similarity index 61%
rename from srcpkgs/icecat/patches/fix-musl.patch
rename to srcpkgs/icecat/patches/fix-gettid.patch
index c32921d39e1..6abd59b30c3 100644
--- a/srcpkgs/icecat/patches/fix-musl.patch
+++ b/srcpkgs/icecat/patches/fix-gettid.patch
@@ -1,3 +1,6 @@
+originally, the gettid wrapper was needed on glibc and musl,
+glibc-2.30 added a gettid function, so now it is only needed on musl
+
 --- tools/profiler/core/platform.h.orig
 +++ tools/profiler/core/platform.h
 @@ -56,7 +56,7 @@
@@ -5,7 +8,7 @@
  // We need a definition of gettid(), but glibc doesn't provide a
  // wrapper for it.
 -#if defined(__GLIBC__)
-+#if defined(__linux__)
++#if defined(__linux__) && !defined(__GLIBC__)
  #include <unistd.h>
  #include <sys/syscall.h>
  static inline pid_t gettid()
diff --git a/srcpkgs/icecat/patches/rust-cssparser.patch b/srcpkgs/icecat/patches/rust-cssparser.patch
new file mode 100644
index 00000000000..1ebef87c014
--- /dev/null
+++ b/srcpkgs/icecat/patches/rust-cssparser.patch
@@ -0,0 +1,90 @@
+backport of:
+
+From 3c98d22c5de3b696bf1fde2b6c90069812312aa6 Mon Sep 17 00:00:00 2001
+From: Simon Sapin <simon.sapin@exyr.org>
+Date: Tue, 23 Apr 2019 13:47:25 +0200
+Subject: [PATCH] Fix a future-compat warning
+
+```
+warning[E0506]: cannot assign to `self.input.cached_token` because it is borrowed
+   --> src/parser.rs:591:17
+    |
+566 |     pub fn next_including_whitespace_and_comments(&mut self) -> Result<&Token<'i>, BasicParseError<'i>> {
+    |                                                   - let's call the lifetime of this reference `'1`
+...
+579 |             Some(ref cached_token)
+    |                  ---------------- borrow of `self.input.cached_token` occurs here
+...
+591 |                 self.input.cached_token = Some(CachedToken {
+    |                 ^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `self.input.cached_token` occurs here
+...
+603 |         Ok(token)
+    |         --------- returning this value requires that `self.input.cached_token.0` is borrowed for `'1`
+    |
+    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
+    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
+```
+---
+ src/parser.rs | 50 +++++++++++++++++++++++++++-----------------------
+ 1 file changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/src/parser.rs b/src/parser.rs
+index 51f441e4..7cef117c 100644
+--- third_party/rust/cssparser/src/parser.rs
++++ third_party/rust/cssparser/src/parser.rs
+@@ -555,28 +555,34 @@
+         }
+ 
+         let token_start_position = self.input.tokenizer.position();
+-        let token;
+-        match self.input.cached_token {
+-            Some(ref cached_token)
+-            if cached_token.start_position == token_start_position => {
+-                self.input.tokenizer.reset(&cached_token.end_state);
+-                match cached_token.token {
+-                    Token::Function(ref name) => self.input.tokenizer.see_function(name),
+-                    _ => {}
+-                }
+-                token = &cached_token.token
++        let using_cached_token = self
++            .input
++            .cached_token
++            .as_ref()
++            .map_or(false, |cached_token| {
++                cached_token.start_position == token_start_position
++            });
++        let token = if using_cached_token {
++            let cached_token = self.input.cached_token.as_ref().unwrap();
++            self.input.tokenizer.reset(&cached_token.end_state);
++            match cached_token.token {
++                Token::Function(ref name) => self.input.tokenizer.see_function(name),
++                _ => {}
+             }
+-            _ => {
+-                let new_token = self.input.tokenizer.next()
+-                    .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
+-                self.input.cached_token = Some(CachedToken {
+-                    token: new_token,
+-                    start_position: token_start_position,
+-                    end_state: self.input.tokenizer.state(),
+-                });
+-                token = self.input.cached_token_ref()
+-            }
+-        }
++            &cached_token.token
++        } else {
++            let new_token = self
++                .input
++                .tokenizer
++                .next()
++                .map_err(|()| self.new_basic_error(BasicParseErrorKind::EndOfInput))?;
++            self.input.cached_token = Some(CachedToken {
++                token: new_token,
++                start_position: token_start_position,
++                end_state: self.input.tokenizer.state(),
++            });
++            self.input.cached_token_ref()
++        };
+ 
+         if let Some(block_type) = BlockType::opening(token) {
+             self.at_start_of = Some(block_type);
diff --git a/srcpkgs/icecat/template b/srcpkgs/icecat/template
index 64a466766d9..655d7cab66e 100644
--- a/srcpkgs/icecat/template
+++ b/srcpkgs/icecat/template
@@ -37,6 +37,13 @@ if [ "$XBPS_WORDSIZE" -eq 32 ]; then
 	nodebug=yes
 fi
 
+# we need this because cargo verifies checksums of all files in vendor
+# crates when it builds and gives us no way to override or update the
+# file sanely... so just clear out the file list
+_clear_vendor_checksums() {
+	sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json
+}
+
 post_extract() {
 	case "$XBPS_TARGET_MACHINE" in
 	*-musl)
@@ -51,6 +58,11 @@ post_extract() {
 	# Note: This is for Void Linux use ONLY.
 	echo -n "cd894504-7a2a-4263-abff-ff73ee89ffca" > mozilla-api-key
 }
+
+post_patch() {
+	_clear_vendor_checksums cssparser
+}
+
 do_build() {
 	local triplet
 	cp ${FILESDIR}/mozconfig .mozconfig

  parent reply	other threads:[~2019-10-07 21:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 20:52 [PR PATCH] " voidlinux-github
2019-10-07 21:48 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-07 21:48 ` voidlinux-github [this message]
2019-10-09 20:01 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191007214813.DzF3ebMT_tHU0J2cJOasaftO8du84amhnq_Rho1E3eM@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).