philburk / pforth

Portable Forth in C
BSD Zero Clause License
602 stars 99 forks source link

cmake-based build does not work on Nixpkgs #153

Open AndersonTorres opened 1 year ago

AndersonTorres commented 1 year ago

Hello!

When I was updating pforth for nixpkgs (and using cmake for this), it failed with the following message:

[ 41%] Built target PForth_lib [ 44%] Building C object CMakeFiles/pforth.dir/csrc/pf_main.c.o [ 47%] Linking C executable fth/pforth [ 47%] Built target pforth [ 50%] pforth.dic PForth V2.0.0, LE/64, built Jan 1 1980 00:00:00 Including: system.fth pfIncludeFile could not open system.fth make[2]: [CMakeFiles/pforth_dic.dir/build.make:73: fth/pforth.dic] Error 255 make[1]: [CMakeFiles/Makefile2:132: CMakeFiles/pforth_dic.dir/all] Error 2 make: *** [Makefile:101: all] Error 2

Here is the full log: https://pastebin.com/jSqHJ1GV

Related issue (?): https://github.com/philburk/pforth/issues/106#issuecomment-1052200632

(On the other hand, the makefile-based approach works OK)

philburk commented 1 year ago

I don't know why that would fail. Is it possible the pforth repo was checked out while root? If you cd into pforth and then enter "pwd" can you see any spaces in the path? That might confuse CMake.

What happens if you try:

cd platforms/unix
make all
./pforth_standalone
AndersonTorres commented 1 year ago

I suspect it is failing because our cmake framework tries to build on a dedicated, out-of-source directory. pforth tries to read a file that is not there (because it wasn't copied).

I will read more about cmake to verify what is happening.


As you asked:

  1. Our build frameworks don't run as root; check!
  2. The sources are unpacked in a directory inside /tmp, and it has no spaces; check!
  3. The pure Makefile approach worked fine, allowing the update. Check!