Page 1 of 1

Two diferents versions de esp-idf in diferents directories

Posted: Wed Aug 23, 2023 5:51 pm
by Nespressif
Hi all, I would like to know if I would have any problem if I install another version of esp-idf on my ubuntu computer (I am interested in testing with 5.1 stable). I think that if I save the repository in another directory, for example esp-idf51 and when I want to compile with this version I load the environment variables from that directory (having the correct version of python), I shouldn't have any problem.

This way I could continue working on my projects with the current 4.2 version and try things with 5.1.

Would there be any problem doing this?

Thanks

Re: Two version de esp-idf in diferents directories

Posted: Thu Aug 24, 2023 1:40 am
by locustcox
I’d highly recommend doing this inside a docker container. I just upgraded a large code base from 4.4 to 5.1 by using a devcontainer that was set up for esp-idf 5.1. Going back and forth between different IDF versions can be a big pain because of all the tool chain and python dependency issues.

Re: Two diferents versions de esp-idf in diferents directories

Posted: Fri Aug 25, 2023 7:13 am
by ESP_frhr
Hello,

I believe there should be no problem. Tools are properly versioned and python env is also based on esp-idf version. Meaning there should be no collision.

Let's say I have the esp-idf repository already cloned in the esp-idf directory.

Code: Select all

git clone --reference esp-idf --single-branch --branch release/v5.1 https://github.com/espressif/esp-idf.git esp-idf-v5.1
This will clone the release/v5.1 branch into esp-idf-v5.1 directory. The --reference option points to an existing esp-idf cloned reposiotry, to speed up the cloning. If you don't need the history, you can also --depth 1 to create a shallow clone. You can do this for multiple branches and have each release in separate repo/directory.

With this just change to the directory/version you want to work with(e.g. esp-idf-v5.1), run

Code: Select all

./install.sh && . ./export.sh
and it should be all set. At least this seems to be working for me. HTH

Re: Two diferents versions de esp-idf in diferents directories

Posted: Fri Aug 25, 2023 11:36 am
by Nespressif
All right, I'll give it a try, I think it should be fine too.

Thank you both very much for your answers.

Best regards,

Re: Two diferents versions de esp-idf in diferents directories

Posted: Thu Sep 28, 2023 8:59 am
by Nespressif
Hi all, for what it's worth, I have managed to install the esp-idf-v5.1 environment in another directory and make it work independently from the 4.2 version I had before. When I want to use one and the other I run . ./export.sh from the directory of the chosen version.
I have had to upgrade python to 3.8 and cmake to 3.29, but everything seems to be fine.
My OS is ubuntu 18.
Greetings to all.