Closed aidancully closed 1 month ago
Getting rid of wrapProgram
allowed my build to succeed. I'm new to nix, I'm sure there's a better way to do this.
index 349bff6..d837977 100644
--- a/pkgs/esp-idf/tools.nix
+++ b/pkgs/esp-idf/tools.nix
@@ -96,7 +96,7 @@ let
makeWrapper ${fhsEnv}/bin/${pname}-env $FILE_PATH --add-flags $WRAPPED_FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}
''
else
- ''wrapProgram $FILE_PATH ${lib.strings.concatStringsSep " " exportVarsWrapperArgsList}'';
+ ''echo hello'';
in ''
cp -r . $out
The error appears to come from espressif's tool wrappers. This uses std::env::current_exe()
to get the name of the executable, which does not appear to honor the argv[0] override (exec -a "$0"
) generated by wrapProgram
. I tested this by creating a simple Rust app:
fn main() {
println!("{:?}", std::env::current_exe());
}
and, when compiling and running that via % sh -c 'exec -a hello ./target/debug/foo'
, I see:
Ok("/Users/aidan/devel/test/foo/target/debug/foo")
It seems that wrapProgram
won't work for tools that espressif already wraps in this way.
Hopefully #68 fixes this!
I was able to reproduce the error by:
which resulted in:
I notice that that version of gcc is a shell-script:
If I change
.xtensa-esp32s3-elf-gcc-wrapped
toxtensa-esp32s3-elf-gcc-wrapped
, and also edit the store tomv .xtensa-esp32s3-elf-gcc-wrapped xtensa-esp32s3-elf-gcc-wrapped
, compilation succeeds, but this obviously isn't a real solution to my problem. I'm not sure what's going on, yet.