Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arm32][5.0] swiftpm/Sources/SPMUtility/FSWatch.swift:444:19: error: cannot assign value of type '(Int, Int, Int , Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' #41

Open
uraimo opened this issue Mar 31, 2019 · 1 comment

Comments

@uraimo
Copy link
Owner

uraimo commented Mar 31, 2019

Compiling Swift Module 'Basic' (38 sources)
Linking PackageDescription4
Linking Basic
Compiling Swift Module 'SPMUtility' (20 sources)
/mnt/buildSwiftOnARM/swiftpm/Sources/SPMUtility/FSWatch.swift:444:19: error: cannot assign value of type '(Int, Int, Int
, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask
, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mas
k, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_ma
sk, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, In
t, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- bootstrap: error: build failed with exit status 1
./swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
@uraimo uraimo added the 5.0 label Mar 31, 2019
@uraimo
Copy link
Owner Author

uraimo commented Mar 31, 2019

Since we don't have glibc shims for some of the FD_ function declared in sys/select.h, those have been redeclared in FSWatch.swift.
On Linux, this is the set of defines that create the fd_set structure:

typedef long int __fd_mask;

/* Some versions of <linux/posix_types.h> define this macros.  */
#undef  __NFDBITS
/* It's easier to assume 8-bit bytes than to get CHAR_BIT.  */
#define __NFDBITS       (8 * (int) sizeof (__fd_mask))
#define __FD_MASK(d)    ((__fd_mask) (1UL << ((d) % __NFDBITS)))

#define      __FD_SETSIZE            1024  //Defined elsewhere.

/* fd_set for select and pselect.  */
typedef struct
  {
    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
  } fd_set;

I wouldn't be surprised if __FD_SETSIZE had another value on a different platform.

Edit: On arm32 the overall size of the struct is the same but the slot are only 32bits long now, increasing the number of slots to 32 as reported by the error.
While the patch added here will include an ifdef for arm32, the easier solution to this would be to ad the required function to the glibc shim (probably the actual fix I will propose to swiftpm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant