Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] firefox-esr: add patch for cssparser
@ 2019-10-12 18:29 voidlinux-github
  2019-10-14 16:45 ` [PR PATCH] [Merged]: " voidlinux-github
  0 siblings, 1 reply; 2+ messages in thread
From: voidlinux-github @ 2019-10-12 18:29 UTC (permalink / raw)
  To: ml

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

There is a new pull request by jnbr against master on the void-packages repository

https://github.com/jnbr/void-packages ff-esr
https://github.com/void-linux/void-packages/pull/15402

firefox-esr: add patch for cssparser
@Piraty 

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

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

From 3e3839a9925b007b9950396e2023271b315aea9b Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 12 Oct 2019 20:28:26 +0200
Subject: [PATCH] firefox-esr: add patch for cssparser

[ci skip]
---
 .../firefox-esr/patches/rust-cssparser.patch  | 90 +++++++++++++++++++
 srcpkgs/firefox-esr/template                  | 12 +++
 2 files changed, 102 insertions(+)
 create mode 100644 srcpkgs/firefox-esr/patches/rust-cssparser.patch

diff --git a/srcpkgs/firefox-esr/patches/rust-cssparser.patch b/srcpkgs/firefox-esr/patches/rust-cssparser.patch
new file mode 100644
index 00000000000..1ebef87c014
--- /dev/null
+++ b/srcpkgs/firefox-esr/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/firefox-esr/template b/srcpkgs/firefox-esr/template
index 829eb017622..8f1c983c8b4 100644
--- a/srcpkgs/firefox-esr/template
+++ b/srcpkgs/firefox-esr/template
@@ -38,6 +38,13 @@ case $XBPS_TARGET_MACHINE in
 	ppc*) broken="ftbfs in several places" ;;
 esac
 
+# 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)
@@ -53,6 +60,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() {
 	cp "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig"
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: firefox-esr: add patch for cssparser
  2019-10-12 18:29 [PR PATCH] firefox-esr: add patch for cssparser voidlinux-github
@ 2019-10-14 16:45 ` voidlinux-github
  0 siblings, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2019-10-14 16:45 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

firefox-esr: add patch for cssparser
https://github.com/void-linux/void-packages/pull/15402

Description:
@Piraty 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-14 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-12 18:29 [PR PATCH] firefox-esr: add patch for cssparser voidlinux-github
2019-10-14 16:45 ` [PR PATCH] [Merged]: " voidlinux-github

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).