Illegal instruction 4 after adding Postgres in Mic Pringles RWDEVCON 17 session 22 demo 2

After adding Postgres-StORM and building the project end up with a Illegal instruction: 4 after message Resolving https://github.com/PerfectlySoft/Perfect-PostgresSQL.git at 2.0.2. Redid project with same result. Xcode is 8.3.2. Any workaround to this ?

You haven’t included a huge amount of detail about the error, but the most relevant thing I can find for illegal instruction 4 is that you might have the minimum OS level set incorrectly. If you set it to the very latest then you can get a more optimised or smaller binary, but then if you run it on an earlier version it can crash. The downside to supporting every OS since the dawn of time can be poorer performance or binaries including executables for multiple architectures and versions, which can mean they become huge®.

Thanks for responding - the background to this is I was following along with one of the sessions by Mic Pringle from RWDEVCON - session 22 and there is a step (P433) where he replaces sqlite in the app with postgres by introducing the package Postgres-StORM form github. The illegal error occurs when I regenerate the xcode project with swift package generate-xcodeproj.


See attached image.
Can you advise where the setting for minimum OS level is ?

Just to clarify - in case this is relevant - this is a server side swift app using Perfect

Right, that changes things somewhat. How did you install Swift and on what environment? On Ubuntu I needed to install quite a laundry list of stuff with apt-get to have Kitura begin working as it should, as a Swift app.

Yes turns out to be dependencies on the Mac that were needed. I am guessing but I suspect that the reason is the instructor already had these from previous projects and therefore didn’t get any errors. For the record the resolution was - install homebrew - then used that to install libxml , then curl and finally postgresql.
Regenerating the xcodeproj allowed me to complete the project.

Fair enough. I know that with tutorials on the web site the tech editor needs to start with a vanilla environment to make sure that any issues like this can’t get through but maybe the entire macOS is something you wouldn’t think of doing. Glad to know it is working now.