Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cache gcc warnings#302

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
facchinm wants to merge3 commits intoarduino:master
base:master
Choose a base branch
Loading
fromfacchinm:warning_cache
Open

Conversation

@facchinm
Copy link
Member

... and display them even if the file is not being recompiled.
Should allow removing48aa042 from#301
There's a concurrency issue on cached prints that should be solved before merging.

Copy link
Collaborator

@matthijskooijmanmatthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Overall, this looks good to me. I did leave quite some smaller remarks inline.

I don't understand the concurrency issue exactly: If this interleaves output from multiple concurrent processes, then why doesn't that happen in the original compilation run? Is that perhaps just a coincidence, that the chances of interleaving are small when each compilation command actually takes some time? Or is there some mechanism in place to actually properly interleave output from multiple processes? I can actually imagine that, for multi-process compilation, it would make sense to (only) capture all output from a single compilation command and then write that output atomically (rather than letting the compiler write to os.stdout/stderr directly, with the risk of interleaving)?


if!objIsUpToDate {
_,_,err=ExecRecipe(ctx,properties,recipe,false/* stdout */,utils.ShowIfVerbose/* stderr */,utils.Show)
_,stderrCache,err:=ExecRecipe(ctx,properties,recipe,false/* stdout */,utils.ShowIfVerbose/* stderr */,utils.Show)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

stderrCache implies (to me) that this is a previously cached value, whereas I believe this is the valueto be cached. Perhapsstderr orerrOutput is a better name?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

}
}elseifctx.Verbose {
logger.Println(constants.LOG_LEVEL_INFO,constants.MSG_USING_PREVIOUS_COMPILED_FILE,properties[constants.BUILD_PROPERTIES_OBJECT_FILE])
ctx.WarningsCache[source]=string(stderrCache)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we convert this to string? Can we not marshal a byte slice in JSON? Converting to string here, requires the use of UTF-8 (I think, at least). Probably not a problem in practice, but just keeping this a byte slice could be more transparent?

@facchinm
Copy link
MemberAuthor

@matthijskooijman there's a mutex that prevents interleaving when printing vialogger stream, but the fact that warnings are not getting interleaved right now looks like pure luck (or something I can't understand) 🙂 .
However, compilers are quite normal beasts, they don't mess up with terminal magic like some uploaders do, so I believe we can safely cache everything and print atomically when the command returns.

@ArduinoBot
Copy link
Contributor

✅ Build completed.

⬇️ Build URL:http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-302.zip

ℹ️ To test this build:

  1. Replacearduino-builder binary (you can find it where you installed the IDE) with the provided one

@facchinm
Copy link
MemberAuthor

@matthijskooijman I think I addressed all you concerns. At the end the interleaving only happens when the streams are crunched by the Java IDE (I'll take a closer look later), but they're fine when launched on a terminal.
Thanks a lot for the review!

@arduinoarduino deleted a comment fromArduinoBotOct 16, 2018
@arduinoarduino deleted a comment fromArduinoBotOct 16, 2018
Copy link
Collaborator

@matthijskooijmanmatthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good. Two more minor remarks added.

Are you planning to squash some of thes commits together before merging?

Show=1// Show on stdout/stderr as normal
ShowIfVerbose=2// Show if verbose is set, Ignore otherwise
Capture=3// Capture into buffer
Show=1// Print the stream
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps clarify that Show and ShowIfVerbose captures and then prints?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, I'm planning to cleanup the patchset as soon as all the issues are fixed 😉 Good catch!

CodeCompletionsstring

WarningsLevelstring
WarningsCachemap[string]string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I guess this should also be renamed to OutputCache or CompilerOutputCache or something?

This commits doesn't change the functionality of ExecCommand EXCEPT for programs that show progress bars or similar.For this kind of utilities, please use Stream "type"
This file should cache warnings and other compiler output between compilations.Directly maps to ctx.OutputCache map
The mutex is needed because the map could be concurrently accessed (when using parallel compilation)
@ArduinoBot
Copy link
Contributor

✅ Build completed.

⬇️ Build URL:http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-302.zip

ℹ️ To test this build:

  1. Replacearduino-builder binary (you can find it where you installed the IDE) with the provided one

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@matthijskooijmanmatthijskooijmanmatthijskooijman requested changes

@cmagliecmaglieAwaiting requested review from cmaglie

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

next

Development

Successfully merging this pull request may close these issues.

3 participants

@facchinm@ArduinoBot@matthijskooijman

[8]ページ先頭

©2009-2025 Movatter.jp