Skip to content

Commit

Permalink
workaround esp-idf version detection
Browse files Browse the repository at this point in the history
If version.txt is missing some part of the cmake toolchain tries to read
refs/heads/fetchgit in the idf repo which failed.

This is not a perfect solution, but works nicely when using cargo.
  • Loading branch information
madmo committed Mar 6, 2024
1 parent 2a74722 commit aa89fb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/esp-idf/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ rev ? "v5.1.2"
, sha256 ? "sha256-uEf3/3NPH+E39VgQ02AbxTG7nmG5bQlhwk/WcTeAUfg="
, sha256 ? "sha256-kLV8c6wM80fSMqyTjqhRwN8CuUCvV8WzfoXnawlaj10="
, toolsToInclude ? [
"xtensa-esp-elf-gdb"
"riscv32-esp-elf-gdb"
Expand Down Expand Up @@ -40,6 +40,7 @@ let
rev = rev;
sha256 = sha256;
fetchSubmodules = true;
leaveDotGit = true;
};

allTools = callPackage (import ./tools.nix) {
Expand Down Expand Up @@ -120,6 +121,10 @@ stdenv.mkDerivation rec {
dontUseNinjaCheck = true;

installPhase = ''
# make esp-idf cmake git version detection happy
mkdir -p .git/refs/heads
awk '!/^#/{print ''$1}' .git/packed-refs > .git/refs/heads/fetchgit
mkdir -p $out
cp -rv . $out/
Expand Down

0 comments on commit aa89fb4

Please sign in to comment.