question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

better patching documentation

See original GitHub issue

When many projects are processed and patched (like in a multi-module build with hundreds of modules), applying the patches is not straight-forward.

The one option is to setup the plugin with <arg>-Xplugin:ErrorProne -XepAllErrorsAsWarnings -XepPatchChecks:DefaultCharset -XepPatchLocation:${project.build.directory}</arg>

create a script

#/tmp/patchit
cd "$(dirname $1)/.."
patch -p1 -u -i target/error-prone.patch

and run

mvn verify -Perrorprone --threads=8
find . -iname error-prone.patch | xargs -I % -P 1 /tmp/patchit %

i couldn’t get patch -d option working, and note how I have to xargs -P 1

The other option is to create the patch file first as an append only file, and then build, apply, remove:

touch error-prone.patch
sudo chattr +a error-prone.patch
mvn verify -Perrorprone --threads=1
patch -p0 -u -i error-prone.patch
sudo chattr -a error-prone.patch
rm error-prone.patch

I suggestion one or both of the following:

  • add an “append to patch file” option to avoid the chattr stuff
  • add an option to apply the patch directly on the source files as with git this simply shows up as changes to the working tree and can be applied/rejected

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
delanymcommented, Aug 1, 2022

@Stephan202 thanks, by the logs it looks like it works, but now I cant get any patches to apply https://github.com/google/error-prone/issues/3349

0reactions
Stephan202commented, Dec 9, 2022

@delanym that could be implemented using a flag. But I’m not an Error Prone maintainer, so I’m not sure such a PR would be accepted. Let’s see whether any of the maintainers replies. 👀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Patch Management Documentation Program for MSPs
In this guide, we will overview the risks of bad documentation of patch management and the key points that you should keep in...
Read more >
What is Patch Management? Benefits & Best Practices - Rapid7
Patch management is the process of distributing and applying updates to software. These patches are often necessary to correct errors (also referred to...
Read more >
12 best patch management software and tools for 2022 By
Read descriptions of the 12 best patch management software and tools for 2022 so you ... The descriptions are based on vendor documentation....
Read more >
Recommended Practice for Patch Management of Control ...
This document was developed for the U.S. Department of Homeland Security (DHS) to provide guidance ... 2.1 Elements of a Good Patch Management...
Read more >
Patch Management Process Flow: 10 Key Steps - NinjaOne
Here's how IT pros can make their patch management process more efficient, ... Document any changes about to be made via patching.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found