uraimo / buildSwiftOnARM

All you need to build Swift on a RaspberryPi or other ARM boards, updated to Swift 5.1.5
489 stars 37 forks source link

Building 3.1+ on Raspbian - # noqa (E402) ImportError: cannot import name diagnostics #2

Closed scottbyrns closed 7 years ago

scottbyrns commented 7 years ago

`pi@raspberrypi:~/buildSwiftOnARM-master $ sudo ./build.sh Traceback (most recent call last): File "./swift/utils/build-script", line 27, in from SwiftBuildSupport import ( File "/home/pi/buildSwiftOnARM-master/swift/utils/SwiftBuildSupport.py", line 26, in from swift_build_support import diagnostics # noqa (E402) ImportError: cannot import name diagnostics

carlhung commented 7 years ago

if you type "cat clone.sh" you can see the script will download the components and update the components. the problem is when you were downloading the components or update. it bloody dropped connection all the time last night. i was trying to download the components and update for whole bloody day. and dropped the connection more than 20 times. that's why build.sh can't find the files when you built. so make sure you download and update all the components successfully. I just successfully downloaded all the files that need to build. now I can see build.sh using cmake to build swift. in order to see if you successfully download all the files. install "screen" to keep tracking it. everything you need is about 139GB. I used my laptop to download and update the components as it is faster and copied to my pi to build.

scottbyrns commented 7 years ago

That doesn't seem to be the cause for my issue. It doesn't have any problems cloning the repos.

It looks like it might not be applying the diff's that it places parallel to the repos. Investigating still.

carlhung commented 7 years ago

I also encountered different error while compiling clang. wasted me so much time.

uraimo commented 7 years ago

Hi @scottbyrns , yes that happens when compiling 3.1 on Raspbian.

This was fixed by @helje5 patching build-script as show here, so it's not a dependency issue (btw, it could be already fixed in master, we'll see when 4.0 lands).

I don't have a normal patch I can give you right now since after that issue there is a blocking error (see #4) that has not been resolved yet and that I'm currently trying to debug (the repo not in a diffable state).

At the moment 3.1 compiles only on Ubuntu Mate, if you want to compile something cleanly on Raspbian you'll need to check out the 3.0.2 tag.

I'd recommend you to use Ubuntu if you can, since it's the only release that has a working SPM.

uraimo commented 7 years ago

@scottybyrns, this is the patch for noqa E402: f35d8d80de3770aaa9b6da60fabd4e8bffa2b621

I've added it to the repo, but it needs to be applied manually since it's not normally needed on Mate, it could be needed on some Ubuntu (e.g. Core)

Btw, compiling 3.1+ still doesn't work on Raspbian, once you reach swift/ you'll still run into issue #4 .