Add workaround for libuv bug.

See https://github.com/libuv/libuv/issues/2262.
This commit is contained in:
Elliott Sales de Andrade 2019-05-05 14:36:41 -04:00
parent b13a4802f3
commit c9e60472ae
3 changed files with 34 additions and 2 deletions

View File

@ -1,7 +1,7 @@
From 6d955f0b1bd13364dcffffd73018e8681d399a1e Mon Sep 17 00:00:00 2001
From e7c9a2edc8cbb53d4f77d6e5e19de2570f7c74a8 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 22 Sep 2018 23:50:25 -0400
Subject: [PATCH] Use system libuv.
Subject: [PATCH 1/2] Use system libuv.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---

View File

@ -0,0 +1,27 @@
From a1395f74ccd62dadbac234ac27849a53f4c0ce81 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 5 May 2019 14:21:57 -0400
Subject: [PATCH 2/2] Initialize stat buf to be zero.
This works around https://github.com/libuv/libuv/issues/2262.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
src/file.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/file.cc b/src/file.cc
index ed017e8f..184094fa 100644
--- a/src/file.cc
+++ b/src/file.cc
@@ -148,6 +148,7 @@ List stat_(CharacterVector path, bool fail) {
for (i = 0; i < Rf_xlength(path); ++i) {
uv_fs_t req;
const char* p = CHAR(STRING_ELT(path, i));
+ memset(&req, 0, sizeof(req));
int res = uv_fs_lstat(uv_default_loop(), &req, p, NULL);
bool is_na = STRING_ELT(path, i) == NA_STRING;
--
2.20.1

View File

@ -9,7 +9,10 @@ Summary: Cross-Platform File System Operations Based on 'libuv'
License: GPLv3
URL: https://CRAN.R-project.org/package=%{packname}
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz
# Fedora-specific.
Patch0001: 0001-Use-system-libuv.patch
# Workaround for https://github.com/libuv/libuv/issues/2262
Patch0002: 0002-Initialize-stat-buf-to-be-zero.patch
# Here's the R view of the dependencies world:
# Depends:
@ -51,6 +54,8 @@ pushd %{packname}
rm -rf src/libuv
sed -i -e '/libuv/d' MD5
%patch0002 -p1
# Don't need coverage; it's not packaged either.
sed -i 's/, covr//g' DESCRIPTION
popd