- 31 Aug, 2023 1 commit
-
-
Cristian Maglie authored
* If the upload port-detector fails detection, fallback to the user-provided port This will ensure that a port is always returned. * Increased debug level * Extend timeout if candidate port is lost in any case Even if `waitForUploadPort` is true, we should extend the timeout to allow USB enumeration to complete. In this case we extend by only 1 second instead of 5. * Revert "Extend timeout if candidate port is lost in any case" This reverts commit 7c77ed242383e416ff8748884a64474f73932911. The latest commit is not necessary since the detector has already 5 seconds of timeout.
-
- 22 Aug, 2023 1 commit
-
-
github-actions[bot] authored
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
- 21 Aug, 2023 1 commit
-
-
MatteoPologruto authored
* Add informations regarding profiles to LoadSketchResponse * Load profiles when LoadSketch is called * Add test to verify that LoadSketchResponse contains the profiles
-
- 18 Aug, 2023 3 commits
-
-
Cristian Maglie authored
* UploadResponse now has 'oneof' clause for better API design * Added scaffolding to return updated-port after upload * Upload port change detection (first draft) * Simplified port detection using a Future-style abstraction * Perform watcher-flush higher in the call tree * Do not infer upload port if 'upload.wait_for_upload_port' is false * Further simplified port detection subroutine structure * fixed linter issue * Always return an updatedUploadPort. Arduino CLI should always return the port after an upload, even in the case where no port change is expected. The consumer shouldn't be required to implement "if not updated_upload_port, use original port" logic. The whole point is that all the logic for determining which port should be selected after an upload should be implemented in Arduino CLI. The consumer should be able to simply select the port Arduino CLI tells it to select in all cases. * Updated docs * Perform a deep-copy of upload ports where needed. Previously only the pointer was copied, thus making changes in `actualPort` to be reflected also to `port`. This lead to some weird result in the `updatedUploadPort` result: { "stdout": "Verify 11344 bytes of flash with checksum.\nVerify successful\ndone in 0.010 seconds\nCPU reset.\n", "stderr": "", "updated_upload_port": { "address": "/dev/tty.usbmodem14101", <------- this address... "label": "/dev/cu.usbmodem14101", <------- ...is different from the label "protocol": "serial", "protocol_label": "Serial Port (USB)", "properties": { "pid": "0x804E", "serialNumber": "94A3397C5150435437202020FF150838", "vid": "0x2341" }, "hardware_id": "94A3397C5150435437202020FF150838" } } * When updating `actualPort` address, update also the address label. * Fixed some potential nil pointer exceptions * Further simplified board watcher We must acesss the gRPC API only until we cross the `command` package border. Once we are inside the `command` package we should use the internal API only. * Before returning from upload, check if the port is still alive Now the upload detects cases when the upload port is "unstable", i.e. the port changes even if it shouldn't (because the wait_for_upload_port property in boards.txt is set to false). This change should make the upload process more resilient. * Apply suggestions from code review Co-authored-by: per1234 <accounts@perglass.com> * Fixed nil exception * Improved tracking algorithm for upload-port reconnection The new algorithm takes into account the case where a single board may expose multiple ports, in this case the selection will increase priority to ports that: 1. have the same HW id as the user specified port for upload 2. have the same protocol as the user specified port for upload 3. have the same address as the user specified port for upload --------- Co-authored-by: per1234 <accounts@perglass.com>
-
Cristian Maglie authored
* regression: hide include-not-found errors during library discovery This regression was made during a refactoring of the Arduino preprocessor. In particular the wrong change was part of this commit: https://github.com/arduino/arduino-cli/commit/0585435f8b1d05e0117606f69bea42d3f3dfec79#diff-65ff16cbee816c0f443157444d99bcc144beee06c3329aec891894c8aeda7b27L372-R378 - preproc_stderr, preproc_err = GCCPreprocRunner(ctx, sourcePath, targetFilePath, includes) + var preproc_stdout []byte + preproc_stdout, preproc_stderr, preproc_err = preprocessor.GCC(sourcePath, targetFilePath, includes, ctx.BuildProperties) + if ctx.Verbose { + ctx.WriteStdout(preproc_stdout) + ctx.WriteStdout(preproc_stderr) + } Previously GCCPreprocRunner, in verbose modem will show ONLY the stdout of the process, instead the "refactored" code wrongly added also stderr to the output. For reference this is the old GCCPreprocRunner implementation: https://github.com/arduino/arduino-cli/commit/0585435f8b1d05e0117606f69bea42d3f3dfec79#diff-371f93465ca5a66f01cbe876348f67990750091d27a827781c8633456b93ef3bL36 -func GCCPreprocRunner(ctx *types.Context, sourceFilePath *paths.Path, targetFilePath *paths.Path, includes paths.PathList) ([]byte, error) { - cmd, err := prepareGCCPreprocRecipeProperties(ctx, sourceFilePath, targetFilePath, includes) - if err != nil { - return nil, err - } - _, stderr, err := utils.ExecCommand(ctx, cmd, utils.ShowIfVerbose /* stdout */, utils.Capture /* stderr */) - return stderr, err -} This commit fixes the regression. * Added integration test
-
Cristian Maglie authored
Previously the undefined template placeholders in "recipe.preproc.macros" were silently replaced the empty string. This changed after a refactoring in 0585435f. Previously it was: https://github.com/arduino/arduino-cli/commit/0585435f8b1d05e0117606f69bea42d3f3dfec79#diff-371f93465ca5a66f01cbe876348f67990750091d27a827781c8633456b93ef3bL62 - cmd, err := builder_utils.PrepareCommandForRecipe(buildProperties, "recipe.preproc.macros", true, ctx.PackageManager.GetEnvVarsForSpawnedProcess()) The `true` parameter in the call to `builder_utils.PrepareCommandForRecipe` is the parameter `removeUnsetProperties`. This behaviour has not been ported over after the "refactoring": https://github.com/arduino/arduino-cli/commit/0585435f8b1d05e0117606f69bea42d3f3dfec79#diff-733dda6759fe968eb8a8d7305c37c7a320a8df52764ca0cba8e88a6f1d077eb5R44-R65 + const gccPreprocRecipeProperty = "recipe.preproc.macros" + if gccBuildProperties.Get(gccPreprocRecipeProperty) == "" { + // autogenerate preprocess macros recipe from compile recipe + preprocPattern := gccBuildProperties.Get("recipe.cpp.o.pattern") + // add {preproc.macros.flags} to {compiler.cpp.flags} + preprocPattern = strings.Replace(preprocPattern, "{compiler.cpp.flags}", "{compiler.cpp.flags} {preproc.macros.flags}", 1) + // replace "{object_file}" with "{preprocessed_file_path}" + preprocPattern = strings.Replace(preprocPattern, "{object_file}", "{preprocessed_file_path}", 1) + + gccBuildProperties.Set(gccPreprocRecipeProperty, preprocPattern) + } + + pattern := gccBuildProperties.Get(gccPreprocRecipeProperty) + if pattern == "" { + return nil, nil, errors.Errorf(tr("%s pattern is missing"), gccPreprocRecipeProperty) + } + + commandLine := gccBuildProperties.ExpandPropsInString(pattern) + args, err := properties.SplitQuotedString(commandLine, `"'`, false) + if err != nil { + return nil, nil, err + } that is missing the call to `properties.DeleteUnexpandedPropsFromString`.
-
- 17 Aug, 2023 1 commit
-
-
Cristian Maglie authored
* Fixed loading of Library given a non-absolute path Givin a relative path is not ideal, but at least allows the CLI to compile the sketch correctly. * Added test
-
- 14 Aug, 2023 1 commit
-
-
Cristian Maglie authored
* docs: Clearifiesd how tools flavours are selected * Update docs/package_index_json-specification.md Co-authored-by: Alessio Perugini <alessioper.98@gmail.com> --------- Co-authored-by: Alessio Perugini <alessioper.98@gmail.com>
-
- 12 Aug, 2023 1 commit
-
-
dependabot[bot] authored
Bumps [arduino/setup-protoc](https://github.com/arduino/setup-protoc) from 1 to 2. - [Release notes](https://github.com/arduino/setup-protoc/releases) - [Commits](https://github.com/arduino/setup-protoc/compare/v1.0.0...v2) --- updated-dependencies: - dependency-name: arduino/setup-protoc dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
- 11 Aug, 2023 1 commit
-
-
dependabot[bot] authored
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.30 to 3.1.32. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.30...3.1.32) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
- 04 Aug, 2023 1 commit
-
-
Cristian Maglie authored
-
- 03 Aug, 2023 3 commits
-
-
Alessio Perugini authored
-
Cristian Maglie authored
-
Cristian Maglie authored
* Added FAILED_INSTANCE_INIT_REASON_INDEX_DOWNLOAD_ERROR in gRPC Init errors * Improved error reporting during Init and first-index-update
-
- 02 Aug, 2023 1 commit
-
-
Cristian Maglie authored
-
- 24 Jul, 2023 2 commits
-
-
MatteoPologruto authored
-
per1234 authored
The `--config` flag of the `arduino-cli monitor` command is used to configure the communication port used by the monitor. Previously the command line help did not provide any guidance for the usage of this flag, which might lead the users to wonder: - How can the configuration options available for use via the flag be determined? - What is the format for the configuration option argument? The information is provided in the FAQ page of the documentation, but that is not as convenient a source of information as the command line help and the user may not even be aware of its existence. The command help is hereby adjusted to provide the user with this information: - Create a conceptual linkage between the `--config` and `--describe` flags by using the "communication port settings" terminology in the references of both. - Document the argument format. In addition to the comma-separated list format I documented here, an alternative usage of passing multiple `--config` flags is also supported. I chose the former because I felt that the descriptions of the latter in either command line notation (e.g., `[--config <ID>=<value>]...`) or in prose (e.g., "The format is <ID>=<value>. Can be used multiple times for multiple settings.") were less clear.
-
- 21 Jul, 2023 2 commits
-
-
MatteoPologruto authored
-
dependabot[bot] authored
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4 to 5. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v4...v5) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
- 20 Jul, 2023 2 commits
-
-
dependabot[bot] authored
Bumps [pygments](https://github.com/pygments/pygments) from 2.12.0 to 2.15.0. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](https://github.com/pygments/pygments/compare/2.12.0...2.15.0) --- updated-dependencies: - dependency-name: pygments dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
MatteoPologruto authored
* Add output.no_color to configuration docs * Add output.no_color to configuration.schema.json
-
- 06 Jul, 2023 1 commit
-
-
Alessio Perugini authored
-
- 04 Jul, 2023 1 commit
-
-
RodrigoDornelles authored
* feat: add priority for main * docs: Update sketch-build-process.md * fix: suggestion @cmaglie of priorities libraries Co-authored-by: Cristian Maglie <c.maglie@bug.st> * tests: implement tests of new priority 'main' * fix: build cpp_test.go * fix: TestClosestMatchWithTotallyDifferentNames in cpp_test.go --------- Co-authored-by: Cristian Maglie <c.maglie@bug.st>
-
- 03 Jul, 2023 1 commit
-
-
github-actions[bot] authored
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
- 30 Jun, 2023 1 commit
-
-
Cristian Maglie authored
The reason why it was originally introduced: https://github.com/arduino/Arduino/pull/2709/commits/a6909bdb49d99253b4e684365e72e5dce31a49a7 Why we are removing it now? * Windows does preserve the state of the RTS/DTR bits on successive opening of the serial port. * The serial library used in the Arduino IDE 1.8.x has a bug when trying to set DTR=false, on successive opening of the port the DTR line is set back high by the USB serial driver. This works differently from the serial library we use in the Arduino CLI, that sets DTR=false for good and this change is preserved on the successive opening of the port. * Having the serial port left in a state with DTR=false may cause problems to tools uploading later. It may probably completely removed, but for now, to reduce the testing surface, it will be disabled only for Windows.
-
- 27 Jun, 2023 3 commits
-
-
MatteoPologruto authored
* Add DeleteRequest and DeleteResponse to gRPC * Add Delete command to settings * Add TestDelete to settings_test.go * Remove temporary directory when TestWrite ends * Refactor `config delete` command using gRPC function call
-
Cristian Maglie authored
* Made `inventory` package private. * If an error occurs reading the inventory.xml just log it and replace it. * Added integration test
-
Cristian Maglie authored
-
- 21 Jun, 2023 3 commits
-
-
MatteoPologruto authored
* Set `Platform.Intalled` to the installed release * Test that the json output contains `installed`
-
MatteoPologruto authored
* Align `board list --watch` and `board list` json output * Update docs
-
MatteoPologruto authored
* Fix failing board tests after package index updates * Remove duplicate test
-
- 20 Jun, 2023 2 commits
-
-
MatteoPologruto authored
-
MatteoPologruto authored
* Exclude sketch names ending with a dot * Fail with error if a reserved name is used as sketch name * Update sketch name specifications in docs
-
- 19 Jun, 2023 1 commit
-
-
Cristian Maglie authored
* Remove some direct access to sketch.Sketch * Moved `LoadSketch` command in the proper place * Removed some accesses to sketch.Sketch The required information are returned from LoadSketch. * Added SetSketchDefaults gRPC call This allows to finally remove wrong access to `sketch.Sketch` from `cli` package. * Updated docs * Fixed integration tests * Update rpc/cc/arduino/cli/commands/v1/commands.proto Co-authored-by: Alessio Perugini <alessioper.98@gmail.com> --------- Co-authored-by: Alessio Perugini <alessioper.98@gmail.com>
-
- 16 Jun, 2023 1 commit
-
-
Cristian Maglie authored
* Created core.PlatformList implementaion follow gRPC naming Previously it was named GetPlatforms with a different return type than the one defined in gRPC API .proto files. * Added test for #1529 * Perform first-update automatically in gRPC Init * Made cli.instance.Create function private * Extract function to compute index file name * Auto-download 3rd party indexes as part of the Init
-
- 15 Jun, 2023 2 commits
-
-
Alessio Perugini authored
* fix wrong type assertion * use feedback.Fatal otherwise it won't flush the stdout as json format * use feedback.PrintResult instead of using fatal * use errors.As in case in the future the err coming from PlatformUpgrade might be wrapped errors.As search through all the wrapped error for our target type, in case it finds it then it popolate that struct but more important we can use it as a type assertion even if is nested through many errors
-
Cristian Maglie authored
-
- 14 Jun, 2023 1 commit
-
-
MatteoPologruto authored
* Deprecate `query` in favor of `search_args` * Give priority to `search_args` if possible
-
- 13 Jun, 2023 2 commits
-
-
Cristian Maglie authored
-
Cristian Maglie authored
* Added integration test * Fixed panic in upload tool selection
-