Skip to content

esphome: fix compilation for esp-idf framework devices - #451760

Merged
mweinelt merged 1 commit into
NixOS:masterfrom
thanegill:esphome-kconfiglib
Nov 13, 2025
Merged

mweinelt merged 1 commit into
NixOS:masterfrom
thanegill:esphome-kconfiglib

Conversation

@thanegill

@thanegill thanegill commented Oct 13, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #442676.

WIP: Adds nixosTests to check compilation in the future. Continued in #461102

Other changes:

  • Update meta.description
  • Use same python dependency everywhere
  • Removes dependencies:
    • python3.pkgs.requests
    • python3.pkgs.protobuf
    • python3.pkgs.packaging
    • python3.pkgs.kconfiglib
    • inetutils

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Oct 13, 2025
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
@thanegill
thanegill force-pushed the esphome-kconfiglib branch 4 times, most recently from 9d5239a to ee25196 Compare October 13, 2025 19:56
@thanegill
thanegill requested a review from dotlambda October 13, 2025 20:03
Comment thread pkgs/by-name/es/esphome/package.nix Resolved
@dotlambda

Copy link
Copy Markdown
Member

Please follow the commit conventions.

@astro

astro commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

This fixes the build indeed but could you please split this PR into multiple commits, or even separate PRs?

@polyfloyd

Copy link
Copy Markdown
Contributor

Can I provide any help with this? I am happy to get my hands dirty to have Esphome working again :)

@thanegill

thanegill commented Nov 6, 2025 •

Copy link
Copy Markdown
Contributor Author

Please follow the commit conventions.

@dotlambda Fixed.

@thanegill

Copy link
Copy Markdown
Contributor Author

This fixes the build indeed but could you please split this PR into multiple commits, or even separate PRs?

Not sure that it totally does fix the issue. I'm still having issues with the nixos/tests/esphome for the test-esp32-arduino.yaml.

This PR is in multiple commits, how would you have me split it?

@thanegill

Copy link
Copy Markdown
Contributor Author

Can I provide any help with this? I am happy to get my hands dirty to have Esphome working again :)

You sure can! I'd like to get a nixosTest that covers what esphome does in this integration test, but in the same systemd environment that the esphome-dashboard is run in. There's seems to be some esphome device compile errors that are specific to running in the systemd environment, such as #339557.

@thanegill
thanegill requested a review from dotlambda November 6, 2025 01:02
@thanegill
thanegill force-pushed the esphome-kconfiglib branch 2 times, most recently from 45b9f4e to 9ee5106 Compare November 6, 2025 01:08
@polyfloyd

Copy link
Copy Markdown
Contributor

Getting a build failure still:

       Last 25 log lines:
       > adding 'esphome/dashboard/status/mqtt.py'
       > adding 'esphome/dashboard/status/ping.py'
       > adding 'esphome/dashboard/util/__init__.py'
       > adding 'esphome/dashboard/util/itertools.py'
       > adding 'esphome/dashboard/util/password.py'
       > adding 'esphome/dashboard/util/subprocess.py'
       > adding 'esphome/dashboard/util/text.py'
       > adding 'esphome-2025.10.4.dist-info/licenses/LICENSE'
       > adding 'esphome-2025.10.4.dist-info/METADATA'
       > adding 'esphome-2025.10.4.dist-info/WHEEL'
       > adding 'esphome-2025.10.4.dist-info/entry_points.txt'
       > adding 'esphome-2025.10.4.dist-info/top_level.txt'
       > adding 'esphome-2025.10.4.dist-info/RECORD'
       > removing build/bdist.linux-x86_64/wheel
       > Successfully built esphome-2025.10.4-py3-none-any.whl
       > Finished creating a wheel...
       > /build/source/dist /build/source
       > Unpacking to: unpacked/esphome-2025.10.4...OK
       > Repacking wheel as ./esphome-2025.10.4-py3-none-any.whl...OK
       > /build/source
       > Finished executing pypaBuildPhase
       > Running phase: pythonRuntimeDepsCheckHook
       > Executing pythonRuntimeDepsCheck
       > Checking runtime dependencies for esphome-2025.10.4-py3-none-any.whl
       >   - kconfiglib not installed
       For full logs, run:

I'll check whether I can make sense of that test 👍

@thanegill
thanegill force-pushed the esphome-kconfiglib branch 2 times, most recently from 87a1620 to e256ab0 Compare November 7, 2025 20:33
@thanegill

Copy link
Copy Markdown
Contributor Author

@polyfloyd Build is now fixed. I had wrongly assuming with the esphome 2025.10.4 release that this PR was included.

@polyfloyd

Copy link
Copy Markdown
Contributor

I get an error when running compile for the first time. The second time it works as expected. I think we should consider this an improvement and try to address that later, perhaps when 2025.11.0 is released which also includes your kconfiglib patch.

I recommend to merge this into master.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 8, 2025
@polyfloyd

Copy link
Copy Markdown
Contributor

@thanegill Is this still a draft?

@mweinelt

Copy link
Copy Markdown
Member

We're not testing coverage in nixpkgs, please revert the migration from pytest-cov-stub to pytest-cov.

Fixes NixOS#442676
Use same python dependency everywhere
Removes dependencies:
  - python3.pkgs.requests
  - python3.pkgs.protobuf
  - python3.pkgs.packaging
  - python3.pkgs.kconfiglib
  - inetutils
@thanegill

Copy link
Copy Markdown
Contributor Author

We're not testing coverage in nixpkgs, please revert the migration from pytest-cov-stub to pytest-cov.

Done

@thanegill

Copy link
Copy Markdown
Contributor Author

Changing this PR to just the dependencies updates and removal of kconfiglib. I'll open a new PR for the nixosTests. Removing draft status.

@mweinelt

Copy link
Copy Markdown
Member

I'm not sure what this actually fixes, because esp-idf builds are broken in platformio AFAIUI.

@thanegill
thanegill marked this pull request as ready for review November 13, 2025 00:16
@thanegill

Copy link
Copy Markdown
Contributor Author

I'm not sure what this actually fixes, because esp-idf builds are broken in platformio AFAIUI.

This fixes one of the errors in #442676: ModuleNotFoundError: No module named 'kconfiglib.core'; 'kconfiglib' is not a package

@nixpkgs-ci
nixpkgs-ci Bot requested a review from mweinelt November 13, 2025 00:21
@nixpkgs-ci nixpkgs-ci Bot removed the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Nov 13, 2025
@thanegill
thanegill requested a review from polyfloyd November 13, 2025 00:21
@mweinelt

Copy link
Copy Markdown
Member

Indeed, I can confirm the errors I attributed to platformio went away 🤔

@dotlambda dotlambda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I didn't test anything

@mweinelt
mweinelt added this pull request to the merge queue Nov 13, 2025
Merged via the queue into NixOS:master with commit b4799c4 Nov 13, 2025
@thanegill

Copy link
Copy Markdown
Contributor Author

Indeed, I can confirm the errors I attributed to platformio went away 🤔

Removing kconfiglib fixes that platformio issue as when not in the python path it no longer overrides this kconfiglib python module in esp-idf which really is just an alias of the local esp_kconfiglib module, but the alias of 'kconfiglib' is still used in esp-idf.

@thanegill

Copy link
Copy Markdown
Contributor Author

Adding nixosTests continued in #461102.

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

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

esphome: fails to build projects based on esp-idf framework due to platformio

5 participants