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

[pull] master from MCUdude:master #6

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 4, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

 And not just the ones with 256 bytes pash pages. Thanks for the help @technoblogy\!
@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Apr 4, 2021
... For devices with more than 128kiB flash
MCUdude and others added 7 commits April 19, 2021 22:47
Apparently, this is used to determine if a target has more than one i2c port, which the 324PB has
Add missing missing delete operators introduced in C++14
Merge commit 'b4021a38eca08817dee1684814bbd426721d11a4'
…4f48

278334f48 Merge pull request #33 from DrItanium/cpp17_support
7aaa2705b Add the extra delete operators introduced in C++14

git-subtree-dir: avr/cores/MCUdude_corefiles
git-subtree-split: 278334f48f2d7049b323cd5fe3864727d8228475
Enable gnu++17 support by default
@MCUdude MCUdude force-pushed the master branch 2 times, most recently from e61c284 to f669a1a Compare June 22, 2021 16:19
emarlfox and others added 9 commits November 6, 2021 01:05
Adding ATmega32U4 Arduino as ISP programmer
This platform uses a build hook to save a disassembler listing to the build folder when compiling sketches.

Due to the use of a redirection operator in the command, it was necessary to execute it via the Windows command
interpreter by passing it as an argument to `cmd /c`.

Although paths with spaces can be used without difficulty in pattern generated commands executed directly by the Arduino
framework, things are more complicated when it comes to executing commands indirectly via `cmd /c`.

The `cmd /c` command has an odd handling of quotes:

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd#remarks

Under certain conditions, the first and last quotation mark of the command passed via the argument to `/c` are stripped.

These conditions occur for the command generated via the platform's `recipe.hooks.objcopy.postobjcopy.1.pattern.windows`
property when the both the path to `avr-objdump` and the temporary build path contain a space.

The removal of the essential quotes from the start and end of the command executed by `cmd /c` causes an error. for
example, if the `avr-objdump` path was:

```
C:\Users\username with spaces\AppData\Local\\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\bin\avr-objdump
```

The command will fail with the error:

'C:\Users\username' is not recognized as an internal or external command, operable program or batch file.

One of the required conditions for the unwanted quote stripping is that the first character of the argument to `cmd /c`
is a double quote. So this unwanted behavior can be avoided by ensuring the first character is not a double quote. That
is accomplished here by adding a dummy command that does not require quoting at the start of the argument.

It might seem that a less hacky approach would be to simply wrap the entire argument to `cmd /c` in an extra layer of
sacrificial quotes, leaving the essential quotes intact in the command that is finally executed. While that does indeed
work when running the command directly from the command line, it does not work when used in a pattern in the Arduino
platform configuration framework. The problem is that the string generated from the platform pattern can not be executed
as is. It must be split into arguments. The list of arguments space separated, with quoting where an argument contains a
space.

These arguments may contain quote characters, which must be escaped. This escaping is where the simple approach of extra
quotes becomes unusable. The `os/exec` Go package used to handle the escaping does that in a way that is compatible with
directly executing a command, but is not compatible with the legacy escaping system used by cmd.

It seems this problem of the command having paths with spaces did not occur in Arduino IDE 1.x due to it using a Windows
"8.3" format instead. Arduino CLI (and thus Arduino IDE 2.x) use the full path format instead.

It seems this problem of the command having paths with spaces did not occur in Arduino IDE 1.x due to it using a Windows
"8.3" format for the default build path, which meant the path in the command did not contain spaces. Arduino CLI (and
thus Arduino IDE 2.x) uses the full path format instead. However, the bug could also occur in Arduino IDE 1.x if the
user sets a custom build.path with spaces.

`recipe.hooks.savehex.presavehex.2.pattern.windows` also uses `cmd /C`. However, this command is not subject to the
quote stripping because it does not ever have a double quote as the first character of the argument.
Prevent corruption of disassembler listing command for paths w/ spaces
Enable Wire timeout py adding -DWIRE_TIMEOUT as a compiler flag, or by incommening a line in Wire_timeout.h
Copy link

coderabbitai bot commented May 23, 2024

Important

Review Skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet
6 participants