Skip to content

Upload build path is different than output build path #641

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
ardnew opened this issue Apr 2, 2020 · 3 comments
Closed

Upload build path is different than output build path #641

ardnew opened this issue Apr 2, 2020 · 3 comments
Labels
status: waiting for information More information must be provided before work can proceed

Comments

@ardnew
Copy link
Contributor

ardnew commented Apr 2, 2020

Bug Report

Current behavior

arduino-cli --config-file /home/andrew/.config/arduino-cli/config.yaml compile --verbose --log-level debug --fqbn adafruit:nrf52:itsybitsy52840 --upload --port /dev/ttyACM1  --build-path /home/andrew/.tmp/arduino-build/bled --build-cache-path /home/andrew/.tmp/arduino-build.cache/bled  /home/andrew/Development/arduino/sketchbook/bled

The Adafruit nRF52840 core platform.txt contains a recipe to generate a bootable DFU .zip package specifying the output path as {build.path}/{build.project_name}.zip:

## Create dfu package zip file
recipe.objcopy.zip.pattern="{tools.nrfutil.cmd}" dfu genpkg --dev-type 0x0052 --sd-req {build.sd_fwid} --application "{build.path}/{build.project_name}.hex" "{build.path}/{build.project_name}.zip"

The upload utility recipe uses the exact same path {build.path}/{build.project_name}.zip:

tools.nrfutil.upload.pattern="{cmd}" {upload.verbose} dfu serial -pkg "{build.path}/{build.project_name}.zip" -p {serial.port} -b 115200 --singlebank

Yet when I execute the command pasted above (with a build path given at the command line), the outputs indicate two different paths are used:

...
Running recipe: recipe.objcopy.zip.pattern
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --sd-req 0x00B6 --application /home/andrew/.tmp/arduino-build/bled/bled.ino.hex /home/andrew/.tmp/arduino-build/bled/bled.ino.zip
Zip created at /home/andrew/.tmp/arduino-build/bled/bled.ino.zip
...
Sketch uses 35652 bytes (4%) of program storage space. Maximum is 815104 bytes.
Global variables use 6612 bytes (2%) of dynamic memory, leaving 230956 bytes for local variables. Maximum is 237568 bytes.
No new serial port detected.
Usage: adafruit-nrfutil dfu serial [OPTIONS]

Error: Invalid value for "-pkg" / "--package": Path "/home/andrew/Development/arduino/sketchbook/bled/bled.adafruit.nrf52.itsybitsy52840.zip" does not exist.
Error during Upload: uploading error: exit status 2

If I modify either path pattern I referenced above in platform.txt, I can verify the output of both commands uses their respective modified paths, so I'm confident these are the recipes being used.

Expected behavior

I would expect the path pattern {build.path}/{build.project_name}.zip to resolve to the same path in all recipes, and in particular that path should reflect what's given by command line option --build-path.

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.0.0-git Commit: 8759bf46
  • OS and platform: Ubuntu 18.04.4 LTS

Additional context

cmaglie added a commit that referenced this issue Sep 7, 2020
This should make the upload command compatibile with all the reasonable
usages.

See #764
See #641
cmaglie added a commit that referenced this issue Sep 7, 2020
This should make the upload command compatibile with all the reasonable
usages.

See #764
See #641
cmaglie added a commit that referenced this issue Sep 7, 2020
* Remove deprecation from importFile param

* Implement --input-file flag

* Add comment in --input-file splitting step

* Add e2e test for --input-x flags

* Refine upload flags testing

* Add --input-file file existence check

* Use TrimSuffix instead of replace

* Restore -i shorthand flag for --input-file and add CLI checkFlagsConflicts function

* Improved build path and project name auto-detection

This should make the upload command compatibile with all the reasonable
usages.

See #764
See #641

* Made UploadTest more resilient

* upload: sketch is ignored if input-dir or input-file is specified

There is no point in overriding the sketch name if the user explicitly
give it via command line.

* Update go-paths-helper to version 1.3.2

fixes EquivalentTo when used with abs paths

* fix TestGetCommandLine

* 100% coverage on detectSketchNameFromBuildPath function

* Do not git-ignore all *.bin but just inside the client_example folder

* slightly simplified function signature (cosmetic)

Co-authored-by: Cristian Maglie <[email protected]>
@cmaglie
Copy link
Member

cmaglie commented Sep 14, 2020

@ardnew
we merged a lof of fixes about build paths, may you try the latest version 0.13.0 and see if this is fixed?

@ardnew
Copy link
Contributor Author

ardnew commented Sep 14, 2020

@cmaglie sure thing, I'll try again this evening. are you expecting the other bug (#746) might be addressed as well, or no?

@cmaglie
Copy link
Member

cmaglie commented Sep 15, 2020

It should... give it a try and let us know :-)

@rsora rsora added the status: waiting for information More information must be provided before work can proceed label Oct 30, 2020
@github-actions github-actions bot added the stale label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for information More information must be provided before work can proceed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants