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

Extension detection is a bit naive #150

Open
dirkx opened this issue Jan 17, 2022 · 6 comments · May be fixed by #151
Open

Extension detection is a bit naive #150

dirkx opened this issue Jan 17, 2022 · 6 comments · May be fixed by #151

Comments

@dirkx
Copy link

dirkx commented Jan 17, 2022

Increasingly we have flash filenames like foo.ino.hex (Ardino) or foo.s8.hex or foo.signed.hex (or pkcs8/p8) for signed HEXes.

This confuses stm8flash - and gives a

Due to its file extension (or lack thereof), "/var/folders/dn/nfs_l_hs0cs0g.......2/07_all.ino.hex" is considered as INTEL HEX format!

error message.

dirkx added a commit to dirkx/stm8flash that referenced this issue Jan 17, 2022
…ino.hex; or foo.sig.hex which are increasingly common. (Fixes vdudouyt#150)
@dirkx dirkx linked a pull request Jan 17, 2022 that will close this issue
@spth
Copy link
Collaborator

spth commented Jan 17, 2022

What is the problem? I assume .ino.hex is a .hex file, and the message you show (an informative message, not an error message) looks fine to me.

@dirkx
Copy link
Author

dirkx commented Jan 17, 2022 via email

@spth
Copy link
Collaborator

spth commented Jan 17, 2022

I don't see anything wrong with the current code. I don't even see how the "fix" would change anything (apart from making stm8flash fail to compile where rindex is not available). Both strrchr and rindex return a pointer to the last dot in the filename.

@spth
Copy link
Collaborator

spth commented Nov 16, 2022

If the message is a problem for your workflow, maybe we should have a --verbose option, and only emit it then?

@schneidersoft
Copy link
Contributor

you probably have a good reason so enlighten me. Why is your automation tool reading stderr/stdout? stm8flash gives return codes to indicate success or failure. also I agree with spth, the "fix" doesn't seem to change any behaviour. hiding the warning behind --verbose seems fair, since it is after all only a warning

@dirkx
Copy link
Author

dirkx commented Nov 20, 2022

In unix land - indeed no issue at all - there things trigger on exit(3) from stdlib. The issue is tools like Arduino, PIO, naive git-pipelines and others; which seem to use stdout (not even stderr) to 'find' warnings and errors.

But agreed - simply moving it under a verbose (or level 2 verbose) flag absolutely solves this.

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

Successfully merging a pull request may close this issue.

3 participants