ProcursusTeam / Procursus

Modern *OS Bootstrap
https://apt.procurs.us
BSD Zero Clause License
860 stars 126 forks source link

`ninja` rootless patch incomplete #1428

Open L1ghtmann opened 5 months ago

L1ghtmann commented 5 months ago

When attempting to use ninja on a build.ninja file, I am getting no such file or directory errors.

Relevant test setup:

test
|-- build.ninja
`-- main.cpp

build.ninja:

# Variable declarations
cxx = /var/jb/usr/bin/clang++
src = main.cpp
out = main

# Build rule
rule cxx_compile
  command = $cxx -c $in -o $out

# Build edge
build $out.o: cxx_compile $src

# Link rule
rule cxx_link
  command = $cxx $in -o $out

# Link edge
build $out: cxx_link $out.o

Note: cxx = clang++ does not affect the end result

main.cpp:

#include<iostream>

int main(){
  std::cout << "Hello world!";
  return 0;
}

Error: [0/2] /var/jb/usr/bin/clang++ -c main.cpp -o main.oninja: fatal: posix_spawn: No such file or directory

It appears this error is actually slightly misleading, as explained in https://github.com/ninja-build/ninja/issues/1750. In this case, the issue likely spawns (ha) from https://github.com/ninja-build/ninja/blob/master/src/subprocess-posix.cc. Possibly a missing prefix error? Don't believe /dev/null is the issue, as it was in the linked issue.

Setup: iP7 15.8 Rootless