Skip to content
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

Using dot . in PROGNAME causes unexpected behavior during building #3906

Closed
MohammedNoureldin opened this issue Mar 27, 2021 · 3 comments · Fixed by #3918
Closed

Using dot . in PROGNAME causes unexpected behavior during building #3906

MohammedNoureldin opened this issue Mar 27, 2021 · 3 comments · Fixed by #3918
Assignees
Milestone

Comments

@MohammedNoureldin
Copy link

MohammedNoureldin commented Mar 27, 2021

I want to rename the output firmware.bin file according to the example supplied by the official documentation.

platformio.ini:

[env:env_custom_prog_name]
platform = espressif8266
board = nodemcuv2
framework = arduino
build_flags = -D VERSION=13
extra_scripts = pre:extra_script.py

extra_script.py:

Import("env")

my_flags = env.ParseFlags(env['BUILD_FLAGS'])
defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
# print(defines)

env.Replace(PROGNAME="firmware_%s" % defines.get("VERSION"))

The default empty main.cpp file is sufficient to reproduce the problem.

The previous default example will work. However, as soon as I use the PROGNAME 1.2.3+4 (which includes dots), the program does not build properly anymore. It removes the extension of the ,elf file, and the partitions.bin is missing (which causes fail to upload).

So in other words, for the example above, the problem is reproducible as soon as I use the following semantic VERSION instead of 13: 1.2.3+4

The problem happens exactly because there is a dot inside the the PROGNAME. Could you please check it?

@MohammedNoureldin MohammedNoureldin changed the title Using dot . in PROGNAME causes unexpected behavior Using dot . in PROGNAME causes unexpected behavior during building Mar 27, 2021
@MohammedNoureldin
Copy link
Author

MohammedNoureldin commented Mar 28, 2021

@ivankravets shouldn't this be labeled as bug?

@ivankravets
Copy link
Member

Please re-test with pio upgrade --dev.

@MohammedNoureldin
Copy link
Author

@ivankravets @valeros This seems to be working now! Thanks a lot to you both!

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

Successfully merging a pull request may close this issue.

3 participants