Skip to content

Nested variables in platform.txt do not resolve #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
me-no-dev opened this issue May 12, 2020 · 81 comments
Closed

Nested variables in platform.txt do not resolve #1184

me-no-dev opened this issue May 12, 2020 · 81 comments

Comments

@me-no-dev
Copy link

me-no-dev commented May 12, 2020

Describe the bug
I am adding support for ESP32S2 to ESP32 Arduino and in order to include the proper flags/libs etc, platform.txt has some variables, like compiler.path={runtime.tools.xtensa-{build.mcu}-elf-gcc.path}/bin/ that resolve fine in Arduino Builder, but seem to result in just /bin/ in sloeber.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the instructions on how to install the development environment on your particular OS here: https://github.com/espressif/arduino-esp32/tree/esp32s2
  2. Make sure that you clone the esp32s2 branch.
  3. Compile an empty sketch

Expected behavior
Sketch should compile fine, in fact I replaced all those nested {build.mcu} with esp32 and esp32s2 and it worked ok.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS 10.15.4
  • Browser does not matter
  • Version 4.3.1

Additional context
https://github.com/espressif/arduino-esp32/blob/esp32s2/platform.txt

@jantje
Copy link
Member

jantje commented May 12, 2020

The instructions you point to have 2 options.

Using Arduino IDE Boards Manager (preferred)
Using Arduino IDE with the development repository

Given the rest of the description I assume you are using the not preferred option.
As you are using V4.3.1 I assume you do not have a platform installed that installed a tool that resolves to {runtime.tools.xtensa-{build.mcu}-elf-gcc.path} whatever {build.mcu} resolves to.
To verify this assumption you can go to project->properties->C/C++ build->environment.
there check what A.BUILD.MCU resolves to. Suppose that is AVR.
Check what A.RUNTIME.TOOLS.XTENSA-AVR-ELF-GCC-PATH resolves to. I assume this environment variable does not exists.

@me-no-dev
Copy link
Author

Screenshot 2020-05-13 at 12 08 10

everything is there :) This is not AVR, it's ESP32. `A.BUILD.MCU` is also defined. Overall everything is there, but the double curlies do not resolve.

@me-no-dev
Copy link
Author

On the preferred, non-preferred option on installing the core. I am the core maintainer, I work in the non-preferred way. This is not an issue though, I've made enough Arduino ports in my life to know my way around. The issue is only what I posted it to be.

@me-no-dev
Copy link
Author

here are the ones that do not resolve:

Screenshot 2020-05-13 at 12 27 50

@jantje
Copy link
Member

jantje commented May 13, 2020

I tried to reproduce this here and I confirm (much to my surprise) that it does not work.
As the environment variable handling is internal CDT/eclipse stuff there are 2 possible root causes.
1)This is a cdt/eclipse limitation =>this will not be fixed soon(ever?)
2)Sloeber code doesn't use the CDT/Eclipse API properly=>Could be fixed easily

I fear this is number 1.

@me-no-dev
Copy link
Author

number 1 would mean end of esp32 support in sloeber :(
I currently have no other way to switch the platforms, except splitting them in two, which means 100% code duplication.

@jantje
Copy link
Member

jantje commented May 13, 2020

It works on my system when I do not expand the environment variables in the makefile.
To do so: goto project properties->C/C+ build
Uncheck "Expand env. Variable Refs in Makefiles"
This way the double expansion is done by the environment and not by CDT/Eclipse

@me-no-dev
Copy link
Author

I tried your suggestion, but nothing changed? i reloaded eclipse and all.

@jantje
Copy link
Member

jantje commented May 14, 2020

Check the file [project]/release/SubDir.mk
If "Expand env. Variable Refs in Makefiles" is off you should see something like

sloeber.ino.cpp.o: ..\sloeber.ino.cpp
	@echo 'Building file: $<'
	@echo 'Start de C++ bouw'
	${A.RECIPE.CPP.O.PATTERN.1}....." -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -D__IN_ECLIPSE__=1 -x c++ "$<" ${A.RECIPE.CPP.O.PATTERN.2} -o "$@" ${A.RECIPE.CPP.O.PATTERN.3} ${JANTJE.EXTRA.COMPILE} ${JANTJE.EXTRA.CPP.COMPILE} ${JANTJE.EXTRA.ALL}

	@echo 'Finished building: $<'
	@echo ' '

If ${A.RECIPE.CPP.O.PATTERN.1} is not there delete the release folder and build again.
If it still is not there check the "Expand env. Variable Refs in Makefiles" setting.

If it is there and it still doesn't work it may be that your os does not support nested variables.

@jantje
Copy link
Member

jantje commented May 15, 2020

@me-no-dev how is it going?

@me-no-dev
Copy link
Author

sorry had some deadlines. the pattern is there, but variables do not expand. I tried deleting the release folder as you proposed, that changed nothing for either chip. So far my only option is to change the platform.txt when I switch chips and to and from sloeber.

@me-no-dev
Copy link
Author

BTW I tried downloading 4.3.3 (now I remember why I am on 4.3.1) but after extracting, Mac told me that package is damaged and can not run.

@jantje
Copy link
Member

jantje commented May 17, 2020

Mac security is a pain. This is what it says above the download link

Sloeber needs java 8! Other java versions will not work!

Due to mac new security approach a simple download and extract will not work.

Follow following steps to install.

1)download with mac browser.

2)unpacked the sloeber ide zip file with the macOS native Archive Utility. Not in the download folder!!!

3)in the folder where you extracted Sloeber run: sudo xattr -r -d com.apple.quarantine Sloeber.app

Read the info on this site at: install->start here-> MacOS comments
If you have download issues try another browser. Firefox seems to work fine on all oses. chrome seems to have issues.

@jantje
Copy link
Member

jantje commented May 17, 2020

sorry had some deadlines.

No problem

the pattern is there, but variables do not expand.

Could it be that mac os doesn't support Nested variables? Can you test on the command line?

@me-no-dev
Copy link
Author

test on command line how? I am building the git master currently. Will use that to be sure it's all latest. Arduino-Builder expands the variables normally.

@jantje
Copy link
Member

jantje commented May 17, 2020

test on command line how?

I mean the mac variant of these windows commands

C:\Users\jan>set a=cpp
C:\Users\jan>set b=a%a%s
C:\Users\jan>echo %b%
acpps
C:\Users\jan>

Because ${A.RECIPE.CPP.O.PATTERN.1} is interpreted by the os
...
och no
...
It must be make that does the interpretation. not the os as windows needs %A.RECIPE.CPP.O.PATTERN.1%.

@jantje
Copy link
Member

jantje commented May 18, 2020

I think I have found the root cause.
Sloeber internally works with uppercase variable names. Making the keys uppercase seems to fail resulting in bad names
{compiler.{recipe.c}.cmd}
in the platform.txt becomes
${A.COMPILER.${A.RECIPE.C}.cmd}
When I put
{compiler.{recipe.c}.CMD}
in the platform.txt it works.
Need to think on how to fix this.

@me-no-dev
Copy link
Author

Nice! At least there is some progress! Any other "workaround" that I came up with as proposal was really stupid... so I'll spare you from them. Unfortunately not everything after such nested variables is part of another variable. Sometimes the substitution is inside a text (like toolchain path/prefix) and sometimes it's part of another variable (like above). There is no clear way to distinct one from the other. Only possibility I see is to search for variable that will resolve capitalised or not.

@jantje
Copy link
Member

jantje commented May 19, 2020

When do you expect this to be available in the boardsmanager?

@me-no-dev
Copy link
Author

given that I am a bit pushed by superiors to release soon because it adds support for our newest chip, I would say rather sooner than later. Maybe a month, maybe less.

@jantje
Copy link
Member

jantje commented May 19, 2020

@me-no-dev can you test whether the problem is solved with the latest nightly?

@me-no-dev
Copy link
Author

same thing. I noticed that you copy/generate platform.sloeber.txt. Seems to be exact copy.

@jantje
Copy link
Member

jantje commented May 20, 2020

same thing.

damn.
Do you have a link to a platform.txt boards.txt that causes the problem?

I noticed that you copy/generate platform.sloeber.txt. Seems to be exact copy.

Yes it is generated but if no workaround is needed it is copy.
I named it this way so it is clear the version control should simply ignore it.

@me-no-dev
Copy link
Author

Sorry @jantje I will try today. A bit too much going on around me atm

@me-no-dev
Copy link
Author

@jantje I can confirm, works as expected on Mac. Thanks!

Seems that you are using platform.sloeber.txt and boards.sloeber.txt, which sometimes get cached in projects. Had to clean the projects, delete the files and reselect the board in order for it to compile with updated platform.

@jantje
Copy link
Member

jantje commented Oct 23, 2020

Great :-)
I should start thinking about making a release

The update procedure http://eclipse.baeyens.it/how_to.shtml#/n states
For each and every project in your workspace go to the project properties->arduino. Verify your settings. Select apply and close. (Do not use cancel!!)
That should take care of updating the boards.sloeber.txt and platform.sloeber.txtx
Cleaning the project is never a bad idea but should not be necessary.

@me-no-dev
Copy link
Author

The update procedure http://eclipse.baeyens.it/how_to.shtml#/n states
For each and every project in your workspace go to the project properties->arduino. Verify your settings. Select apply and close. (Do not use cancel!!)
That should take care of updating the boards.sloeber.txt and platform.sloeber.txtx
Cleaning the project is never a bad idea but should not be necessary.

Yup :) I always do that, but this time it did not work. The old platform was somehow cached, so selecting apply did reinit the settings, but to the old platform.

@jantje
Copy link
Member

jantje commented Oct 26, 2020

oops, that is bad

@me-no-dev
Copy link
Author

Sorry to bother again :)
2 things:

  1. I again had to delete the *.sloeber.txt files before I can use the updated board files, so that is confirmed.
  2. Upload is failing because it looks like it's looking for the wrong recipe (shows double periods). Here is a screenshot of the errors

Screenshot 2020-11-17 at 0 56 17

@jantje
Copy link
Member

jantje commented Nov 16, 2020

I didn't have time yet to investigate why the *.sloeber.txt files do not get renewed.
The upload issue should be fixed in the nightly #1254

@me-no-dev
Copy link
Author

thanks :) will give it a go

@me-no-dev
Copy link
Author

@jantje I can confirm upload is working!

@jantje
Copy link
Member

jantje commented Nov 17, 2020

as to "I again had to delete the *.sloeber.txt files before I can use the updated board files, so that is confirmed."

If you ever are in the situation again of thinking about deleting the *.sloeber.txt files to fix a issue. Can you check the version number on the first line. Maybe I added a workaround without upgrading the version number.
The current version number is " V1.00.test 11'

@me-no-dev
Copy link
Author

sure! The files I deleted were from the previous time that I tested your changes (pulled master on that day)

@jantje
Copy link
Member

jantje commented Nov 18, 2020

That day was?

@me-no-dev
Copy link
Author

23 October :) 27 days ago (what github says)

@jantje
Copy link
Member

jantje commented Nov 19, 2020

based on the dates in the history of workaround the version number mistake should not be the case.
But the last change did not increase the version number.
https://github.com/Sloeber/arduino-eclipse-plugin/commits/master/io.sloeber.core/src/io/sloeber/core/managers/WorkAround.java
One of the last fixes was #1183 because the files got rebuild all the time.
Strange...

@jantje
Copy link
Member

jantje commented Nov 21, 2020

could it be those files are marked read only or so?

@madhephaestus
Copy link
Contributor

madhephaestus commented Nov 22, 2020

I can confirm this bug on Linux.

the error i got was:

make all 
make --no-print-directory pre-build
bash -c "[ ! -f /home/hephaestus/rbe-workspace/fewf/partitions.csv ] || cp -f /home/hephaestus/rbe-workspace/fewf/partitions.csv /home/hephaestus/rbe-workspace/fewf/Release/partitions.csv"
bash -c "[ -f /home/hephaestus/rbe-workspace/fewf/Release/partitions.csv ] || cp /home/hephaestus/Arduino/hardware/espressif/4point2/tools/partitions/default.csv /home/hephaestus/rbe-workspace/fewf/Release/partitions.csv"
 
make --no-print-directory main-build
Building file: ../sloeber.ino.cpp
Starting C++ compile
"/bin/xtensa-esp32-elf-g++"   -DF_CPU=240000000L -DARDUINO=10812 -DARDUINO_FEATHER_ESP32 -DARDUINO_ARCH_4POINT2 '-DARDUINO_BOARD="FEATHER_ESP32"' -DARDUINO_VARIANT="feather_esp32"  -DESP32 -DCORE_DEBUG_LEVEL=0       -I"/home/hephaestus/Arduino/hardware/espressif/4point2/cores/esp32" -I"/home/hephaestus/Arduino/hardware/espressif/4point2/variants/feather_esp32" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "../sloeber.ino.cpp"   -o "sloeber.ino.cpp.o"
/bin/sh: 1: /bin/xtensa-esp32-elf-g++: not found
subdir.mk:18: recipe for target 'sloeber.ino.cpp.o' failed
makefile:64: recipe for target 'all' failed
make[1]: *** [sloeber.ino.cpp.o] Error 127
make: *** [all] Error 2
"make all" terminated with exit code 2. Build might be incomplete.

I worked around it by adding:

build.mcu=esp32

at the top of my platform.txt file. If i wanted to use the S2, i would change it to

build.mcu=esp32s2

For the hackiest, but works right now, workaround make 2 copies of the

~/Arduino/hardware/espressif/esp32 

rename one

~/Arduino/hardware/espressif/esp32s2

and hack each appropriately. I know this is not a solution, but for anyone like me that needed a workaround, here you go!

after hacking the same compile line looks like:

make all 
make --no-print-directory pre-build
bash -c "[ ! -f /home/hephaestus/rbe-workspace/cs/partitions.csv ] || cp -f /home/hephaestus/rbe-workspace/cs/partitions.csv /home/hephaestus/rbe-workspace/cs/Release/partitions.csv"
bash -c "[ -f /home/hephaestus/rbe-workspace/cs/Release/partitions.csv ] || cp /home/hephaestus/Arduino/hardware/espressif/4point2/tools/partitions/default.csv /home/hephaestus/rbe-workspace/cs/Release/partitions.csv"
 
make --no-print-directory main-build
Building file: ../sloeber.ino.cpp
Starting C++ compile
"/home/hephaestus/Arduino/hardware/espressif/4point2/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++" -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.3-dev-1720-g494a124d9-dirty" -DESP_PLATFORM   "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/config" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/newlib/platform_include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/freertos/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/freertos/xtensa/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_hw_support/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_hw_support/port/esp32" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/heap/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/log/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/include/apps" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/include/apps/sntp" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/lwip/src/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/port/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/port/esp32/include/arch" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/lwip/port/esp32/tcp_isn" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/soc/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/soc/esp32" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/soc/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/hal/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/hal/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_rom/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_common/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_system/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/xtensa/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/xtensa/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/driver/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/driver/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_ringbuf/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/efuse/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/efuse/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/espcoredump/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_timer/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_ipc/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_pm/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/vfs/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_wifi/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_wifi/esp32/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_event/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_netif/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_eth/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/tcpip_adapter/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/app_trace/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/mbedtls/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/mbedtls/mbedtls/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/mbedtls/esp_crt_bundle/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/bootloader_support/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/app_update/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/spi_flash/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/nvs_flash/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/pthread/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/wpa_supplicant/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/wpa_supplicant/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/wpa_supplicant/include/esp_supplicant" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/perfmon/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/asio/asio/asio/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/asio/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/bt/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/bt/common/osi/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/bt/host/bluedroid/api/include/api" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/cbor/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/unity/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/unity/unity/src" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/unity/unity/extras/fixture/src" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/cmock/CMock/src" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/coap/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/coap/port/include/coap" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/coap/libcoap/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/coap/libcoap/include/coap2" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/console" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/nghttp/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/nghttp/nghttp2/lib/includes" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-tls" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-tls/esp-tls-crypto" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_adc_cal/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_gdbstub/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_hid/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/tcp_transport/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_http_client/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_http_server/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_https_ota/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/protobuf-c/protobuf-c" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/protocomm/include/common" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/protocomm/include/security" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/protocomm/include/transports" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/mdns/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_local_ctrl/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/sdmmc/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_serial_slave_link/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_websocket_client/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/expat/expat/expat/lib" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/expat/port/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/wear_levelling/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/fatfs/diskio" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/fatfs/vfs" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/fatfs/src" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/freemodbus/common/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/idf_test/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/idf_test/include/esp32" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/jsmn/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/json/cJSON" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/libsodium/libsodium/src/libsodium/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/libsodium/port_include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/mqtt/esp-mqtt/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/openssl/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/spiffs/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/ulp/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/wifi_provisioning/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/button/button/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/json_parser" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/json_parser/jsmn/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/json_generator" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_schedule/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_rainmaker/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/qrcode/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/ws2812_led" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/face_detection/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/face_recognition/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/object_detection/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/image_util/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/pose_estimation/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp-face/lib/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp32-camera/driver/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp32-camera/conversions/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_littlefs/src" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/esp_littlefs/include" "-I/home/hephaestus/Arduino/hardware/espressif/4point2/tools/sdk/esp32/include/fb_gfx/include" -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -O2 -fstack-protector -std=gnu++11 -fexceptions -fno-rtti  -MMD -c -DF_CPU=240000000L -DARDUINO=10812 -DARDUINO_FEATHER_ESP32 -DARDUINO_ARCH_4POINT2 '-DARDUINO_BOARD="FEATHER_ESP32"' -DARDUINO_VARIANT="feather_esp32"  -DESP32 -DCORE_DEBUG_LEVEL=0    -DARDUINO_SERIAL_PORT=0   -I"/home/hephaestus/Arduino/hardware/espressif/4point2/cores/esp32" -I"/home/hephaestus/Arduino/hardware/espressif/4point2/variants/feather_esp32" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "../sloeber.ino.cpp"   -o "sloeber.ino.cpp.o"
Finished building: ../sloeber.ino.cpp

@me-no-dev
Copy link
Author

could it be those files are marked read only or so?

They are in gitignore and managed only by Sloeber. That is not it :)

In what cases do those files get rebuilt?

@jantje
Copy link
Member

jantje commented Nov 22, 2020

In what cases do those files get rebuilt?

I was writing/verifying the way I thought it worked and then I noticed that platform.txt is not treated equally to boards.txt.
boards.txt is worked around at every read but platforem.txt not.
I kept my unfinished description for reference. I'll make a new issue for this one as it is unrelated to the nested variables.

Each time they get read. It is meant to go as follows.
All[1] .txt files are processed by https://github.com/Sloeber/arduino-eclipse-plugin/blob/master/io.sloeber.core/src/io/sloeber/core/tools/TxtFile.java.
When an instance of the class is created it takes a flag to tell whether it needs a workaround or not. boards.txt and platform.txt take a workaround.
In the constructor the workaround is applied if the workaround flag is set. https://github.com/Sloeber/arduino-eclipse-plugin/blob/ee0383b0076a9ef11241a09e9045d113c592018b/io.sloeber.core/src/io/sloeber/core/tools/TxtFile.java#L70-L72

The workaround works as follows
Read the first line of the file.
If the first line of the file does not match a pre-set string; delete the file.
If the file does not exist create it.
Read the file.

[1] that is boards.txt, platfoprms.txt, programmers.txt and the sloeber pre and post processing txt files and maybe I forgot some

@jantje
Copy link
Member

jantje commented Nov 22, 2020

@madhephaestus
Are you on the latest nightly?

@madhephaestus
Copy link
Contributor

Eclipse Version: 2020-09 (4.17.0) can not resolve some dependencies on the nightly build, i am on the latest Eclipse Marketplace release.

i notice since my work around did in fact work: Maybe the issue is not nested variables as it might immediately seem, but instead its that the value build.mcu is not being injected into the parser before parsing? Maybe the root cause of this issues is in fact looking at where build.mcu is defined and how that gets passed to the parser for platform.txt

@jantje
Copy link
Member

jantje commented Nov 22, 2020

This is a different issue for sure. Please create a new issue if you want to investigate.
Note that sloeber nightly needs CDT10 and java 10 (or higher) since September 2020.
Before that you needed java8 and a CDT < 10
As the sloeber product on windows comes with java 8 the update will suddenly stop working (this is a unforeseen side effect :-( )

@jef-sure
Copy link

jef-sure commented Jun 8, 2021

"me too": Linux Kubuntu, Eclipse IDE for C/C++ Developers (includes Incubating components)

Version: 2021-03 (4.19.0)
Build id: 20210312-0638

make --no-print-directory main-build
Building file: ../sloeber.ino.cpp
Starting C++ compile
"/bin/xtensa-esp32-elf-g++"   -DF_CPU=240000000L -DARDUINO=10812 -DARDUINO_NodeMCU_32S -DARDUINO_ARCH_ARDUINO-ESP32 '-DARDUINO_BOARD="NodeMCU_32S"' -DARDUINO_VARIANT="nodemcu-32s"  -DESP32 -DCORE_DEBUG_LEVEL=0       -I"/home/anton/git/arduino-esp32/cores/esp32" -I"/home/anton/git/arduino-esp32/variants/nodemcu-32s" -I"/home/anton/eclipse/eclipse-2020-09/arduinoPlugin/libraries/FreeRTOS/10.4.4-1/src" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "../sloeber.ino.cpp"   -o "sloeber.ino.cpp.o"    
/bin/sh: 1: /bin/xtensa-esp32-elf-g++: not found
make[1]: *** [subdir.mk:20: sloeber.ino.cpp.o] Error 127
make: *** [makefile:66: all] Error 2
"make all" terminated with exit code 2. Build might be incomplete.

@jantje
Copy link
Member

jantje commented Jul 11, 2021

Closing as I'm releasing 4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants