Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update windows installer #2859

Merged
merged 12 commits into from
Jul 14, 2024
Merged

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jul 13, 2024

The Windows installer makes use of custom chocolatey packages, which are out of date. See issue #2514.
These packages are separate from the main Sming repository and represent an un-necessary maintenance overhead.

This PR updates the installation scripts so these custom chocolatey packages are no longer required.
The scripts were previously only used for CI testing so have been reworked appropriately.
The installation procedure is now similar to that for linux/MacOS.

The initial bootstrap installation remains unchanged: The choco-install.cmd script is fetched from the Sming develop branch and executed.

Note: Contrary to other installs and the documentation, the current sming choco script installs the master branch.

The user runs a second install script tools\install to install required toolchains.
This is separate because:

  • Administrative priviledges are not required
  • The user gets more control over which toolchains get installed
  • The script doesn't change anything outside of the C:\tools directory (other than python packages)

The directory can also be customised by setting SMING_TOOLS_DIR.

The documentation at https://sming.readthedocs.io/en/latest/getting-started/windows/index.html has been updated to reflect these changes.

CI Compiler Cache

I've moved caching to just before the build starts, so that configuration and zeroing ccache is handled by the build script. This is more logical than doing it as part of the install phase.

Esp32 install/build

A standard IDF tools installation includes the following packages:

  • cmake
  • ninja
  • ccache

As Sming installs these system-wide, these are not required.
Also, as we now have Ninja in the system path for all platforms some logic in build.mk can be removed.

These additional items are not used:

  • idf-exe
  • dfu-util

The Sming Esp32 installer omits all the above items, for linux/MacOS also.
Turns out we can just pass the filter "*elf*" to the installer to get all the stuff we do actually need.

Python

This defaulted to python3, which failed in testing as current installers don't provide it, so change to python.

The PYTHON variable now defaults to the full path determined by which python. In Windows, the makefile resolves this to something like /c/Python312/python.exe.

MinGW

I've also added MinGW-2021-04-12.7z to the SmingTools.
This differs from MinGW-2020-10-19.7z which was previously used (in both choco package and CI install) in the following ways:

  • MinGW version changed from 5.4.1 to 5.4.2
  • Files unpack into ./ instead of MinGw/ so makes it easier to relocate during installation if required
  • Contents of var/cache removed to reduce size of archive (48MB vs 133MB)

No changes to GCC, still 9.2.0.

Docs build

Documentation build fails in Windows, problems with libcairo-2.dll.
Initially, the error was about not finding the DLL.
Some reserach suggests installing gtk+ runtime should fix this.
Still fails but with error "can't find .so".

Leaving this as a known issue, just build in Linux or WSL.

Todo:

  • Check library CI builds still work

mikee47 added 10 commits July 12, 2024 13:27
Installing gtk+ runtime should fix this. Without it, cannot find the above library. With it, fails with "can't find .so"
Can filter required tools with `*esp* openocd`

esp32 can use standard cmake, ninja installations
Reduces makefile complexity
Reasons:
- Install could fail, in which case it's wasted effort
- It's the more logical place to do it, but moving it requires updating the install scripts so best to do it now
- ccache stats must be zeroed just before build. Doing this as part of install confuses the issue and could get missed
- ccache must be configured only after its been restored
@mikee47 mikee47 force-pushed the feature/windows-install branch from 93437cf to dd86632 Compare July 13, 2024 21:12
@mikee47 mikee47 requested a review from slaff July 14, 2024 05:40
@mikee47
Copy link
Contributor Author

mikee47 commented Jul 14, 2024

Note: This PR invalidates ccache information because the timestamp on mingw GCC compiler has changed (even though content hasn't). Also, Esp32 IDF on Windows is now installed in a versioned directory (e.g. C:\tools\esp-idf-5.2) with junction (link) C:\tools\esp-idf as for linux/MacOS.

Before merging to develop, should wipe all the caches so they get rebuilt.

@slaff slaff added this to the 5.2.0 milestone Jul 14, 2024
@slaff slaff merged commit fd165a5 into SmingHub:develop Jul 14, 2024
46 checks passed
@mikee47 mikee47 deleted the feature/windows-install branch July 14, 2024 19:10
@mikee47
Copy link
Contributor Author

mikee47 commented Jul 15, 2024

@slaff I broke the installer for esp32 IDF (all platforms) as only the IDF 5.2 supports wildcards. Will have a fix later today.

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