pforth icon indicating copy to clipboard operation
pforth copied to clipboard

cmake-based build does not work on Nixpkgs

Open AndersonTorres opened this issue 2 years ago • 2 comments

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)

AndersonTorres avatar Jun 04 '23 02:06 AndersonTorres

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

philburk avatar Jun 04 '23 23:06 philburk

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!

AndersonTorres avatar Jun 05 '23 11:06 AndersonTorres