Code Monkey home page Code Monkey logo

Comments (7)

johnsonjh avatar johnsonjh commented on July 18, 2024

AIX build is failing with the same error.

from libuv.

johnsonjh avatar johnsonjh commented on July 18, 2024

Must be a change within the last 60 days or so, I haven't yet bisected it. Reverting my application CI build processes to use the last released libuv (1.48.0) is a successful workaround for now.

from libuv.

johnsonjh avatar johnsonjh commented on July 18, 2024

Did a git bisect, the bad commit is the one 3 days ago:

commit bf61390769068de603e6deec8e16623efcbe761a (HEAD -> v1.x, origin/v1.x, origin/HEAD)
Author: Juan José Arboleda <[email protected]>                                     
Date:   Wed May 8 04:30:30 2024 -0500                                                   
                                                                                        
    linux,darwin: make `uv_fs_copyfile` behaves like `cp -r` (#4396)                    
                                                                                        
    This commit changes the timestamps in the file, the ownership and the               
    group.                                                                              
                                                                                        
    Fixes: https://github.com/libuv/libuv/issues/3125                                   
                                                                                        
    Signed-off-by: Juan José Arboleda <[email protected]>                          

from libuv.

saghul avatar saghul commented on July 18, 2024

Ping @juanarbol

from libuv.

johnsonjh avatar johnsonjh commented on July 18, 2024

I'll remove NetBSD from this issue for now, I think that was a local configuration error, so I will open a separate issue if needed when I have more information.

The AIX, the error messages are:

src/unix/fs.c: In function 'uv__fs_copyfile':
src/unix/fs.c:1321:14: error: incompatible types when assigning to type 'struct timespec' from type 'st_timespec_t' {aka 'struct st_timespec'}
 1321 |   times[0] = src_statsbuf.st_atim;
      |              ^~~~~~~~~~~~
src/unix/fs.c:1322:14: error: incompatible types when assigning to type 'struct timespec' from type 'st_timespec_t' {aka 'struct st_timespec'}
 1322 |   times[1] = src_statsbuf.st_mtim;
      |              ^~~~~~~~~~~~

I had a bit of time to look into the problem.

From the AIX stat.h header:

#if _XOPEN_SOURCE>=700                                                
#ifdef _ALL_SOURCE                                                    
        st_timespec_t st_atim;  /* Time of last access  */            
        st_timespec_t st_mtim;  /* Time of last data modification */  
        st_timespec_t st_ctim;  /* Time of last file status change */ 
#else                                                                 
        struct timespec st_atim;/* Time of last access  */            
        struct timespec st_mtim;/* Time of last data modification */  
        struct timespec st_ctim;/* Time of last file status change */ 
#endif                                                                
#else                                                                 
        time_t  st_atime;       /* Time of last access */             
        int     st_atime_n;                                           
        time_t  st_mtime;       /* Time of last data modification */  
        int     st_mtime_n;                                           
        time_t  st_ctime;       /* Time of last file status change */ 
        int     st_ctime_n;                                           
#endif                                                                

A quick check shows that _ALL_SOURCE is defined, and that configure will always define it unconditionally, although I am not an autoconf expert.

The following patch seems to be sufficient:

diff --git a/src/unix/fs.c b/src/unix/fs.c
index 0c6c585c..7a2ce054 100644
--- a/src/unix/fs.c
+++ b/src/unix/fs.c
@@ -1226,21 +1226,25 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
   return r;
 }
 
 
 static ssize_t uv__fs_copyfile(uv_fs_t* req) {
   uv_fs_t fs_req;
   uv_file srcfd;
   uv_file dstfd;
   struct stat src_statsbuf;
   struct stat dst_statsbuf;
+#if defined(_AIX) && _XOPEN_SOURCE>=700 && defined(_ALL_SOURCE)
+  st_timespec_t times[2];
+#else
   struct timespec times[2];
+#endif
   int dst_flags;
   int result;
   int err;
   off_t bytes_to_send;
   off_t in_offset;
   off_t bytes_written;
   size_t bytes_chunk;
 
   dstfd = -1;
   err = 0;

@juanarbol @saghul

from libuv.

johnsonjh avatar johnsonjh commented on July 18, 2024

I just tested on OS/400 (PASE for IBM i 7.5, GCC 10.5.0, powerpc-ibm-os400) - it was broken in the same way, so I've updated the title again. The patch above works there also.

from libuv.

juanarbol avatar juanarbol commented on July 18, 2024

Oopsie. I will be participating in #4404

from libuv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.