RFR: 8349933: Mixing of includes and snippets stack causes the wrong -post snippet to be included

Erik Joelsson erikj at openjdk.org
Wed Feb 12 20:42:20 UTC 2025


The new framework for tracing makefile inclusion has a bug. In the Make[Include|Snippet]End.gmk files, the variables THIS_INCLUDE and THIS_SNIPPET respectively are restored from the HELPER_STACK variable. The problem is that we can't know if the next item on the stack is a previous "include" or "snippet". In a complex tree of includes/snippets, this can cause the wrong custom -post file to get included.

My proposed fix is to split HELPER_STACK into two variables, INCLUDE_STACK and SNIPPET_STACK, so we keep track of which files were includes and which ones were snippets. When printing indentations we just concatenate these variables to get the total stack size.

This patch fixes the observed issue for me locally. I'm running extensive testing on it.

-------------

Commit messages:
 - JDK-8349933

Changes: https://git.openjdk.org/jdk/pull/23601/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23601&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349933
  Stats: 12 lines in 4 files changed: 0 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/23601.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23601/head:pull/23601

PR: https://git.openjdk.org/jdk/pull/23601


More information about the build-dev mailing list