Oily Pine 2 - Throwing log-files at ChatGPT

Author: Samuel Hierholzer Date: 01 Jan 2026

This is the second article in a miniseries of 3 Blog posts:

Intro

I started the Oily Pine project in a try to build all Alpine Linux Packages using OSH as shell.

In the last article I’ve shown how to set up a build environment and finished the article with a first run. This first run resulted in 5327 successfully built packages until the disk filled up, with 1173 failed packages. Since we want to make OSH behave like Busybox Ash, we only care about the failed packages.

Analyzing 1173 failed package builds manually one by one is a bit much, though. As visible in this walk-through of a bugfix by Aidan Olsen, the procedure can take a few hours for a single package.

Luckily, we can assume that many bugs occur in more than just one package. Briefly looking into just a few logs I could confirm that some errors seemed to happen repeatedly. So instead of jumping straight into deep analysis package by package, we can skim the logs and categorize the errors. In the best case we’ll only need to look into a single log-file per category to know how all of them failed. And we can start with the most prevalent bugs first to get the number down as fast as possible. But even if we only need half a minute to categorize a log-file, it’s still almost 10 hours of staring at log files.

But what could be better to churn through so much text and categorize it? A machine?… AI?! I’ve only used LLMs for output that was verifiable code or translations, but this time the LLM would be “the program” (instead of writing the program)!

Let’s try.

Talking to ChatGPT

So I wrote a small script to send the last 40 lines of each log-file to ChatGPT and try to summarize the problem in maximum 5 words. I wrote the script in YSH, because it has a few features which made the below 16 lines of code a bit extra nice. Since the whole project is about the Oils project, I also like to give you a bit of a showcase/intro into the non-POSIX compliant part of Oils. I really believe in it as a path forward from the minefield that POSIX shell is.

# simplified categorization-script

#!/usr/bin/env ysh

# *generate a list of log files with errors from the builrepo log files*
var bad_log_files = glob("/path/to/folder/with/failed/logs/*")

for file in (bad_log_files) {
  ... cat ./PROMPT_TEMPLATE.md
      # Ignore all lines from abuild removing packages at the end
    <(... grep -v "Purging" $file | head -n -1
      # the error should be in the last few lines.
      # chatgpt can't handle too much input!
      | tail -40
      ;)
    | chatgpt
    | tr -d u'\n'
    >> $out_file;

  # Add a newline
  echo >> $out_file
}

The first line shows us how variable assignments work in YSH:

var bad_log_files = glob("/path/to/folder/with/failed/logs/*")

In bash, it would be bad_log_files=("/path/to/folder/with/failed/logs/"*) (note the * being outside the quotes). In POSIX the only sane way is to not store it in a variable: for file in /path/to/folder/with/failed/logs/*. At a first glance YSH looks just more verbose. But what actually happens is that after the = YSH enters an expression-mode, which has functions (like glob) and is dynamically typed like Python or JavaScript. Unquoted globs are not possible in that expression mode, because it would conflict with mathematical multiplication (e.g. var x = 5*5 is 25, NOT a list of files starting and ending with a 5).

The expression mode is probably the biggest difference from POSIX shell to YSH. At first it seems somewhat random and hard to understand when YSH switches from shell-like “Command Mode” to the “Expression Mode”, but it doesn’t require much practice to become an intuition. The Vim Syntax Highlighter can also be a big help, as it changes the color for the expression mode. (A Pygments highlighter I could use for this blog is still an open to-do).

Now let’s look at the for loop:

for file in (bad_log_files) {

}

In YSH that’s how a typical for loop looks like. Inside of the parentheses () YSH enters expression mode again and expects either a list or dict from the expression.

Another option would be to stay in the command mode and use for file in @bad_log_files { ... }. This @mylist syntax comes from Perl - though YSH only knows the two sigils $ and @ (and they use the same namespace). @bad_log_files is roughly comparable to "${bad_log_files[@]}" and adds all list elements as arguments (without word splitting!).

This also shows the backwards-compatibility of YSH and the focus on only changing/extending where necessary. It’s still perfectly valid to use a POSIX test like if test -f myfile.

The two ... in the following block allow us to define a single command spanning across multiple lines. This spares us the ` \ ` at the end of each line and allows us to put comments in between:

  ... cat ./PROMPT_TEMPLATE.md
      # Ignore all lines from abuild removing packages at the end
    <(... grep -v "Purging" $file | head -n -1
      # the error should be in the last few lines.
      # chatgpt can't handle too much input!
      | tail -40
      ;)
    | chatgpt
    | tr -d u'\n'
    >> $out_file;

So these lines are really just one command-chain, including a subcommand. It does the exact same thing as this POSIX-compatible one-liner:

cat ./PROMPT_TEMPLATE.md <(grep -v "Purging" $file | head -n -1 | tail -40) | chatgpt | tr -d u'\n' >> $out_file;

The command chain does the following:

On this note; I used a chatgpt-cli written in Golang, which I installed with the following command:
curl -L -o chatgpt https://github.com/kardolus/chatgpt-cli/releases/latest/download/chatgpt-linux-amd64 && chmod +x chatgpt && sudo mv chatgpt /usr/local/bin/
          
That’s really not how I usually install software (especially when it comes to LLM stuff), and I urge you to not just install random binaries from GitHub. But after trying and failing with a few other ChatGPT (and Claude) CLI tools, this worked. And so I just stuck with it for that experiment. I did that in the spring of 2025, on an EOL Debian, so there are definitely better ways to access an LLM from the command line. <br > ChatGPT also wants an access token, so I logged into the OpenAI API Platform and created a token there. I like that it doesn’t have a subscription fee but a pay-per use model (and the ability to set a monthly limit).

Regarding the PROMPT_TEMPLATE.md; I’m not (yet) a prompt Engineer. So I copied a prompt from a random blog post and quickly adjusted it to fit my needs. It’s not good, and I didn’t even test if a single sentence instruction would’ve been enough. I just pretended that using an LLM correctly requires a long prompt:

# IDENTITY and CATEGORY
You are a genius error message categorization expert and you are able to understand and categorize errors from software being compiled for Linux.
You specialize in extracting the relevant error messages from a log file and create a very brief category for the error.
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.

You have no knowledge on what to do with the error message. Your only purpose is to categorize it.

# STEPS
Read the entire log file from an attempted package compilation, trying to identify the exact log line containing the error message which causes the build to fail.
Come up with a description of this error type which is not more than 5 words, to be used as CATEGORY-DESCRIPTION.

# OUTPUT INSTRUCTIONS
Only output a single line of plain text.

Do not give warnings or notes; only output the requested 5 words.
Do not try to give a solution to the error.
You can only output a single sentence of 5 words.
Ensure you follow ALL these instructions when creating your output.

# INPUT
Logs:

And it worked! (mostly)

The output

I only categorized 506 logs from the main repo to not spend too much money initially. Then I created some stats to see how often ChatGPT used the same “5” words. I won’t spare the details, but you’re free to just scroll over it:

    179 c compiler cannot create executables.
     29 phdr segment not covered by load segment.
     13 phdr segment not covered error.
      9 compiler-executable creation error.
      9 c compiler unable to create executables.
      8 c compiler cannot create executables
      7 compiler cannot compile programs.
      7 builddeps failed due to conflicts.
      6 phdr segment not covered by load segment
      6 linker input file not found.
      6 dependency conflict - build failed.
      6 compiler gcc cannot compile programs.
      6 compiler-executable creation error
      5 c compiler executables creation failure
      4 ld returned 1 exit status.
      4 compiler cannot compile programs error.
      4 c compiler executables creation failed.
      4 build dependencies selection failed.
      3 phdr segment error during linking.
      3 linking error during compilation detected
      3 dependency selection error during build.
      3 dependency selection error during build
      3 c++ compiler cannot create executables.
      3 builddeps selection error due to dependencies.
      3 build dependencies selection failure.
      3 build dependencies failed due to conflict.
      2 phdr segment not covered by load.
      2 phdr segment coverage error during build
      2 package dependencies validation failed.
      2 missing dependency resolving error.
      2 linker segment load error unresolved.
      2 linker segmentation permissions error.
      2 linker error - build failed.
      2 gcc compilation failure detected
      2 dependency selection failed for builddeps.
      2 dependency resolution error: package conflict.
      2 compiler unable to create executables.
      2 compiler failed to generate executable.
      2 c compiler fails to compile.
      2 c compiler execution failure error
      2 c compiler execution failure detected
      2 c compiler execution error - build failed.
      2 builddeps selection error: dependencies conflict.
      2 builddeps resolution failure due to conflicts.
      1 unpack failure - checksum mismatch error.
      1 undefined reference in linking process.
      1 undeclared functions causing compilation failure.
      1 unable to detect lua library.
      1 this program requires newer bash.
      1 this program requires bash 4.0.
      1 the compiler failed to generate an executable file.
      1 test suite failure, check error.
      1 test suite check failed.
      1 tests exit prematurely, check failed.
      1 test failure during check.
      1 test case premature exit failure
      1 test case assertion error.
      1 test and dependency handling errors.
      1 static 'setns' redefined, build failed.
      1 simple c program not found.
      1 rwx permissions on load segment.
      1 required symbol 'yaml_document_initialize' not found.
      1 redefinition and conflicting types build error.
      1 prepare error - autopoint failed.
      1 premature exit; test case error.
      1 phdr segment uncovered by load.
      1 phdr segment missing in link.
      1 phdr segment load error - build failure.
      1 phdr segment error in ld
      1 phdr segment error during build.
      1 phdr segment configuration build failure
      1 perl-tk build failed.
      1 packages selection conflict detected: builddeps_failed
      1 package dependencies validation error.
      1 openssl linking error during build.
      1 no error causing the build fail.
      1 no 16 bit type error
      1 missing stdint header in code.
      1 missing makefile, build process failed.
      1 mariadb: fetch failed from server.
      1 makefile not found build error.
      1 makefile error - build failed.
      1 makefile check failure error
      1 make: check failed with errors.
      1 load segment permissions error
      1 load segment permissions cause build failure.
      1 load segment permission issue in linking.
      1 linking errors due to undefined references.
      1 linking error in llvm compilation.
      1 linking error during compilation process.
      1 linker segment load error occurred.
      1 linker reference undefined - espk-bld-fd
      1 linker phdr segment error.
      1 linker issue, ld returned error.
      1 linker error - uwsgi build failed.
      1 linker error: undefined reference to functions
      1 linker error - rule not found.
      1 libev requirement not met.
      1 it seems like there were errors during the build process of the mpfr4 library. the errors indicate that the linker input file specified as "\\\-dlt_objdir=".libs/" was not found, resulting in the build failure.to address this issue, you may need to review the build configuration and ensure that the paths and flags provided to the compiler and linker are correct. specifically, check the way the output directory is specified and make sure it aligns with the structure expected by the build system.you may also want to review the makefile or the build scripts to see how the paths and flags are being set and adjust as needed. additionally, checking for any missing or incorrect dependencies that could be causing the linker input file not to be generated properly may be necessary.once you have reviewed and updated the build configuration accordingly, you can retry the build process to see if the issue has been resolved. if you encounter any further difficulties or need additional assistance, feel free to provide more details so i can offer more specific guidance.
      1 it seems like there were errors during the build process for `cgit`. the error message indicates problems with the ld linker related to the segments' permissions. here are a few suggestions to troubleshoot and potentially resolve the issue:1. **check load and phdr segments permissions**: review the linker script, object files, or options used during compilation and linking to ensure that the load segment permissions align with the phdr segment. make sure there are no conflicting permissions defined.2. **investigate ld warnings**: examine any warnings or notes produced by the ld linker. it may provide additional insights into the segmentation issues encountered during linking.3. **review linker options**: verify that the linker options and flags are correctly set during the linking phase. check if there are any conflicting or incorrect options that might cause the segmentation errors.4. **inspect build logs**: review the complete build logs to identify any earlier warnings or errors that could have led to the segmentation issues during linking. addressing any previous build problems might help resolve the current linker errors.5. **consult build dependencies**: ensure that all build dependencies, including libraries and headers, are correctly installed and accessible. sometimes, missing or incompatible dependencies can lead to linker issues.6. **compiler and linker version compatibility**: make sure that the compiler and linker versions are compatible. incompatibilities between the compiler and linker versions could lead to segmentation problems during linking.7. **seek help from the project community**: if troubleshooting the issue locally proves challenging, consider reaching out to the cgit project community or relevant forums for assistance. other developers might have encountered and resolved similar issues.by following these steps and investigating the build process further, you may be able to identify and address the root cause of the segmentation issues encountered during the linking phase of building `cgit`.
      1 it seems like there was an issue during the compilation process, resulting in the termination of the make commands. this can be caused by various factors, such as incorrect configurations, missing dependencies, or errors in the source code.to troubleshoot and resolve this issue, you can try the following steps:1. check for any error messages or warnings displayed during the compilation. these messages can provide clues about what went wrong.2. verify that all dependencies required for the compilation are properly installed on your system. make sure that all the necessary libraries and tools are available.3. review the source code files mentioned in the error messages, such as `_dd_to_di.c` and `_dd_to_usi.c`, to see if there are any syntax errors or other issues in the code.4. check the makefile and ensure that the build configurations are correct. make sure that the paths to include directories and libraries are set up properly.5. clean the build environment by running `make clean` and then try to rebuild the project using `make`.6. if the issue persists, you may need to seek help from the project's community or maintainers for further assistance.by following these steps, you should be able to diagnose and address the compilation issues to successfully build the project. if you encounter any specific errors or need further assistance, feel free to provide more details for a more targeted solution.
      1 it seems like there was an error during the build process of the program "ifupdown". specifically, the error message indicates issues with phdr segment not covered by load segment and a warning about rwx permissions.to address these errors, you may want to review the linker options related to the phdr segment and the permissions of the load segment. additionally, it could be beneficial to check the linker options being used and ensure they are compatible with the target system.if you need further assistance or guidance on resolving these build errors, feel free to provide more information or details about the target system and the build environment.
      1 it looks like there was an error during the installation process of the libxcb package. the error occurred while trying to install the man pages for the libxcb library. specifically, the error is related to the installation of the man pages for the xvmc (x-video motion compensation) extension in xcb (x c bindings) library.to troubleshoot this issue, you may want to check the following:1. verify that the man page files mentioned in the error message exist and have the correct permissions.2. ensure that the paths specified for the installation of the man pages are correct.3. check the permissions and ownership of the directories where the man pages are being installed.4. review the build logs for any additional error messages that might provide more context on the issue.if you continue to encounter issues with the installation, you may need to consult the documentation or support resources for libxcb to troubleshoot this specific problem further.
      1 it looks like there was an error during the building process of the botan library. the error message indicates that there are issues related to the program headers (phdr) and load segments. additionally, there is a warning about a load segment having read, write, and execute (rwx) permissions, which may contribute to the issue.to diagnose and resolve this error, you may need to check the linker script, build configuration, or the way the library is being built. here are some steps you could follow to troubleshoot and potentially fix the issue:1. **check the linker script**: review the linker script used during the build process. ensure that the phdr and load segments are properly defined and that the memory layout is correct.2. **review the build configuration**: double-check the compiler flags, linker options, and any scripts used during the build process. make sure that the options are appropriate for the target platform and that there are no conflicting settings causing the issue.3. **permissions of load segments**: as the warning indicated, having a load segment with rwx permissions can lead to issues. try to adjust the permissions to be more restrictive (e.g., removing the execute permission) if possible and necessary.4. **check for known issues**: search for any known issues or solutions related to the specific compiler, linker, or platform you are using. it's possible that others have encountered and documented similar issues.5. **build environment**: ensure that the build environment and toolchain are set up correctly for the target platform. inconsistent or incorrect configurations can lead to unexpected errors during the build process.6. **rebuild**: if you suspect that the error is due to a transient issue, try cleaning the build artifacts and rebuilding the library. sometimes, a fresh build can resolve intermittent problems.if the issue persists or if you need further assistance, feel free to provide more details about the build environment or any specific configurations you are using. this additional information can help in providing more targeted troubleshooting steps.
      1 it looks like the build process for the `cargo-auditable` project encountered errors and failed. the build script was unable to compile the dependencies `serde`, `proc-macro2`, `semver`, and `thiserror`.additionally, after the build failure, it seems an action to uninstall dependencies was triggered, specifically the uninstallation of `busybox-1.37.0-r12`.if you need help resolving the build errors or troubleshooting the issues with the project, please provide more details or specific error messages so that i can assist you further.
      1 it looks like the build process for `mdadm` encountered errors related to the linker, specifically issues with the phdr segment not being covered by the load segment, and the presence of a load segment with rwx permissions. these errors caused the build to fail for both `mdadm` and `mdmon`.to troubleshoot and resolve these issues, you may consider the following steps:1. **check build dependencies:**   ensure that all necessary dependencies for building `mdadm` are installed and up to date. sometimes missing or outdated dependencies can cause linker issues.2. **review build flags:**   review the linker flags and options used during the build process to ensure they are correct. make sure that the flags for stack protection, format security, and pie are set appropriately.3. **check compiler and linker versions:**   verify that the versions of the compiler (`gcc`) and linker (`ld`) being used are compatible with the build process. incompatibilities between tools can sometimes lead to linker errors.4. **investigate rwx permissions warning:**   the warning about a `load` segment with rwx permissions could indicate a potential security risk. review the linker options and the generated binary to ensure that the permissions are set correctly.5. **inspect binary output:**   after a failed build, it can be helpful to inspect the generated binary (`mdadm` and `mdmon`) to understand the structure and permissions of the segments. tools like `readelf` or `objdump` can be useful for this purpose.6. **look for relevant compiler and linker output:**   examine the full output from the compiler and linker to see if there are any other warnings or errors that might provide additional context about the failure.7. **search for similar issues:**   if the issue persists, consider searching online forums or issue trackers to see if others have encountered similar problems during the build of `mdadm`. solutions or workarounds from the community could help resolve the problem.by systematically addressing each of these points, you may be able to diagnose the cause of the linker errors and successfully build `mdadm` and `mdmon`. if you encounter any specific errors or need further assistance, feel free to provide additional details for tailored support.
      1 it looks like the build for `botan3` failed. the error message indicates that there was an issue with the `botan` binary, specifically related to phdr segment not being covered by load segment and the permissions associated with the load segment.to troubleshoot and resolve this issue, you may need to review the linker options, segment layout, and permissions set for the binary during the linking stage. double-check the linker flags (`-wl` options) and ensure that the binary is being linked correctly with the necessary segments and permissions.if you encounter this error, you may need to adjust the linker options or review the build process to ensure that the binary is being created correctly.if you need further assistance, please provide more details about the build environment, compiler options, and any custom settings that may be affecting the linking process.
      1 invalid word in parsing command.
      1 invalid package selection error.
      1 invalid command parsing error detected.
      1 invalid command line parsing error
      1 incompatible arguments for ac_output.
      1 http 404 fetch error occurred.
      1 gcc cannot compile programs.
      1 file build failed, uninstalling dependencies.
      1 fetch failed: http/1.1 404 not found.
      1 fetch failed, build dependency removal.
      1 failed to generate an executable.
      1 error occurred during the check.
      1 environment does not support soname.
      1 development dependencies selection error
      1 dependency selection error during builddeps.
      1 dependency selection conflict detected
      1 dependency issue with package selection.
      1 dependency conflict with gettext-dev package.
      1 dependency conflict resolution failure error
      1 dependency conflict resolution failure
      1 dependency conflict prevents build process.
      1 dependency conflict in package selection.
      1 dependency conflict found during build.
      1 dependency conflict detected: build failure
      1 dependency conflict detected - build failure.
      1 dependency conflict detected - bd-cnf
      1 dependency conflict - compilation error.
      1 dependency conflict causing build failure.
      1 connection reset during file download.
      1 conflict in build dependencies detected.
      1 compiler program compilation failure
      1 compiler "gcc" not working.
      1 compiler failure - gcc incompatibility
      1 compiler execution error during build
      1 compiler error in building pciutils.
      1 compiler-error: c compiler cannot create executables
      1 compiler error: cannot compile programs
      1 compiler-cannot create executables
      1 compile-error: c compiler cannot create executables
      1 compilation terminated due to input files error.
      1 compilation error; 'jack' build failed.
      1 command 'not found' error during test.
      1 checking simple c program: not found.
      1 check failed, uninstalling dependencies.
      1 c compiler unable to compile.
      1 c compiler inability error - build failure.
      1 c compiler gcc not found.
      1 c compiler failure - build error.
      1 c compiler fails to create executables.
      1 c compiler fails to build.
      1 c compiler execution issue - compilation failure.
      1 c compiler execution failure - build.
      1 c++ compiler execution error - build failed.
      1 c compiler executable creation error
      1 c-compiler cannot create executables.
      1 category-description: phdr segment not covered by load
      1 cannot create file: permission denied.
      1 build failed - error 2.
      1 build failed due to error.
      1 build failed due to configuration.
      1 builddeps failed: unable to select packages.
      1 builddeps failed: gettext-dev conflict.
      1 builddeps failed - dependencies unmet.
      1 builddeps conflict, uninstalling dependencies.
      1 build dependency conflict - compilation error.
      1 build dependencies validation failure error.
      1 build dependencies failed to resolve.
      1 build dependencies conflict error occurred.
      1 bash version requirement not met.
      1 at-spi2-core: build dependencies failed.
      1 amd64 as(1) feature detection enabled.

Well that was… interesting! Firstly, ChatGPT did NOT always listen to my instruction to use only 5 words. My assumption is that the LLM lost the context in the few cases where it produced huge amounts of text. At least some of these logs contained lines with over 1000 characters. I did also notice a log message that gives advice on debugging possible errors. This could cause a prompt injection and thus vastly different LLM output. But upon verification I couldn’t find the advice in any of the extreme outliers.

Looking at the categories themselves it’s obvious that there is something messed up with the compiler in my build environment.

Conclusion

The script worked and categorized my logs… Definitely not as good as manual categorization would’ve been, though. So, am I satisfied with the result?

Yes and no.

For the lacking quality - and the fact that on the second try there were only 215 failed packages to categorize - I switched to manual categorization after fixing the build environment. It took me around the same time to categorize 215 logs (with a script) as writing the script to generate the categories. So if I ever have to categorize >1000 logs, I’ll definitely try AI again.

The next blog post will focus on what efforts we took to create a reliable and fast build environment - which gives us good and simple metrics. Because Andy Chu secured an NLNet fund to support us in fixing all these issues, bringing Oils closer to being a real alternative Unix System shell.