Skip to content

Add smart artifact find during upload #655

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
wants to merge 4 commits into from
Closed

Conversation

rsora
Copy link
Contributor

@rsora rsora commented Apr 14, 2020

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • The PR follows our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?

(Originates from a fix for #641)
The CLI upload step searches also in fallback locations for artifacts to upload, in case these files are missing.

  • What is the current behavior?

The CLI upload step assumes that the artifacts generated by the compile phase are also "exported" into the sketch folder (see the Java IDE export feature). This means that during the compile phase, the output files generated by the specific platform compiler are placed:

  • in a temporary calculated path obtained via builder.GenBuildPath(sketchPath)

or

  • in the user specified --build-path path
    And then "exported" (copied) into the sketch path.

This behavior could create issues for cores that do not implement correctly the "export" variables in the platform.txt, see for example this core in which you have the export recipe file extension .hex that is misaligned with the upload file extension .zip

Since the export feature is not fundamental in the Java IDE, 3rd party core maintainers are not forced to implement it or to implement it 100% correctly, so the CLI must take in account this aspect

  • What is the new behavior?

The upload command search process is the following:

  1. search the User specified importFile
  2. search into the Sketch folder (for "exported" files)
  3. search into the user specified --build-path (if passed during a compile --upload command)
  4. search into temp compile folder (calculated using builder.GenBuildPath(sketchPath))
  • Does this PR introduce a breaking change?

Not really, this change adds fallback strategies to the upload implementation that should be transparent for the user.

  • Other information:

I assumed in this PR that artifact files in fallback paths are always in this form sketch.Name+".ino"+ext and not in the exported form sketch.Name + "." + fqbnSuffix + ext


See how to contribute

@rsora rsora changed the title Rsora/smart path upload Add smart artifact find during upload Apr 14, 2020
@rsora rsora added the status: in progress Work is in progress on this label Apr 14, 2020
@rsora rsora force-pushed the rsora/smart-path-upload branch from 7f3fa8e to cfcf23f Compare April 14, 2020 12:14
@cmaglie cmaglie mentioned this pull request May 8, 2020
4 tasks
@cmaglie cmaglie closed this in #687 May 15, 2020
@cmaglie cmaglie deleted the rsora/smart-path-upload branch May 19, 2020 15:28
@per1234 per1234 added conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project and removed status: in progress Work is in progress on this labels Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants