NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.16k stars 14.19k forks source link

esphome: bwrap: can't chdir to $PWD: no such file or directory #241151

Open nagisa opened 1 year ago

nagisa commented 1 year ago

Describe the bug

I’m trying to follow ESP-home’s getting started guide. Having noticed that nix-shell -p esphome exists, I was hopeful for a straightforward experience.

Instead, the esphome run command fails with the following error:

INFO ESPHome 2023.5.5
INFO Reading configuration ./esphome.yaml...
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Compiling app...
bwrap: Can't chdir to $PWD: No such file or directory

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run esphome wizard nixrepro.yaml
  2. Run esphome run nixrepro.yaml or esphome compile nixrepro.yaml with the yaml file you created with the wizard.

Expected behavior

The ESP-home firmware builds/gets uploaded.

Screenshots

N/A

Additional context

M/A

Notify maintainers

@globin @mweinelt

Metadata

nagisa commented 1 year ago

This appears to be at least in part related to the fact that my project directory is not under /home…, if I move the direcotry to $HOME, it works…

mweinelt commented 1 year ago

If it fails somewhere in or around bwrap, that is due to our platformio packaging, not esphome.

Tried reproducing below /tmp, wizard and compile worked fine, I don't have any ESP I could reflash right now.

nagisa commented 1 year ago

For me compile fails as well, but it does work under /tmp, just like it works under /home. What I have is a separate disk mounted directly under root (/sb) and then within that directory I have my projects folder (/sb/d), so for reproduction it might help to create a disk image (or tmpfs) and mount that under / as well.

(I wouldn’t be surprised if there's a bug not in packaging but in platformio directly, but I’m not familiar enough with any of the involved projects to tell)

mweinelt commented 10 months ago

Deferring to platformio maintainers @mogorman @makefu.

yajo commented 7 months ago

Any known workaround?