HipsterBrown / xs-dev

The quickest way for getting started with JS on devices
https://xs-dev.js.org
MIT License
41 stars 13 forks source link

Extra step on installing ESP32 SDK with xs-dev #96

Closed rei-vilo closed 1 year ago

rei-vilo commented 1 year ago

Installing the ESP32 SDK through xs-dev setup --device=esp32 requires an extra step.

Environment is a MacBook Air M1 2020 running on macOS 13.1 (22C65).

⠧ Installing esp-idf tooling
All done! You can now run:

  . ./export.sh

✔ Installing esp-idf tooling
ℹ Sourcing esp-idf environment
✔ 
  Successfully set up esp32 platform support for Moddable!
  Test out the setup by starting a new terminal session, plugging in your device, and running: xs-dev run --example helloworld --device=esp32
  If there is trouble finding the correct port, pass the "--port" flag to the above command with the path to the /dev.cu.* that matches your device.

Problem is, the correct folder for running . ./export.sh is not mentioned .

Correct procedure is

cd /Users/USER/.local/share/esp32/esp-idf
. ./export.sh

Could xs-dev manage this extra step?

Thank you!

HipsterBrown commented 1 year ago

@rei-vilo I understand the question, so thank you for creating an issue. xs-dev does take care of this for you already through its own "exports" file that it adds to your shell profile setup. You can find that file at ~/.local/share/xs-dev-exports.sh if you're on Linux or MacOS, or at $HOME\xs-dev\Moddable.bat on Windows. This is why the last line from the setup output includes "Test out the setup by starting a new terminal session".

xs-dev should probably silence that output from the ESP32 SDK setup unless verbose logging is enabled to avoid this confusion in the future. I will also make sure this is pointed out in the documentation.

phoddie commented 1 year ago

FWIW – Moddable SDK 3.5.0 and later takes care of that step automatically. That's mentioned in the release notes:

ESP32 builds in environments that have not sourced $IDF_PATH/exports.sh now automatically source it

That should eliminate the need for xs-dev to perform this step.

rei-vilo commented 1 year ago

Thank you for your answers.

It is a good idea to silence the installer, as there is (too) much documentation to read!