brioche-dev / brioche-packages

Brioche packages, which get auto-published to the Brioche Registry
MIT License
24 stars 1 forks source link

[Packaging] Fails to package PCRE2 due to missing libtool #45

Closed jaudiger closed 3 months ago

jaudiger commented 4 months ago

I was trying to package PCRE2. It seems that libtool is required to build it, since libtool is already part of the std.toolchain(), I think I'm missing something in my steps.

Experimental project (not final), but the current state demonstrates the issue:

import * as std from "std";

export const project = {
  name: "pcre2",
  version: "10.44",
};

const source = std
  .download({
    url: `https://github.com/PCRE2Project/pcre2/archive/refs/tags/pcre2-10.44.tar.gz`,
    hash: std.sha256Hash(
      "07a002e8216382a96f722bc4a831f3d77457fe3e9e62a6dff250a2dd0e9c5e6d",
    ),
  })
  .unarchive("tar", "gzip")
  .peel();

export default function (): std.Recipe<std.Directory> {
  let pcre2 = std.runBash`
    ./autogen.sh
    ./configure \\
      --enable-jit=auto \\
      --enable-utf8 \\
      --enable-pcre8 \\
      --enable-pcre16 \\
      --enable-pcre32 \\
      --enable-unicode-properties
    make
    make install DESTDIR="$BRIOCHE_OUTPUT"
  `
    .dependencies(std.toolchain())
    .workDir(source)
    .toDirectory();

  return std.setEnv(pcre2, {
    CPATH: { path: "include" },
    LIBRARY_PATH: { path: "lib" },
    PKG_CONFIG_PATH: { path: "lib/libpcre" },
  });
}

Output while packaging the project:

Looking for a version of libtoolize (which can have different names)...
Did not find glibtoolize
Did not find libtoolize15
Did not find libtoolize14
Did not find libtoolize
Can't find libtoolize on your system
jaudiger commented 4 months ago

I naively modified the file packages/std/toolchain/native/libtool.bri to append the following line to the bash command:

          set -euo pipefail

          tar -xf "$source" --strip-components=1 --no-same-owner --no-same-permissions

          ./configure --prefix=/
          make
          make install DESTDIR="$BRIOCHE_OUTPUT"
          rm -f "$BRIOCHE_OUTPUT"/lib/libltdl.a

          # Lines appended
          ln -s libtool "$BRIOCHE_OUTPUT"/bin/glibtool
          ln -s libtoolize "$BRIOCHE_OUTPUT"/bin/glibtoolize

But it didn't solve the problem. So, let's say I want to experiment with the std.toolchain(), what is the fastest way to debug what I'm doing? Should I just try to build the whole std package and inspect the output?

kylewlacy commented 4 months ago

So, let's say I want to experiment with the std.toolchain(), what is the fastest way to debug what I'm doing? Should I just try to build the whole std package and inspect the output?

Messing with the toolchain has been a pretty big pain point for me, it takes a long time to do a fresh build (~2 hours on my machine, about 5 in the GitHub Actions pipeline)

But yeah, running brioche build -p ./packages/std -e toolchain -o toolchain is an easy way to get a local copy of the toolchain to poke around with. That's usually my starting point when looking into issues like this

When a build fails, it'll usually output a path like $HOME/.local/share/brioche/process-temp/SOME_ID/stdout.log that contains stdout/stderr. The folder containing that file also has all the temporary build artifacts. Autotools-based builds usually dump more details in a config.log file, so running find to find that file within the process-temp folder can also be pretty insightful for a failing build

The extreme option is to use strace to try and get an idea of what went wrong. strace -fe "/exec" -s1024 -o strace.log -- brioche build ... is one of my go-tos: will save all calls to the exec syscalls, and will often be very verbose but can usually show what kinds of programs were run under the hood (failing compiler invocations, or seeing where a program like libtool was trying to get run from). strace is very powerful and the output is verbose, and it's probably been the most important debugging tool I've used for failing builds so far

jaudiger commented 4 months ago

Ok, I'll play around with what you proposed, and let you know if I find the culprit. I wanted initially to see for packaging Zsh and Git, and both optionally could use PCRE2. So, I switched my focus on this one.

jaudiger commented 4 months ago

I'm facing multiple issues here, and I think I reach a point where I'm stuck by my development environment.

What I tried so far:

  1. Building locally the toolchain: brioche build -p ./packages/std -e toolchain -o toolchain but I'm facing issue with permission:
    
    Build finished, completed (no new jobs) in 4.04s
    Result: bb53690d859a874183e8a2b071eadbe73c5402bf33bf8359c2f1cc701ee13d54
    Writing output
    Error: failed to set output file permissions

Caused by: Permission denied (os error 13)

2.  So I tried to trace the system calls. During my first attempt, executing `strace` was leading to some sort of symbol name mangling. So, I tried multiple other tools to see if it was reproducible, and even switched from a Fedora Docker image to an Ubuntu Docker image. At the end, I was still having the same issue, and thus, with the impossibility to interpret the report of strace. 
3. And then came an idea, to disable macOS Rosetta to use the QEMU emulation provided by Docker. By relying on [QEMU user space](https://www.qemu.org/docs/master/user/main.html), and executing "QEMU_STRACE=1 brioche build -p ./packages/std -e toolchain -o toolchain", the magic happened. Which led me to this error: `117 futex(0x00002aaaab646f78,FUTEX_PRIVATE_FLAG|FUTEX_WAIT,1,NULL,0x000055555a981800,1519917056)117 chmod("toolchain/brioche-resources.d/blobs/1ff502b39a13bb090941f760393ed962b3764e72ee7bf182844e3e36f8b17b57.x",0755) = -1 errno=13 (Permission denied)`
4. But, because there is always a but, since I wasn't able to build the toolchain locally, I decided to give a try to QEMU emulation instead of macRosetta for x86 to build PCRE2 and using strace mechanism from QEMU. But to my surprise, it began to fail earlier in the process:
```bash
brioche build -p ./packages/pcre2                        
 INFO build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake_process: brioche_core::bake::process: keeping temporary bake dir /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f")) } recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16")) } recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f")) } recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process scope=Child { parent_hash: RecipeHash(Hash("277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8")) } recipe_hash=aae206847bd34c0350baf2dd931f2a2b84cb359f6f1a56a1af1d378171a39659 recipe_kind=CompleteProcess recipe_hash=aae206847bd34c0350baf2dd931f2a2b84cb359f6f1a56a1af1d378171a39659 recipe_kind=CompleteProcess meta=Meta { source: None }
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f")) } recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16")) } recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f")) } recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process scope=Child { parent_hash: RecipeHash(Hash("277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8")) } recipe_hash=aae206847bd34c0350baf2dd931f2a2b84cb359f6f1a56a1af1d378171a39659 recipe_kind=CompleteProcess recipe_hash=aae206847bd34c0350baf2dd931f2a2b84cb359f6f1a56a1af1d378171a39659 recipe_kind=CompleteProcess
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f")) } recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16")) } recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f")) } recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process recipe_hash=277b744bacd61f148f432aebba20bd9c8844a61e8bf641ac67fd22e9e0c8cde8 recipe_kind=Process
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f")) } recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16")) } recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast recipe_hash=b63e2f72d2b678876a2ca4a43b2ed79155b0f61078a47aacff78a5efc368af7f recipe_kind=Cast
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f")) } recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy recipe_hash=b9450fd221621df67831713ca605e7ae291599de95eff1eb2840e2c01dd82d16 recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e")) } recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert recipe_hash=ec43b29f5baea58999073340bbc4e4e2ba4d6a883305dc80e1fa6a119420375f recipe_kind=Insert
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2")) } recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy recipe_hash=9c31badf99ebbacb386ca3b842e1b382951bd0c7bab20223577ddcabc0f3942e recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3")) } recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert recipe_hash=ba1d42381f5c161a235e324e611f2c259ca3694725be9615637d6adc659d3ab2 recipe_kind=Insert
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6")) } recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy recipe_hash=cfb2500ddd174c210ecce4562dc22af7ccc0c22664c0e1344ccaa3f0d31ba0e3 recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21HPE118EFEXDT50RCCAY3E/stderr.log: process exited with status code exit status: 122 scope=Project { project_hash: ProjectHash(Hash("cd7d3af8d6c7b816c277e6e79a614a7a610eceb006447d25c8f9ef1a91529d16")), export: "default" } recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert recipe_hash=3269d32e7866b77924f5be487dc6c79874356e4e4b42418dffcf8c1d924406f6 recipe_kind=Insert
[261] brioche: failed to run sandbox: failed to spawn sandbox: error when forking: No such file or directory (os error 2)

While with macOS Rosetta, I have the error described at the top of this issue:

brioche build -p ./packages/pcre2     
 INFO build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake_process: brioche_core::bake::process: keeping temporary bake dir /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6")) } recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4")) } recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08")) } recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process scope=Child { parent_hash: RecipeHash(Hash("183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5")) } recipe_hash=da554719a407e5a06545a2b9aeab6c6fe17b4864da12c09cd42c19d4b5db3a5c recipe_kind=CompleteProcess recipe_hash=da554719a407e5a06545a2b9aeab6c6fe17b4864da12c09cd42c19d4b5db3a5c recipe_kind=CompleteProcess meta=Meta { source: None }
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6")) } recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4")) } recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08")) } recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process scope=Child { parent_hash: RecipeHash(Hash("183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5")) } recipe_hash=da554719a407e5a06545a2b9aeab6c6fe17b4864da12c09cd42c19d4b5db3a5c recipe_kind=CompleteProcess recipe_hash=da554719a407e5a06545a2b9aeab6c6fe17b4864da12c09cd42c19d4b5db3a5c recipe_kind=CompleteProcess
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6")) } recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4")) } recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast scope=Child { parent_hash: RecipeHash(Hash("f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08")) } recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process recipe_hash=183b7effc84202ea90e8588543809111356db5b06777dfc9181d766576db11c5 recipe_kind=Process
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6")) } recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4")) } recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast recipe_hash=f58462fde83e5a831ca027e6c8ebebce57574283af928f1c334fda7654f70d08 recipe_kind=Cast
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6")) } recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy recipe_hash=9cddf801c08de647d091336d1a988b32b8f72a60e757041d4ef10af21fed10f4 recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411")) } recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert recipe_hash=8d27423bbf7ffefdba9377be88de273a4f73ceaf87775010ec72eb4274e656c6 recipe_kind=Insert
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929")) } recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy recipe_hash=cd8b5e545fae736c07188b4f07050278b9c8e0af67efdc9d1c7c95d6d5156411 recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy scope=Child { parent_hash: RecipeHash(Hash("de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1")) } recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert recipe_hash=de151f36eadd6f415cbc8c615bfd65bd7953fb0ee40d0080623d721c4666c929 recipe_kind=Insert
ERROR build:bake:bake_inner:run_bake:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert scope=Child { parent_hash: RecipeHash(Hash("96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419")) } recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy recipe_hash=de91e320b0a396abcca61923e936ab56b75d5edbd704a00951c4c4a1e0125cd1 recipe_kind=Proxy
ERROR build:bake:bake_inner:run_bake: brioche_core::bake: error=process failed, view full output from these paths:
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stdout.log
- /home/container/.local/share/brioche/process-temp/01J21NSEFXHHGHW10Q1A5XSFAY/stderr.log: process exited with status code exit status: 1 scope=Project { project_hash: ProjectHash(Hash("0ac3270accc08b76c11e275a44ee684dfc645f4e70dac8cc027057fcfd7ca0ce")), export: "default" } recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert recipe_hash=96007c6c2fabbaedda66e0123470bdc43d312f1a68edbc4da917cafe0794d419 recipe_kind=Insert
[1387] Looking for a version of libtoolize (which can have different names)...                                                                                                                                                                                                                          
[1387] Did not find glibtoolize                                                                                                                                                                                                                                                                         
[1387] Did not find libtoolize15                                                                                                                                                                                                                                                                        
[1387] Did not find libtoolize14                                                                                                                                                                                                                                                                        
[1387] Did not find libtoolize                                                                                                                                                                                                                                                                          
[1387] Can't find libtoolize on your system

So, I'm a bit stuck. I can't use strace tooling whenever I want, and I get this strange permission while building the toolchain.

jaudiger commented 4 months ago

Report progress (basically the same applies to #50) except for the first bullet point:

  1. Issue: libtool not found
[1387] Looking for a version of libtoolize (which can have different names)...                                                                                                                                                                                                                          
[1387] Did not find glibtoolize                                                                                                                                                                                                                                                                         
[1387] Did not find libtoolize15                                                                                                                                                                                                                                                                        
[1387] Did not find libtoolize14                                                                                                                                                                                                                                                                        
[1387] Did not find libtoolize                                                                                                                                                                                                                                                                          
[1387] Can't find libtoolize on your system

-> Use autoreconf from autotools: autoreconf --install --force --verbose instead of the script from PCRE2: autogen.sh

  1. Issue: LIBTOOL env var is undefined
[3670] Generating autotools files.                                                                                                                                                                                                                                                                      
[3670] src/Makefile.am:24: error: Libtool library used but 'LIBTOOL' is undefined                                                                                                                                                                                                                       
[3670] src/Makefile.am:24:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'                                                                                                                                                                                                                      
[3670] src/Makefile.am:24:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.                                                                                                                                                                                                                  
[3670] src/Makefile.am:24:   If 'LT_INIT' is in 'configure.ac', make sure                                                                                                                                                                                                                               
[3670] src/Makefile.am:24:   its definition is in aclocal's search path.                                                                                                                                                                                                                                
[3670] autoreconf: error: automake failed with exit status: 1

-> Define the env var: ACLOCAL_PATH:

ACLOCAL_PATH: std.tpl`${std.toolchain()}/share/aclocal`
  1. autoheader is not found:
[11607] autoreconf: running: /home/brioche-runner-4ce9353aad7eb028101e4cdbd77dc588848d81999fcde4f838b086030ba7ce8c/.local/share/brioche/locals/a7a6f37bec0b363bcdd227b6fdfc32e2ba0dcd910c93c44eeb3
3f08b8c40aeb4/bin/autoconf --force                                                                                                                                                                
[11607] autoreconf: running: //bin/autoheader --force                                                                                                                                             
[11607] Can't exec "//bin/autoheader": No such file or directory at /home/brioche-runner-4ce9353aad7eb028101e4cdbd77dc588848d81999fcde4f838b086030ba7ce8c/.local/share/brioche/locals/a7a6f37bec0b
363bcdd227b6fdfc32e2ba0dcd910c93c44eeb33f08b8c40aeb4/share/autoconf/Autom4te/FileUtils.pm line 274.                                                                                               
[11607] autoreconf: error: //bin/autoheader failed with exit status: 2

-> Define the env var: AUTOHEADER:

AUTOHEADER: std.tpl`${std.toolchain()}/bin/autoheader`
  1. sed is not found:

By looking at the shell script libtool, some packages are overridden, and by looking manually at the location defined in the script, they are not present on the filesystem: libtool.txt (extracted locally)

image
[12425] /home/brioche-runner-648a721188ea9409265a9ddaa01e7bc94fb9f46eea7956d9893a2e7c04f2e1fe/.local/share/brioche/locals/db870c9d08b5fd35d4ccbabe2a3d5640a0fadae4ab36027f2de9c9a1c7cd26b5/bin/lib
toolize: line 449: /home/brioche-runner-1d18e630079dda5240527bdd5dc5bcb91fe783e8760b53671ae554ba32c27230/.local/share/brioche/locals/59ff16ad477bb71010278c903ee7bbfa2f1310e1057a68165edff8df75cca
fa1/bin/sed: No such file or directory                                                                                                                                                            
[12425] /home/brioche-runner-648a721188ea9409265a9ddaa01e7bc94fb9f46eea7956d9893a2e7c04f2e1fe/.local/share/brioche/locals/db870c9d08b5fd35d4ccbabe2a3d5640a0fadae4ab36027f2de9c9a1c7cd26b5/bin/lib
toolize: line 800: /home/brioche-runner-1d18e630079dda5240527bdd5dc5bcb91fe783e8760b53671ae554ba32c27230/.local/share/brioche/locals/59ff16ad477bb71010278c903ee7bbfa2f1310e1057a68165edff8df75cca
fa1/bin/sed: No such file or directory                                                                                                                                                            
[12425] :   error: $pkgauxdir is not a directory: '//share/libtool/build-aux'                                                                                                                     
[12425] autoreconf: error: libtoolize failed with exit status: 1

-> Define the env var: SED:

SED: std.tpl`${std.toolchain()}/bin/sed`
  1. The location of pkgauxdir is not correct:
[12699] autoreconf: export WARNINGS=                                                                                                                                                                                                                  
[12699] autoreconf: Entering directory '.'                                                                                                                                                                                                            
[12699] autoreconf: configure.ac: not using Gettext                                                                                                                                                                                                   
[12699] autoreconf: running: aclocal --force -I m4                                                                                                                                                                                                    
[12699] autoreconf: configure.ac: tracing                                                                                                                                                                                                             
[12699] autoreconf: running: libtoolize --copy --force                                                                                                                                                                                                
[12699] libtoolize:   error: $pkgauxdir is not a directory: '//share/libtool/build-aux'                                                                                                                                                               
[12699] autoreconf: error: libtoolize failed with exit status: 1

-> Update the prefix when calling ./configure of libtool:

          ./configure --prefix=/usr
          make
          make install DESTDIR="$BRIOCHE_OUTPUT"
  1. RANLIB and LIBTOOL are not defined. Here we go again, the issue with LIBTOOL seems to be back.
[13002] autoreconf: running: /home/brioche-runner-60e43b4d513944478a0123b13ce7a418960d3af44f3302918139b1556d879589/.local/share/brioche/locals/a7a6f37bec0b363bcdd227b6fdfc32e2ba0dcd910c93c44eeb33f08b8c40aeb4/bin/autoheader --force                
[13002] autoreconf: running: automake --add-missing --copy --force-missing                                                                                                                                                                            
[13002] configure.ac:61: installing './ar-lib'                                                                                                                                                                                                        
[13002] configure.ac:45: installing './compile'                                                                                                                                                                                                       
[13002] configure.ac:709: installing './config.guess'                                                                                                                                                                                                 
[13002] configure.ac:709: installing './config.sub'                                                                                                                                                                                                   
[13002] configure.ac:28: installing './install-sh'                                                                                                                                                                                                    
[13002] configure.ac:28: installing './missing'                                                                                                                                                                                                       
[13002] Makefile.am: installing './INSTALL'                                                                                                                                                                                                           
[13002] Makefile.am:571: error: library used but 'RANLIB' is undefined                                                                                                                                                                                
[13002] Makefile.am:571:   The usual way to define 'RANLIB' is to add 'AC_PROG_RANLIB'                                                                                                                                                                
[13002] Makefile.am:571:   to 'configure.ac' and run 'autoconf' again.                                                                                                                                                                                
[13002] Makefile.am:227: error: Libtool library used but 'LIBTOOL' is undefined                                                                                                                                                                       
[13002] Makefile.am:227:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'                                                                                                                                                                      
[13002] Makefile.am:227:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.                                                                                                                                                                  
[13002] Makefile.am:227:   If 'LT_INIT' is in 'configure.ac', make sure                                                                                                                                                                               
[13002] Makefile.am:227:   its definition is in aclocal's search path.                                                                                                                                                                                
[13002] Makefile.am: installing './depcomp'                                                                                                                                                                                                           
[13002] parallel-tests: installing './test-driver'                                                                                                                                                                                                    
[13002] autoreconf: error: automake failed with exit status: 1
jaudiger commented 4 months ago

@kylewlacy I think, most of the fixes I did should not have been done. I was just trying to see the root cause of all of that. But looking at the last point made me think about the following question: why do we set the root path as the prefix when calling the configure script?

LFS sets it to /usr. Not sure that we can do that here, but, at least, some autotools from the investigation done this weekend seem not to concatenate the path correctly when the prefix is set to the root path.

kylewlacy commented 3 months ago

But looking at the last point made me think about the following question: why do we set the root path as the prefix when calling the configure script?

So... the prefix is kind of meaningless in Brioche because we tweak software so that it works portably. Basically, I chose / as the prefix because I wasn't sure what would happen in this case:

./configure --prefix=/usr
make
make install DESTDIR="$BRIOCHE_OUTPUT"

Does the result get put in $BRIOCHE_OUTPUT or $BRIOCHE_OUTPUT/usr? I'm still not sure off the top of my head (and I'm not sure if every package will do the same thing). Using / was an easy lazy way to make sure it always ended up directly in $BRIOCHE_OUTPUT. I'd definitely be open to using something else as the "common" prefix, or even tweaking it per package as needed.

Once I get to the other side of the refactoring I'm working on (still running into some painful issues), I'll be sure to start looking into libtool soon, and the prefix will probably be the first place I start

jaudiger commented 3 months ago

I see. I'll tweak it to test different things in the coming days, and give you the result here.

jaudiger commented 3 months ago

I did the testing today.

  1. Without the prefix option:
./configure
make
make install DESTDIR="$BRIOCHE_OUTPUT"

As expected, everything was written inside $BRIOCHE_OUTPUT/usr/local:

$BRIOCHE_OUTPUT/usr/local/bin/
$BRIOCHE_OUTPUT/usr/local/lib/
$BRIOCHE_OUTPUT/usr/local/share/
...
  1. With --prefix=/
./configure --prefix=/
make
make install DESTDIR="$BRIOCHE_OUTPUT"

And now everything was written inside $BRIOCHE_OUTPUT:

$BRIOCHE_OUTPUT/bin/
$BRIOCHE_OUTPUT/lib/
$BRIOCHE_OUTPUT/share/
...
  1. With --prefix=/tmp (for the fun)
./configure --prefix=/tmp
make
make install DESTDIR="$BRIOCHE_OUTPUT"

Finally, everything was written inside $BRIOCHE_OUTPUT/tmp:

$BRIOCHE_OUTPUT/tmp/bin/
$BRIOCHE_OUTPUT/tmp/lib/
$BRIOCHE_OUTPUT/tmp/share/
...

The only impact, it has at the end, is where the files are located inside BRIOCHE_OUTPUT folder. And thus, where are the runnables links, libs, etc.

I tweaked the recipe of tcsh locally to:

export default function (): std.Recipe<std.Directory> {
  const tcsh = std.runBash`
    ./configure \\
      --prefix=/usr
    make
    make install DESTDIR="$BRIOCHE_OUTPUT"
  `
    .dependencies(std.toolchain())
    .workDir(source)
    .toDirectory();

  return std.withRunnableLink(tcsh, "usr/bin/tcsh");
}

And it continued to work as expected by updating to the correct location for the binary (testing command was brioche run -p packages/tcsh). So maybe, we should not use the root path for the installation/run directory. And rely on the more common folders such as /usr, /usr/local, ...

kylewlacy commented 3 months ago

I took a look today and made some progress without touching std.toolchain() or any of the build prefixes. Here's what I got to for PRCE2 (still fails to build):

import * as std from "std";

export const project = {
  name: "pcre2",
  version: "10.44",
};

const source = std
  .download({
    url: `https://github.com/PCRE2Project/pcre2/archive/refs/tags/pcre2-10.44.tar.gz`,
    hash: std.sha256Hash(
      "07a002e8216382a96f722bc4a831f3d77457fe3e9e62a6dff250a2dd0e9c5e6d",
    ),
  })
  .unarchive("tar", "gzip")
  .peel();

export default function (): std.Recipe<std.Directory> {
  let pcre2 = std.runBash`
    mkdir -p "$TMPDIR"/pkgdatadir
    ln -s "$toolchain/share/libtool/build-aux" "$TMPDIR"/pkgdatadir/build-aux
    ln -s "$toolchain/share/libtool" "$TMPDIR"/pkgdatadir/libltdl
    ln -s "$toolchain/share/aclocal" "$TMPDIR"/pkgdatadir/m4
    export _lt_pkgdatadir="$TMPDIR/pkgdatadir"

    ./autogen.sh
    ./configure \\
      --enable-jit=auto \\
      --enable-utf8 \\
      --enable-pcre8 \\
      --enable-pcre16 \\
      --enable-pcre32 \\
      --enable-unicode-properties
    make
    make install DESTDIR="$BRIOCHE_OUTPUT"
  `
    .workDir(source)
    .dependencies(std.toolchain())
    .env({
      EGREP: "grep -E",
      FGREP: "grep -F",
      GREP: "grep",
      SED: "sed",
      toolchain: std.toolchain(),
      ...autotoolsEnv(),
    })
    .toDirectory();

  return std.setEnv(pcre2, {
    CPATH: { path: "include" },
    LIBRARY_PATH: { path: "lib" },
    PKG_CONFIG_PATH: { path: "lib/libpcre" },
  });
}

// HACK: This should be removed once `std.toolchain()` properly sets
// these variables for autotools
function autotoolsEnv(): Record<string, std.ProcessTemplateLike> {
  return {
    M4: std.tpl`${std.toolchain()}/bin/m4`,
    AUTOM4TE: std.tpl`${std.toolchain()}/bin/autom4te`,
    trailer_m4: std.tpl`${std.toolchain()}/share/autoconf/autoconf/trailer.m4`,
    PERL5LIB: std.tpl`${std.toolchain()}/share/autoconf:${std.toolchain()}/share/automake-1.16`,
    autom4te_perllibdir: std.tpl`${std.toolchain()}/share/autoconf`,
    AC_MACRODIR: std.tpl`${std.toolchain()}/share/autoconf`,
    ACLOCAL_AUTOMAKE_DIR: std.tpl`${std.toolchain()}/share/aclocal-1.16`,
    AUTOMAKE_UNINSTALLED: "1",
    AUTOCONF: std.tpl`${std.toolchain()}/bin/autoconf`,
    AUTOMAKE_LIBDIR: std.tpl`${std.toolchain()}/share/automake-1.16`,
  };
}

Basically what I tried was setting $SED, $GREP, $EGREP, $FGREP and $_lt_pkgdatadir all from libtoolize (plus I threw in a set of env vars for autotools). I could find a good value to set for $_lt_pkgdatadir yet so I basically constructed a temp dir with some symlinks for now, but if that ultimately ends up working, then there should be something in std.toolchain() directly for this

kylewlacy commented 3 months ago

Ah okay I got it building by just tweaking the ./configure options above, the diff is basically this:

-      --enable-pcre8 \\
-      --enable-pcre16 \\
-      --enable-pcre32 \\
+      --enable-pcre2-8 \\
+      --enable-pcre2-16 \\
+      --enable-pcre2-32 \\
kylewlacy commented 3 months ago

So some thoughts: it looks like the PCRE build was failing because libtoolize embeds absolute paths in the scripts that it provides, which will break stuff in Brioche (just nothing else was using libtoolize until now, I guess). This is one thing that Brioche doesn't really handle well, and can't really ever handle well. Luckily in this case libtoolize has some env vars to work around it, but there will probably be some program that we eventually run into that requires a patch to avoid absolute paths

jaudiger commented 3 months ago

Thanks for the investigation. When I was setting these env vars to set the location of these tools, I thought there was something wrong, I was suspected that it was not the right approach. Overriding all these tools' location was uncomfortable, but if they are given as absolute path in libtoolize I guess we can't work around differently than setting those. Luckily, we can override them through this approach (without patching libtoolize).

Ah okay I got it building by just tweaking the ./configure options above, the diff is basically this:

-      --enable-pcre8 \\
-      --enable-pcre16 \\
-      --enable-pcre32 \\
+      --enable-pcre2-8 \\
+      --enable-pcre2-16 \\
+      --enable-pcre2-32 \\

My fault 😆