Skip to content

Commit

Permalink
remove default support for esp32
Browse files Browse the repository at this point in the history
The esp32 core is too complex to maintain for the benefit of having
it. It

* uses xtensa-esp32-elf-gcc, which has a bunch of non-static binaries
* requires Python with specific libraries installed
* is a big download

It should still be possible to use this core provided you set up your
environment correctly and use the correct customization options.
  • Loading branch information
RyanTM (Pololu) committed Dec 16, 2020
1 parent 2ed58cd commit 68512ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ ci:

All examples in your library are compiled with the following boards by default:

* esp32:esp32:featheresp32
* esp8266:esp8266:huzzah
* arduino:avr:leonardo
* arduino:avr:mega
Expand Down
13 changes: 1 addition & 12 deletions ci.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=channel:nixos-20.09 -i ruby -p patchelf ruby arduino-cli "python3.withPackages(ps: [ ps.pyserial ])"
#!nix-shell -I nixpkgs=channel:nixos-20.09 -i ruby -p ruby arduino-cli python3

class String
def red; "\e[31m#{self}\e[0m" end
Expand All @@ -15,7 +15,6 @@ def magenta; "\e[35m#{self}\e[0m" end
end

boards = %w(
esp32:esp32:featheresp32
esp8266:esp8266:huzzah
arduino:avr:leonardo
arduino:avr:mega
Expand All @@ -38,7 +37,6 @@ def magenta; "\e[35m#{self}\e[0m" end

additional_urls = []
additional_urls << "https://arduino.esp8266.com/stable/package_esp8266com_index.json" if cores.include? "esp8266:esp8266"
additional_urls << "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" if cores.include? "esp32:esp32"
additional_urls -= (config["skip_additional_urls"] || [])
additional_urls -= (ENV["ARDUINO_CI_SKIP_ADDITIONAL_URLS"]&.split(',') || [])
additional_urls += (config["add_additional_urls"] || [])
Expand All @@ -49,15 +47,6 @@ def magenta; "\e[35m#{self}\e[0m" end
system("arduino-cli core update-index --additional-urls=\"#{additional_urls.join(",")}\"")
system("arduino-cli core install --additional-urls=\"#{additional_urls.join(",")}\" #{cores.join(" ")}")

if cores.include? "esp32:esp32"
# Fixup esp32 dynamically-linked binaries
zlib = `nix-build -I nixpkgs=channel:nixos-20.09 --no-out-link -E '(import <nixpkgs> {}).zlib'`.chomp
cpplib = `nix-build -I nixpkgs=channel:nixos-20.09 --no-out-link -E '(import <nixpkgs> {}).stdenv.cc.cc.lib'`.chomp
Dir.glob("#{Dir.home}/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/*/bin/*").each do |bin|
system "patchelf --set-interpreter \"$(< \"$NIX_CC/nix-support/dynamic-linker\")\" --add-needed #{zlib}/lib/libz.so --add-needed #{cpplib}/lib/libstdc++.so.6 #{bin}"
end
end

env="ARDUINO_DIRECTORIES_USER=\"$PWD/out\""
lib = "$PWD/out/libraries"
`rm -rf "#{lib}"`
Expand Down

0 comments on commit 68512ac

Please sign in to comment.