Skip to content

Commit

Permalink
Merge #19329 #19330
Browse files Browse the repository at this point in the history
19329: MAINTAINING.md: add some notes on Bors r=benpicco a=benpicco



19330: native/stdio: Explicitly provide getchar r=chrysn a=chrysn

### Contribution description

This ensures that even when libc does not implement getchar through getc, any custom stdio is still in the loop when getchar is used.

Frankly, I don't know when this broke -- I'm pretty sure custom stdio worked just a few days ago -- but either way, without this patch RIOT on native currently bypasses a configured stdio for me.

### Testing procedure

* `make -C examples/saul all debug`
* `break stdio_read`
* `run`

Without this patch, observe how the shell runs w/o ever breaking. After, lots of breakpoint hits.

This is the way it behaves for me (Debian sid, libc6:i386 2.36-8). If it works for you before this patch, we might start bisecting the differences between the systems, but we may also accept that libcs may imlpement getchar in different ways, and not all of them pass by the getc which we're patching.

### Issues/PRs references

This is needed for testing #19289.

The implementation stems from the `fgetc(3)` man page, which states that "getchar() is equivalent to getc(stdin)".

Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: chrysn <chrysn@fsfe.org>
  • Loading branch information
3 people authored Feb 27, 2023
3 parents 6b501f7 + f5bd530 + 494942b commit 302a809
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ complete that no input from the original developer or maintainer is required.
3. Are critical/hard to understand parts in the code documented?
4. Check grammar and spelling of documentation

### Bors usage

RIOT uses [Bors] to merge Pull Requests. Bors can batch up to 4 PRs into a
merge train and build and merge them all at once.
This can greatly reduce CI times, but Bors has many quirks:

- To merge a PR, comment "bors merge" under it.
The PR needs to be approved and CI must have already have run (CI: Ready for build)
If you write "bors merge" before CI has finished running for the PR, Bors will
tell you it will do the merge once CI is finished.
This is a lie. You will have to manually write "bors merge" again once everything
but Bors is green.

- If there are multiple PRs that area ready to merge (all green except for Bors) you
can combine them into a merge train.
Be careful though: If CI is not busy, Bors will already start to build the first PR
once you type "Bors merge" and only include the other PRs in the next merge train.
To prevent this, you can first schedule a [dummy PR].
While the dummy PR (a no-op PR with "CI: skip compile tests" set) is running, you
can write "bors merge" under all the PRs you want to merge.
Be quick: You have a bit less than 1 minute of time to do this.

- If Bors gets stuck you can write "bors cancel" under the PRs it last tried to build.
This can sometimes happen if you cancel a build in the Web UI.

## Non-technical guidelines

Expand Down Expand Up @@ -187,3 +211,5 @@ there.
[Comparing build sizes]: https://github.com/RIOT-OS/RIOT/wiki/Comparing-build-sizes
[Coding Conventions]: CODING_CONVENTIONS.md
[Code of Conduct]: https://github.com/RIOT-OS/RIOT/blob/master/CODE_OF_CONDUCT.md
[Bors]: https://bors.tech/
[dummy PR]: https://github.com/RIOT-OS/RIOT/pull/19253
4 changes: 4 additions & 0 deletions cpu/native/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ int fgetc(FILE *fp)
return getc(fp);
}

int getchar(void) {
return getc(stdin);
}

int getc(FILE *fp)
{
char c;
Expand Down

0 comments on commit 302a809

Please sign in to comment.