Skip to content

Add support for caching stdout from MSVC - #962

Merged
jrosdahl merged 1 commit into
ccache:masterfrom
llunak:output-fixes
Dec 12, 2021
Merged

jrosdahl merged 1 commit into
ccache:masterfrom
llunak:output-fixes

Conversation

@llunak

@llunak llunak commented Nov 14, 2021

Copy link
Copy Markdown
Contributor

#954 redone without depending on MSVC support in #506 and with stdout in nocpp2 case fixed.

@llunak

llunak commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

Since #506 has been meanwhile merged, I've updated this to again be based on that and remove the output hacks from that PR.

Comment thread src/ResultRetriever.cpp Resolved
Comment thread src/ccache.cpp Resolved

@rvogg rvogg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The commit 193979f is still broken. If you run the test ./test/run cpp1, then the preprocessor output is written to the console.

@llunak

llunak commented Nov 17, 2021

Copy link
Copy Markdown
Contributor Author

The commit 193979f is still broken. If you run the test ./test/run cpp1, then the preprocessor output is written to the console.

In what setup?

@rvogg

rvogg commented Nov 17, 2021 •

Copy link
Copy Markdown
Contributor

The commit 193979f is still broken. If you run the test ./test/run cpp1, then the preprocessor output is written to the console.

In what setup?

The Error occurs on

  • Windows using
    • x86_64-w64-mingw32-gcc 11.2.0 (build and tests)
    • x86_64-w64-mingw32-clang 13.0.0 (build and tests)
  • On Ubuntu 20.04 using
    • gcc 9.3.0
  • On Manjaro Linux using
    • gcc 11.1.0
    • clang 12.0.1

The Error does not occur on

  • Windows using
    • cl as build compiler and clang x86_64-pc-windows-msvc for the tests.

@jrosdahl

Copy link
Copy Markdown
Member

Sorry if I was unclear in #954 (comment), but as I see it, adding support for caching stdout from the compiler is a generic new feature (not a fix of anything since nothing is broken). In contrast, handling newlines properly on Windows sounds like a bug fix. I would appreciate new features in standalone pull requests.

@rvogg

rvogg commented Nov 23, 2021

Copy link
Copy Markdown
Contributor

Sorry if I was unclear in #954 (comment), but as I see it, adding support for caching stdout from the compiler is a generic new feature (not a fix of anything since nothing is broken). In contrast, handling newlines properly on Windows sounds like a bug fix. I would appreciate new features in standalone pull requests.

I've open a standalone PR for the newline bugfix: #968
After integrating that, this one can be changed to the feature PR for "feat: Add stdout caching".

Comment thread src/ccache.cpp Resolved
@jrosdahl

Copy link
Copy Markdown
Member

I've open a standalone PR for the newline bugfix: #968 After integrating that, this one can be changed to the feature PR for "feat: Add stdout caching".

OK. Since I don't have much time for ccache right now (as you probably have noticed), I'll do some tweaks myself to speed up the turnaround time.

@jrosdahl jrosdahl changed the title Output fixes feat: Add support for caching stdout Nov 24, 2021
@jrosdahl jrosdahl added the issue: feature New feature label Nov 24, 2021
@jrosdahl jrosdahl added this to the 4.6 milestone Nov 24, 2021
@jrosdahl jrosdahl changed the title feat: Add support for caching stdout Add support for caching stdout Nov 24, 2021
@jrosdahl

Copy link
Copy Markdown
Member

I've now rebased the branch to latest master. I hope I didn't make any mistakes, but please check.

Some quick thoughts on the PR:

  • The Compiler produced stdout part of the manual needs to be updated since the description is no longer true. It would probably be OK to just remove it.
  • It would be very good with some integration tests for the new feature. Then you'll be able to catch the problem that @rvogg points out: We shouldn't cache stdout from the preprocessor.

@llunak
llunak force-pushed the output-fixes branch 2 times, most recently from 1e101ee to 6476f44 Compare November 28, 2021 17:10
MSVC outputs some messages to stdout instead of stderr, so cache
stdout in addition to stderr, and remove the merge-to-stderr hack.
@llunak

llunak commented Nov 28, 2021 •

Copy link
Copy Markdown
Contributor Author

The commit 193979f is still broken. If you run the test ./test/run cpp1, then the preprocessor output is written to the console.

That should work now.

  • The Compiler produced stdout part of the manual needs to be updated since the description is no longer true. It would probably be OK to just remove it.

I've added a note to it.

  • It would be very good with some integration tests for the new feature. Then you'll be able to catch the problem that @rvogg points out: We shouldn't cache stdout from the preprocessor.

The commit now includes a test that there's no extra stdout output.

@jrosdahl

Copy link
Copy Markdown
Member

Now when I read the PR more closely I realize that it only adds support for caching stdout from MSVC, not from any compiler like I originally envisioned. But that's OK, I'll look into that myself.

@jrosdahl jrosdahl changed the title Add support for caching stdout Add support for caching stdout from MSVC Dec 12, 2021
@jrosdahl jrosdahl added the compiler: msvc Related to Microsoft Visual C++ label Dec 12, 2021
@jrosdahl
jrosdahl merged commit d981aee into ccache:master Dec 12, 2021
@llunak
llunak deleted the output-fixes branch January 11, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler: msvc Related to Microsoft Visual C++ issue: feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants