Skip to content

Building koch on OpenBSD fails unless the Nim directory is in $PATH #13758

@euantorano

Description

When building koch on OpenBSD using the following steps:

cd $HOME
git clone --depth 1 -q https://github.com/nim-lang/Nim.git
cd Nim
git clone --depth 1 -q https://github.com/nim-lang/csources.git
gmake -C csources -j $(sysctl -n hw.ncpu)
bin/nim c koch

The final step (bin/nim c koch) fails with the following output:

`bin/nim c koch` output ``` euan@corellia ~/Nim> bin/nim c koch Hint: used config file 'config/nim.cfg' [Conf] Hint: used config file '/home/euan/Nim/koch.nim.cfg' [Conf] Hint: used config file 'config/config.nims' [Conf] /home/euan/Nim/lib/system/io.nim(89, 6) Hint: 'c_clearerr' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(143, 6) Hint: 'strerror' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(117, 6) Hint: 'c_ferror' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(440, 6) Hint: 'readAllFile' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(91, 6) Hint: 'c_feof' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(461, 6) Hint: 'writeLn' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(124, 6) Hint: 'c_fputc' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(45, 3) Hint: 'nil' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(504, 5) Hint: 'NimString' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1815, 7) Hint: 'NimStackTrace' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1169, 10) Hint: 'sysAssert' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(211, 7) Hint: 'ThisIsSystem' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1061, 3) Hint: 'hasSharedHeap' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1039, 3) Hint: 'strlitFlag' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/fatal.nim(15, 9) Hint: 'gotoBasedExceptions' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1817, 10) Hint: 'coroutinesSupportedPlatform' is declared but not used [XDeclaredButNotUsed] Hint: system [Processing] Hint: widestrs [Processing] Hint: io [Processing] /home/euan/Nim/lib/system/io.nim(461, 6) Hint: 'writeLn' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(440, 6) Hint: 'readAllFile' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(91, 6) Hint: 'c_feof' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/io.nim(124, 6) Hint: 'c_fputc' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(143, 10) Hint: 'color' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/mmdisp.nim(17, 3) Hint: 'debugGC' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/dyncalls.nim(18, 3) Hint: 'NilLibHandle' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/repr.nim(147, 8) Hint: 'reprBreak' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/dyncalls.nim(72, 8) Hint: 'dlerror' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/cellsets.nim(184, 10) Hint: 'elements' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/cellsets.nim(163, 6) Hint: 'excl' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(1817, 10) Hint: 'coroutinesSupportedPlatform' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(850, 8) Hint: 'GC_setStrategy' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/cellsets.nim(66, 6) Hint: 'deinit' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/alloc.nim(1001, 6) Hint: 'getFreeMem' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/alloc.nim(1024, 8) Hint: 'deallocOsPages' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/sysstr.nim(111, 6) Hint: 'newOwnedString' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(2177, 5) Hint: 'SafePoint' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(45, 3) Hint: 'nil' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/mmdisp.nim(38, 3) Hint: 'PByte' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system.nim(211, 7) Hint: 'ThisIsSystem' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(39, 3) Hint: 'rcPurple' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/alloc.nim(979, 6) Hint: 'realloc0' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/alloc.nim(1002, 6) Hint: 'getTotalMem' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/cellsets.nim(45, 6) Hint: 'contains' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/mmdisp.nim(39, 3) Hint: 'PString' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/osalloc.nim(27, 7) Hint: 'doNotUnmap' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/cellsets.nim(237, 10) Hint: 'elementsExcept' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/avltree.nim(27, 6) Hint: 'find' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(144, 10) Hint: 'setColor' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/alloc.nim(815, 6) Hint: 'rawAlloc0' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(38, 3) Hint: 'rcWhite' is declared but not used [XDeclaredButNotUsed] /home/euan/Nim/lib/system/gc.nim(37, 3) Hint: 'rcGray' is declared but not used [XDeclaredButNotUsed] Hint: koch [Processing] Hint: os [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: math [Processing] Hint: bitops [Processing] Hint: macros [Processing] Hint: algorithm [Processing] Hint: unicode [Processing] Hint: pathnorm [Processing] Hint: osseps [Processing] /home/euan/Nim/lib/pure/pathnorm.nim(46, 10) Hint: 'dirs' is declared but not used [XDeclaredButNotUsed] Hint: posix [Processing] Hint: times [Processing] Hint: options [Processing] Hint: typetraits [Processing] /home/euan/Nim/lib/pure/typetraits.nim(92, 11) Error: cannot open file: std/macros ```

However, if we add $HOME/Nim/bin to the path, then run the command as nim c koch instead, the build completes successfully:

`nim c koch` output
euan@corellia ~/Nim> nim c koch
Hint: used config file '/home/euan/Nim/config/nim.cfg' [Conf]
Hint: used config file 'koch.nim.cfg' [Conf]
Hint: used config file '/home/euan/Nim/config/config.nims' [Conf]
/home/euan/Nim/lib/system/io.nim(89, 6) Hint: 'c_clearerr' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(143, 6) Hint: 'strerror' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(117, 6) Hint: 'c_ferror' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(440, 6) Hint: 'readAllFile' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(91, 6) Hint: 'c_feof' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(461, 6) Hint: 'writeLn' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(124, 6) Hint: 'c_fputc' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(45, 3) Hint: 'nil' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(504, 5) Hint: 'NimString' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1815, 7) Hint: 'NimStackTrace' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1169, 10) Hint: 'sysAssert' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(211, 7) Hint: 'ThisIsSystem' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1061, 3) Hint: 'hasSharedHeap' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1039, 3) Hint: 'strlitFlag' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/fatal.nim(15, 9) Hint: 'gotoBasedExceptions' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1817, 10) Hint: 'coroutinesSupportedPlatform' is declared but not used [XDeclaredButNotUsed]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
/home/euan/Nim/lib/system/io.nim(461, 6) Hint: 'writeLn' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(440, 6) Hint: 'readAllFile' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(91, 6) Hint: 'c_feof' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/io.nim(124, 6) Hint: 'c_fputc' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(143, 10) Hint: 'color' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/mmdisp.nim(17, 3) Hint: 'debugGC' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/dyncalls.nim(18, 3) Hint: 'NilLibHandle' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/repr.nim(147, 8) Hint: 'reprBreak' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/dyncalls.nim(72, 8) Hint: 'dlerror' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/cellsets.nim(184, 10) Hint: 'elements' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/cellsets.nim(163, 6) Hint: 'excl' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(1817, 10) Hint: 'coroutinesSupportedPlatform' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(850, 8) Hint: 'GC_setStrategy' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/cellsets.nim(66, 6) Hint: 'deinit' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/alloc.nim(1001, 6) Hint: 'getFreeMem' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/alloc.nim(1024, 8) Hint: 'deallocOsPages' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/sysstr.nim(111, 6) Hint: 'newOwnedString' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(2177, 5) Hint: 'SafePoint' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(45, 3) Hint: 'nil' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/mmdisp.nim(38, 3) Hint: 'PByte' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system.nim(211, 7) Hint: 'ThisIsSystem' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(39, 3) Hint: 'rcPurple' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/alloc.nim(979, 6) Hint: 'realloc0' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/alloc.nim(1002, 6) Hint: 'getTotalMem' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/cellsets.nim(45, 6) Hint: 'contains' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/mmdisp.nim(39, 3) Hint: 'PString' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/osalloc.nim(27, 7) Hint: 'doNotUnmap' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/cellsets.nim(237, 10) Hint: 'elementsExcept' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/avltree.nim(27, 6) Hint: 'find' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(144, 10) Hint: 'setColor' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/alloc.nim(815, 6) Hint: 'rawAlloc0' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(38, 3) Hint: 'rcWhite' is declared but not used [XDeclaredButNotUsed]
/home/euan/Nim/lib/system/gc.nim(37, 3) Hint: 'rcGray' is declared but not used [XDeclaredButNotUsed]
Hint: koch [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: macros [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
Hint: pathnorm [Processing]
Hint: osseps [Processing]
/home/euan/Nim/lib/pure/pathnorm.nim(46, 10) Hint: 'dirs' is declared but not used [XDeclaredButNotUsed]
Hint: posix [Processing]
Hint: times [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
/home/euan/Nim/lib/pure/times.nim(2494, 26) Warning: countLeapYears is deprecated [Deprecated]
/home/euan/Nim/lib/pure/times.nim(2501, 15) Warning: countLeapYears is deprecated [Deprecated]
/home/euan/Nim/lib/pure/times.nim(2509, 24) Warning: countLeapYears is deprecated [Deprecated]
/home/euan/Nim/lib/pure/os.nim(2196, 6) Warning: declared lock level is 0, but real lock level is <unknown> [LockLevel]
/home/euan/Nim/lib/pure/os.nim(2316, 6) Warning: declared lock level is 0, but real lock level is <unknown> [LockLevel]
/home/euan/Nim/lib/pure/os.nim(2449, 6) Warning: declared lock level is 0, but real lock level is <unknown> [LockLevel]
/home/euan/Nim/lib/pure/os.nim(2813, 8) Hint: 'getApplAux' is declared but not used [XDeclaredButNotUsed]
Hint: parseopt [Processing]
Hint: osproc [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
Hint: cpuinfo [Processing]
Hint: kqueue [Processing]
/home/euan/Nim/lib/pure/osproc.nim(1344, 8) Hint: 'select' is declared but not used [XDeclaredButNotUsed]
Hint: kochdocs [Processing]
Hint: sets [Processing]
/home/euan/Nim/lib/pure/collections/hashcommon.nim(21, 7) Hint: 'freeMarker' is declared but not used [XDeclaredButNotUsed]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_assertions.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_assertions.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_dollars.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_dollars.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_io.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_io.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_system.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_system.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_math.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_math.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_strutils.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_strutils.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_pathnorm.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_pathnorm.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_posix.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_posix.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_times.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_times.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_os.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_os.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_parseopt.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_parseopt.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_hashes.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_hashes.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_strtabs.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_strtabs.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_streams.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_streams.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_cpuinfo.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_cpuinfo.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_osproc.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_osproc.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/stdlib_sets.nim.c.o /home/euan/.cache/nim/koch_d/stdlib_sets.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/tools7kochdocs.nim.c.o /home/euan/.cache/nim/koch_d/tools7kochdocs.nim.c [Exec]
Hint: gcc -c  -w  -I/home/euan/Nim/lib -I/home/euan/Nim -o /home/euan/.cache/nim/koch_d/koch.nim.c.o /home/euan/.cache/nim/koch_d/koch.nim.c [Exec]
Hint:  [Link]
Hint: operation successful (51408 lines compiled; 6.803 sec total; 72.449MiB peakmem; Debug Build) [SuccessX]

If we run nim dump with the nim binary built from csources, we get the following output:

`nim dump` output
lib/pure
lib/core
lib/arch
lib/pure/unidecode
lib/js
lib/posix
lib/windows
lib/wrappers/linenoise
lib/wrappers
lib/impure
lib/pure/concurrency
lib/pure/collections
lib/deprecated/pure
lib/deprecated/core
lib
lib

I'm not sure what else to do in order to troubleshoot this...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions