From 3bd0232bb9fbfbf39cadbf6f6ba2cee743bf9273 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 31 Dec 2020 03:06:51 -0500 Subject: [PATCH] Add a patch to fix big-endian test results. --- 0001-Unbundle-libxxhash.patch | 2 +- ...-test-hashes-for-big-endian-machines.patch | 32 +++++++++++++++++++ R-rlang.spec | 3 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0002-Add-test-hashes-for-big-endian-machines.patch diff --git a/0001-Unbundle-libxxhash.patch b/0001-Unbundle-libxxhash.patch index f020a45..d84b834 100644 --- a/0001-Unbundle-libxxhash.patch +++ b/0001-Unbundle-libxxhash.patch @@ -1,7 +1,7 @@ From 1890689ab03ed9cfdc193501c0fc48cb0bab339b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 30 Dec 2020 20:07:56 -0500 -Subject: [PATCH] Unbundle libxxhash. +Subject: [PATCH 1/2] Unbundle libxxhash. Signed-off-by: Elliott Sales de Andrade --- diff --git a/0002-Add-test-hashes-for-big-endian-machines.patch b/0002-Add-test-hashes-for-big-endian-machines.patch new file mode 100644 index 0000000..792a96a --- /dev/null +++ b/0002-Add-test-hashes-for-big-endian-machines.patch @@ -0,0 +1,32 @@ +From 5feac2b6b427905cdb73dc947973aabfdb825f0d Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Thu, 31 Dec 2020 02:45:14 -0500 +Subject: [PATCH 2/2] Add test hashes for big-endian machines. + +Signed-off-by: Elliott Sales de Andrade +--- + tests/testthat/test-hash.R | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/tests/testthat/test-hash.R b/tests/testthat/test-hash.R +index c43c82ba..fb74d14c 100644 +--- a/tests/testthat/test-hash.R ++++ b/tests/testthat/test-hash.R +@@ -1,5 +1,11 @@ + test_that("simple hashes with no ALTREP and no attributes are reproducible", { +- expect_identical(hash(1), "a3f7d4a39b65b170005aafbbeed05106") +- expect_identical(hash("a"), "4d52a7da68952b85f039e85a90f9bbd2") +- expect_identical(hash(1:5 + 0L), "0d26bf75943b8e13c080c6bab12a7440") ++ if (.Platform$endian == "little") { ++ expect_identical(hash(1), "a3f7d4a39b65b170005aafbbeed05106") ++ expect_identical(hash("a"), "4d52a7da68952b85f039e85a90f9bbd2") ++ expect_identical(hash(1:5 + 0L), "0d26bf75943b8e13c080c6bab12a7440") ++ } else { ++ expect_identical(hash(1), "e102171758b6df27bab06e4b99ad7d61") ++ expect_identical(hash("a"), "49a20bac2e944a3b87d0f5f70b8b5553") ++ expect_identical(hash(1:5 + 0L), "f24b071216a7d95ccbfcf28616107d64") ++ } + }) +-- +2.29.2 + diff --git a/R-rlang.spec b/R-rlang.spec index c70fdc2..ba00722 100644 --- a/R-rlang.spec +++ b/R-rlang.spec @@ -14,6 +14,8 @@ License: MIT URL: https://CRAN.R-project.org/package=%{packname} Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz Patch0001: 0001-Unbundle-libxxhash.patch +# https://github.com/r-lib/rlang/pull/1084 +Patch0002: 0002-Add-test-hashes-for-big-endian-machines.patch # Here's the R view of the dependencies world: # Depends: @@ -50,6 +52,7 @@ system, and core 'Tidyverse' features like tidy evaluation. pushd %{packname} %patch0001 -p1 +%patch0002 -p1 # Don't need coverage; it's not packaged either. sed -i 's/covr, //g' DESCRIPTION