pico-embedded-swift icon indicating copy to clipboard operation
pico-embedded-swift copied to clipboard

Add linux compatibility

Open libewa opened this issue 1 year ago • 2 comments

This pull request changes the CMakeLists.txt to be compatible with Linux (wip)

  • [x] Add location of swiftc
  • [x] dynamically find swiftc location using something like which swiftc
  • [ ] Use correct target (apparently it is different)
  • [ ] Find out if libraries are compatible
  • [ ] Change README to include installation instructions

libewa avatar Dec 28 '23 11:12 libewa

@libewa Thank you so much for working on this! Unbeknownst to you I had also started on adding Linux support, but I hadn't pushed it yet (sorry!) and it's also not completely finished (e.g. I still need to update the readme).

I just posted a draft PR (#2) with my approach. Maybe we can find a way to take the best parts from both our branches to bring this over the finish line. As far as I can tell, my approach uses fewer platform conditionals (if (APPLE)) because I took the liberty to make a few more changes: I don't think we really need to look at the TOOLCHAINS env var on macOS and it's easier to understand if we ask the user to pass in the path to swiftc directly. What do you think?

I'm surprised you're seeing that you need to use a different target on Linux. I didn't see this in my testing. I'm testing with Docker from my Mac (I don't have a Linux machine) with a Ubuntu 22.04 Swift nightly image (swiftlang/swift:nightly-jammy).

ole avatar Dec 28 '23 19:12 ole

The problem really is that my two Linux computers run Raspbian and NixOS. NixOS doesn't have the armv7 cc, and Raspbian (with the gcc-arm-none-eabi package) apparently uses armv6-none-eabi. At least it didn't crash with that target, and failed on building the Pico SDK instead.

libewa avatar Dec 29 '23 17:12 libewa

@libewa I'm sorry to leave you hanging so long, totally my bad. I'm going to close this now because I'm a very bad maintainer (which I should have made clear from the start). I'm sorry, and thank you for taking the time to contribute.

ole avatar Oct 22 '24 16:10 ole