GithubHelp home page GithubHelp logo

Comments (20)

MabezDev avatar MabezDev commented on June 18, 2024

What version of esp-idf-sys are you using? I believe there was an issue in an older release building libsodium.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Just the one that rust-esp32-std-demo uses: 0.21.1

https://github.com/ivmarkov/rust-esp32-std-demo/blob/main/Cargo.toml#L58:

esp-idf-sys = { version = "0.21.1", features = ["binstart"] }

There does seem to be a newer one out.
I'll switch to that, and see if that works.
If so, I'll make a PR for it.

from esp-idf-sys.

MabezDev avatar MabezDev commented on June 18, 2024

If you are on windows, this could also be a long file path issue. Maybe try out the native feature of esp-idf-sys if the new version one.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

It seems that esp-idf-svc and friends are all on 0.21.
I'll try out the native feature, and see how that goes.

And failing that, I'll patch the libraries, and bump the version for all of them.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Seems I can't build esp-idf-sys with the native, as it fails with unable to find Ninja.
Patching it, and telling it to find ninja, just results in some weird output.

native feature:
image

patched version: (So it's looking for ninja)
image

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

I'll go install ninja, and see if it works with that.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Ninja is installed, and working.
Seems that it's looking for xtensa-esp32-elf-gcc.

image

from esp-idf-sys.

N3xed avatar N3xed commented on June 18, 2024

This really shouldn't happen, cmake is somehow not getting the correct PATH set (both gcc and ninja are automatically installed by the build script).

You could try printing the PATH variable inside the CMakeLists.txt file, by adding the line message(STATUS "$ENV{PATH}") to the beginning of it. Add the line to the CMakeLists.txt inside the out dir of esp-idf-sys and try recompiling with cargo build -vv.

One issue that could cause this is if you have cygpath in your PATH. Try running cygpath if it works and your not inside git-bash or the likes, this would probably cause issues. Also try compiling your project with git-bash itself.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Ok, after some troubleshooting, it's definitely because I have cygpath on my PATH.

The problematic code is in embuild.
By the looks of it, cygwin (or more specifically, git-bash), does set some env variables that could be looked at, just to make sure the tty is, in fact, from cygwin.

However, that's not all.
That, unfortunately, leads me straight into another issue.
Whether I patch embuild or if I run it directly from mingw64, the issue is the same:

image

image

I'm going to assume the -I args are wrong, so I'll start looking through them.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Weird.
Maybe a symlink was supposed to be generated.

image

I've found the files, but the includes are pointing to a completely different location.

from esp-idf-sys.

N3xed avatar N3xed commented on June 18, 2024

I think you're running into windows path length limitations: see Microsoft docs.

from esp-idf-sys.

N3xed avatar N3xed commented on June 18, 2024

Ok, after some troubleshooting, it's definitely because I have cygpath on my PATH.

The problematic code is in embuild. By the looks of it, cygwin (or more specifically, git-bash), does set some env variables that could be looked at, just to make sure the tty is, in fact, from cygwin.

I've created a new release that should fix this issue. I guess the first workaround that I implemented to circumvent issues with msys or cygwin on Windows was not that great, but these problems should be fixed now.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Weird, even after setting the long paths flag, I'm still getting the same error.

I played around with it a bit and got a new error:
image

I'm a bit lost with this one though...

from esp-idf-sys.

N3xed avatar N3xed commented on June 18, 2024

I played around with it a bit and got a new error: image

I'm a bit lost with this one though...

This error is unrelated, I'm not sure how it happens but I fixed it by just copying the other binaries (like cargo,
cargo-clippy, cargo-fmt, clippy-driver and rustfmt) from the nightly toolchain to the esp toolchain. I think it has to do with cargo concurrently linking to these executables (the nightly ones are used if the used toolchain doesn't have them).

Note: You have to copy the .dlls too (.pdbs should only be needed for debugging purposes, but why not copy them too).

We should really open an issue for this one upstream, and for the temporary fix in rust-build (maybe).

from esp-idf-sys.

georgik avatar georgik commented on June 18, 2024

@Jezza The first error is caused by too long build path. Move the project to shorter path. This is known limitation of Windows build via Platform IO. It's quite misleading that it fails on libsodium. The libsodium is the first library which has files on very long paths, so the build fails there.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

@georgik I'm not building it with Platform IO anymore, I switched to native.
I also ended up enabling long paths in windows.

The current issue I'm facing is still being unable to find headers:
this one

from esp-idf-sys.

georgik avatar georgik commented on June 18, 2024

Just FYI @Jezza Long Paths on Windows does not solve the problem. For some unknown reason this setting is ignored during the build.

from esp-idf-sys.

Jezza avatar Jezza commented on June 18, 2024

Ah, I see.
Nice to know.

from esp-idf-sys.

N3xed avatar N3xed commented on June 18, 2024

With a little bit of research this seems to be a gcc limitation.

Possible workarounds:

  • Use subst to assign a virtual drive letter to a path (should work as pointed out here).
  • Create a directory junction (with mklink /j) to shorten the path (not tested).
  • Moving the project to a directory with a shorter path.

If this is a common issue, it may be worth trying to implement a workaround (for example forcing cmake to use relative paths, creating directory junctions ourselves, etc.).

from esp-idf-sys.

MabezDev avatar MabezDev commented on June 18, 2024

Closing due to inactivity, I hope that by now all the issues are resolved. Please file another if this is not the case.

from esp-idf-sys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.