-
-
Notifications
You must be signed in to change notification settings - Fork 403
Fix upload command not working as expected when certain flags are used #1429
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
Conversation
54422aa
to
6cf5613
Compare
cli/upload/upload.go
Outdated
var sketchPath *paths.Path | ||
var sk *sketch.Sketch = nil | ||
// If the user explicitly specified a directory that contains binaries to upload | ||
// use those, we don't really need a valid Sketch to upload in this case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about this use case (which used to be supported), where the sketch argument could be used to provide sketch.json
metadata when using a binary?:
$ ./arduino-cli version
arduino-cli.exe alpha Version: 0.18.3 Commit: d710b642 Date: 2021-05-14T12:36:58Z
$ ./arduino-cli sketch new /tmp/FooSketch
Sketch created in: C:\Users\per\AppData\Local\Temp\FooSketch
$ ./arduino-cli board attach arduino:avr:uno /tmp/FooSketch
Selected fqbn: arduino:avr:uno
$ ./arduino-cli compile --output-dir /tmp/FooSketchBin /tmp/FooSketch
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
$ ./arduino-cli upload -v -p COM10 --input-dir /tmp/FooSketchBin /tmp/FooSketch
"C:\program-files\arduino\cli\arduino-cli_nightly\directories-data\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\program-files\arduino\cli\arduino-cli_nightly\directories-data\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM10" -b115200 -D "-Uflash:w:C:/Users/per/AppData/Local/Temp/FooSketchBin/FooSketch.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
[...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, didn't think about that case. 🤔
I'll try to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 51b1be6.
02539da
to
51b1be6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes all three types of uploading issue for me.
#1429) * Fix upload command not working as expected when certain flags are used * Fix absurd upload corner case
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)Fixes two bugs with a CLI command.
upload
fails if the--input-dir
or--input-file
are used and Sketch path is not specified.upload
fails if--fqbn
is not set even if specified in asketch.json
file.upload
doesn't fail--input-dir
or--input-file
are set and no Sketch path is specified.upload
doesn't fail if--fqbn
is not specified andsketch.json
contains a valid FQBN.titled accordingly?
Nope.
To verify that this PR fixes the aforementioned issue the integration tests must be run locally with a board connected.
Arduino Uno and Arduino MKR WiFi 1010 are recommended.
See how to contribute