vapor-community / sockets

🔌 Non-blocking TCP socket layer, with event-driven server and client.
MIT License
575 stars 54 forks source link

Failure to compile on Raspberry Pi #96

Closed rvsrvs closed 6 years ago

rvsrvs commented 7 years ago

FD_ZERO is apparently defined as 32 bytes on an R/Pi 3:

uname -a
Linux ubuntu 4.4.0-1029-raspi2 #36-Ubuntu SMP Wed Oct 19 14:38:48 UTC 2016 armv7l armv7l armv7l GNU/Linux

I get the following compile error on an R/Pi 3 running latest version of ubuntu:

swift build
Cloning https://github.com/czechboy0/Redbird.git
HEAD is now at bb2ac0e Updated Swift to 08-15 (#38)
Resolved version: 0.10.0
Cloning https://github.com/czechboy0/Socks.git
HEAD is now at 460dc7f Merge pull request #73 from vapor/gm
Resolved version: 0.12.2
Compile Swift Module 'SocksCore' (14 sources)
/home/ubuntu/BlueCycles/linux/Packages/Socks-0.12.2/Sources/SocksCore/FDSet.swift:34:20: 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_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_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, 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)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): /usr/bin/swift-build-tool -f /home/ubuntu/BlueCycles/linux/.build/debug.yaml
BrettRToomey commented 7 years ago

Closing due to inactivity. Please feel free to reopen.

cscis65g commented 7 years ago

Ok, will try it on the latest builds. Doesn't seem that it's been addressed though.

vzsg commented 7 years ago

This is still happening with Sockets 2.0.1. I'll investigate it.

vzsg commented 7 years ago

The #arch(arm) directive apparently returns false on the Pi. Perhaps the arm name is wrong for armv7l? Will give it a try at home.

vzsg commented 7 years ago

Okay, I couldn't reproduce this with my Pi 3, Ubuntu MATE 16.10, clang 3.8 and Swift 3.1.1... Worked out of the box.

Gonna need some input on the problematic environments.

luisdelarosa commented 6 years ago

Verified that Sockets 2.1 compiles (swift build) and all tests pass (swift test) on Raspberry Pi 3 Model B, Ubuntu MATE 16.04.2, clang 3.8.0-2ubuntu4 and swift 3.1.1. FWIW, my uname -a returns (where mario is my hostname):

uname -a
Linux mario 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux