View Issue Details

IDProjectCategoryView StatusLast Update
0000163file[All Projects] Generalpublic2020-05-31 00:11
ReporterpombredanneAssigned Tochristos 
PrioritynormalSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.38 
Target VersionFixed in Version 
Summary0000163: Build fails on mingw64
DescriptionWhen trying to update the msys2.org package for file to 5.38, the build fails
See the PR at https://github.com/msys2/MINGW-packages/pull/6495 and in particular the build log at https://dev.azure.com/msys2/mingw/_build/results?buildId=5178&view=logs&jobId=d025390b-1dd2-5eea-69df-6ceb0b9eeced&j=d025390b-1dd2-5eea-69df-6ceb0b9eeced&t=7bf27dc4-4036-5dcd-5905-ed58d9f24e1f

I have also attached a local build log from running this in a Windows VM
TagsNo tags attached.

Activities

pombredanne

2020-05-19 13:48

reporter  

mingw-w64-file-5.38-1-x86_64-build.log (39,979 bytes)

pombredanne

2020-05-19 13:51

reporter   ~0003406

Note that 5.37 builds and runs fine

pombredanne

2020-05-19 21:51

reporter   ~0003407

Here is a likely patch solving the problem. I am testing this now:

diff --git a/src/compress.c b/src/compress.c
index 904c215..c82e84b 100644
--- a/src/compress.c
+++ b/src/compress.c
@@ -380,7 +380,7 @@
 sread(int fd, void *buf, size_t n, int canbepipe __attribute__((__unused__)))
 {
    ssize_t rv;
-#ifdef FIONREAD
+#ifdef FIONREAD && !defined(__MINGW32__) && !defined(WIN32)
    int t = 0;
 #endif
    size_t rn = n;
@@ -388,7 +388,7 @@
    if (fd == STDIN_FILENO)
        goto nocheck;
 
-#ifdef FIONREAD
+#ifdef FIONREAD && !defined(__MINGW32__) && !defined(WIN32)
    if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
 #ifdef FD_ZERO
        ssize_t cnt;

pombredanne

2020-05-20 08:32

reporter   ~0003408

Actually this patch is wrong all the way. Ignore that

pombredanne

2020-05-20 10:59

reporter   ~0003409

This patch is working and all tests pass on msys2. I am crafting a packaging patch too.

diff --git a/src/compress.c b/src/compress.c
index 904c215..a5fdbb0 100644
--- a/src/compress.c
+++ b/src/compress.c
@@ -380,7 +380,7 @@
 sread(int fd, void *buf, size_t n, int canbepipe __attribute__((__unused__)))
 {
     ssize_t rv;
-#ifdef FIONREAD
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
     int t = 0;
 #endif
     size_t rn = n;
@@ -388,7 +388,7 @@
     if (fd == STDIN_FILENO)
         goto nocheck;
 
-#ifdef FIONREAD
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
     if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
 #ifdef FD_ZERO
         ssize_t cnt;

pombredanne

2020-05-20 11:54

reporter   ~0003410

FWIW the PR at https://github.com/msys2/MINGW-packages/pull/6495 and all tests now pass on win32 and win64 when built with msys2

pombredanne

2020-05-20 15:57

reporter   ~0003411

And FYI that PR has been accepted and merged there https://github.com/msys2/MINGW-packages/pull/6495

christos

2020-05-31 00:11

manager   ~0003419

Can you try what I commited in compress.c and file.h just now?
/p/file/cvsroot/file/src/compress.c,v <-- compress.c
new revision: 1.127; previous revision: 1.126
/p/file/cvsroot/file/src/file.h,v <-- file.h
new revision: 1.217; previous revision: 1.216

Issue History

Date Modified Username Field Change
2020-05-19 13:48 pombredanne New Issue
2020-05-19 13:48 pombredanne File Added: mingw-w64-file-5.38-1-x86_64-build.log
2020-05-19 13:51 pombredanne Note Added: 0003406
2020-05-19 21:51 pombredanne Note Added: 0003407
2020-05-20 08:32 pombredanne Note Added: 0003408
2020-05-20 10:59 pombredanne Note Added: 0003409
2020-05-20 11:54 pombredanne Note Added: 0003410
2020-05-20 15:57 pombredanne Note Added: 0003411
2020-05-31 00:11 christos Assigned To => christos
2020-05-31 00:11 christos Status new => assigned
2020-05-31 00:11 christos Status assigned => feedback
2020-05-31 00:11 christos Note Added: 0003419