CMake: Guard script configure_file() calls with ENABLE_SCRIPTS#210
CMake: Guard script configure_file() calls with ENABLE_SCRIPTS#210rzikm wants to merge 1 commit intotukaani-project:masterfrom
Conversation
The configure_file() calls for xzdiff, xzgrep, xzmore, and xzless were running unconditionally within the if(UNIX) block, even when ENABLE_SCRIPTS was OFF. This would cause a build failure if the src/scripts/*.in files were not present. Move the foreach loop inside the existing if(ENABLE_SCRIPTS) guard so that configure_file() is only called when scripts are actually being built and installed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The configure_file() calls for xzdiff, xzgrep, xzmore, and xzless were running unconditionally within the if(UNIX) block, even when ENABLE_SCRIPTS was OFF. This would cause a build failure if the src/scripts/*.in files were not present. Deleting those files can simplify license compliance when the scripts aren't needed. Move the foreach loop and related code inside if(ENABLE_SCRIPTS) guard so that configure_file() is only called when scripts are actually needed. This is most whitespace changes to adjust the indentation. Co-authored-by: Lasse Collin <lasse.collin@tukaani.org> Closes: #210
|
Thanks! I simplified it so that there is only one I noticed that a few issues were found in 124003 so I fixed those as well. The comment about The file descriptor comment is a false positive. Opening with the opposite modes is intentional. When sophisticated tools like static analyzers or LLMs are used to find and/or fix issues, mentioning it in the commit message might be good. However, When the work is very small in size (like this PR), it likely doesn't cross the copyrightability threshold. However, with bigger patches, the copyright status of LLM-generated works isn't clear to me, so I'm wary of accepting such patches for now. |
|
Hey, thanks for taking time to go through the linked .NET runtime PR.
LGTM!
I didn't give too much attention to those LLM review comments because the intent of that PR is to vendor the source code with as little modifications as possible (to simplify future updates). My impression is that on giant PRs like those (+50k LOC) it might be more prone to hallucinations due to insufficient context window.
I will pass that to relevant feedback channel. Personally, I would be fine with omitting it and keeping only myself as the commit author, as I would make the same change manually and wouldn't raise a generated PR that wouldn't be up to my standard. |
The configure_file() calls for xzdiff, xzgrep, xzmore, and xzless were running unconditionally within the if(UNIX) block, even when ENABLE_SCRIPTS was OFF. This would cause a build failure if the src/scripts/*.in files were not present (we do that since we want to only build liblzma and link it to our application and want to minimize vendored code size)
Move the foreach loop inside the existing
if(ENABLE_SCRIPTS)guard so that configure_file() is only called when scripts are actually being built and installed.