UNIcodeX/nimformat

nimformat.c missing causing pip3 to fail

Opened this issue · 2 comments

The nim code base has changed since version .19 when you last built nimformat. Is the pylib import needed anymore?, I removed it. I updated file paths to nimbase.c and the nimformat c files to reflect the new layout for nim 1.0.2 and the compile succeeds. However the pip3 install fails because the nimformat.c file is missing. Nimpy creates a @mnimformat.nim.c file but no nimformat.c file. Do you know how to fix this?

pip3 install ~/nimformat/

Processing ./nimformat
Installing collected packages: nimformat
  Found existing installation: nimformat 0.1.3
    Uninstalling nimformat-0.1.3:
      Successfully uninstalled nimformat-0.1.3
  Running setup.py install for nimformat ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-zk5_6gt7-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lb5kfa_v-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'nimformat' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.6m -c nimformat.c -o build/temp.linux-x86_64-3.6/nimformat.o -flto -ffast-math -march=native -O3
    x86_64-linux-gnu-gcc: error: nimformat.c: No such file or directory
    x86_64-linux-gnu-gcc: fatal error: no input files
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of nimformat
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-zk5_6gt7-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lb5kfa_v-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-zk5_6gt7-build/

I updated the names to fix the issue. See the pull request.

Both Nim's Araq and nimpy's Yuriy say that packaging up the nim c code does not work cross platform. Too bad, it was a good idea and I wanted to do the same thing with a project I'm working on.

Araq
https://forum.nim-lang.org/t/5446#34065

Yuriy Glukhov
yglukhov/nimpy#120