Details
-
Bug
-
Resolution: Fixed
-
P3
-
13
-
None
-
b27
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8226613 | 14 | Erik Joelsson | P3 | Resolved | Fixed | b03 |
JDK-8228237 | 13.0.2 | Erik Joelsson | P3 | Resolved | Fixed | b01 |
JDK-8228022 | 13.0.1 | Erik Joelsson | P3 | Resolved | Fixed | master |
Description
In a new build configuration, if the user hits tab to complete a make target before running any other make target, the generated file find-tests.gmk gets corrupted, causing tons of strange make debug output to be printed in the console on each subsequent make invocation.
This is caused by the tab completion script which invokes make with the -p flag (to print the make database), which FindTests.gmk inadvertently propagates into the call to TestMake.gmk where it extracts the test-make sub targets into find-test.gmk. This causes make to dump its database into find-test.gmk, which includes the definition of MAKEFLAGS with the value for -p set. After this, all calls to make will include find-tests.gmk, which will set MAKEFLAGS to a value including -p, causing make to spit out the database again and again.
The main problem here is that we rely on capturing stdout from calling a sub make target. This is a bad practice since there are plenty of ways the user may change what make prints. We have had trouble with this in the past and were already trying to protect ourselves from similar problems. I could not find an easy way to add protection against this particular flag, so instead, I'm changing TestMake.gmk to accept an input parameter for a target file to which the list of targets is printed to instead of stdout.
This is caused by the tab completion script which invokes make with the -p flag (to print the make database), which FindTests.gmk inadvertently propagates into the call to TestMake.gmk where it extracts the test-make sub targets into find-test.gmk. This causes make to dump its database into find-test.gmk, which includes the definition of MAKEFLAGS with the value for -p set. After this, all calls to make will include find-tests.gmk, which will set MAKEFLAGS to a value including -p, causing make to spit out the database again and again.
The main problem here is that we rely on capturing stdout from calling a sub make target. This is a bad practice since there are plenty of ways the user may change what make prints. We have had trouble with this in the past and were already trying to protect ourselves from similar problems. I could not find an easy way to add protection against this particular flag, so instead, I'm changing TestMake.gmk to accept an input parameter for a target file to which the list of targets is printed to instead of stdout.
Attachments
Issue Links
- backported by
-
JDK-8226613 find-files.gmk gets corrupted if tab completion is used before running make first
-
- Resolved
-
-
JDK-8228022 find-files.gmk gets corrupted if tab completion is used before running make first
-
- Resolved
-
-
JDK-8228237 find-files.gmk gets corrupted if tab completion is used before running make first
-
- Resolved
-