Skip to content

feat(linux): add cross-platform PlatformIO, terminal, serial, and Linux packaging#1

Open
sunkmechie wants to merge 14 commits into
mandarwagh9:mainfrom
sunkmechie:linux-port
Open

feat(linux): add cross-platform PlatformIO, terminal, serial, and Linux packaging#1
sunkmechie wants to merge 14 commits into
mandarwagh9:mainfrom
sunkmechie:linux-port

Conversation

@sunkmechie
Copy link
Copy Markdown

@sunkmechie sunkmechie commented Apr 19, 2026

What this PR does

This PR introduces a linu-port to Embedist

Changes

  • Made PlatformIO discovery cross-platform by using the user-configured build.platformioPath setting instead of hard-coded Windows paths.
  • Added Linux-friendly PlatformIO installation behavior:
    • manual installs are detected correctly
    • distro-managed Python installs fall back to a local venv when needed (ubuntu prevents distro-managed python installs)
  • Updated the setup wizard to detect Linux and show Linux-specific hints, including a Recheck button for manual installs.
  • Improved Build Settings help text with Linux instructions, including how to point to ~/.platformio/penv/bin/pio.
  • Added Linux packaging support with AppImage and .deb targets.
  • Added a real Linux serial backend and improved serial handling:
    • native serial monitor
    • DTR handling
    • reconnect-after-flash behavior
  • Added Linux terminal support and removed hardcoded Windows shell assumptions where needed.
  • Cleaned up a few small warnings and leftover Windows-only UX strings.
  • Updated docs to reflect cross-platform setup and Linux support.

Validation

  • cargo check passes
  • cargo clippy --manifest-path src-tauri/Cargo.toml passes
  • npm run build passes
  • Tested on Ubuntu 24.04
  • Manual PlatformIO installs are detected properly
  • Native Linux serial reconnect flow works after flashing

Notes / Current limitations

  • Serial Monitor reconnect behavior is implemented, but some boards may still need board-specific sensor or sketch setup depending on the project.
  • The linux icon file is plain red block.
  • Tested on Ubuntu 24.04.4 LTS, with an Arduino Nano 33 BLE Sense board.

@sunkmechie sunkmechie changed the title [WIP / Draft] feat(linux): Harden PlatformIO detection, setup wizard, and path handling for Linux feat(linux): add cross-platform PlatformIO, terminal, serial, and Linux packaging Apr 20, 2026
@sunkmechie sunkmechie marked this pull request as ready for review April 20, 2026 18:07
@sunkmechie
Copy link
Copy Markdown
Author

@mandarwagh9 I’ve ported the project to Linux (tested on Ubuntu 24.04.4 LTS).

Would love to hear you feedback.

@mandarwagh9
Copy link
Copy Markdown
Owner

Thanks for the Linux port work — there is clear value here (PlatformIO path override support, Linux packaging targets, native serial session/reconnect flow, and shell portability).

I did a thorough pass and I’m requesting changes before merge because there are blocking issues:

  1. Windows compile break in this branch
  • cargo check --manifest-path src-tauri/Cargo.toml fails on Windows.
  • In src-tauri/src/commands/platformio.rs, install_platformio() calls Linux-only functions unconditionally:
    • calls at :859 (install_platformio_in_venv) and :885 (platformio_venv_pio)
    • these functions are gated with #[cfg(not(windows))] at :244, :261, :266
  • This currently causes unresolved symbol errors on Windows builds.
  1. No CI signal on the PR branch
  • gh pr checks 1 reports no checks.
  • For a cross-platform runtime PR touching serial/build/terminal/packaging, we need automated checks before merge.

Non-blocking but important follow-ups:

  • package-lock.json still shows 0.37.0 (package-lock.json:3 and :9) while app version is 0.37.1.
  • get-platformio.py includes a large opaque embedded payload (DEPENDENCIES blob at get-platformio.py:23) — please justify in PR notes or move installer payload changes to a separate PR for reviewability.

Once the blockers are fixed, I’d be happy to re-review quickly.

@sunkmechie
Copy link
Copy Markdown
Author

sunkmechie commented Apr 22, 2026

Thanks for the thorough review @mandarwagh9.

  1. I should have cross-checked the Windows build before pushing. The root cause as you already mentioned is indeed the use of cfg!() in install_platform(). Replacing the runtime if !cfg!(windows) guards with compile-time #[cfg(not(windows))] attributes at the two call-sites (:858 and :885) should fix the issue.

  2. I agree. I will add the workflow file.

  3. Regarding get-platformio.py. This is the official PlatformIO bootstrap/installer script included verbatim. The DEPENDENCIES blob is upstream's bundled pip/setuptools wheels, allowing the script to bootstrap PlatformIO into an isolated venv without those packages being pre-installed. On Windows pip install platformio works directly so this script isn't invoked, but on Linux (especially Ubuntu 24.04+ which enforces PEP 668 externally-managed-environment restrictions) direct pip installs are blocked by the distro, this script is how we handle that fallback.

    Happy to add a header comment noting the upstream source and version if that helps reviewability.

I will push the fixes shortly and bump up the version in package-lock.json.

I'm converting the PR to draft in the meantime.

@sunkmechie sunkmechie marked this pull request as draft April 22, 2026 18:27
@sunkmechie sunkmechie marked this pull request as ready for review April 24, 2026 14:38
@sunkmechie
Copy link
Copy Markdown
Author

Hey, @mandarwagh9

I have made the requested changes and also added a workflow file. I don't have a windows machine so I'm unable to verify the windows side.

Would love to here your thoughts and the CI check run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants