Skip to content

/etc/nim/nim.cfg is not read #12292

Open
Open
@asmarcz

Description

@asmarcz

Configuration in /etc/nim/nim.cfg file on Ubuntu 18.04 is not read and taken into account. If C compiler is set to clang, Nim compiler ignores it still uses GCC. The same setting in ~/.config/nim/nim.cfg works without problems.

Steps to reproduce

  1. Install using choosenim script curl https://nim-lang.org/choosenim/init.sh -sSf | sh
  2. Create /etc/nim/nim.cfg and make it readable to all users
  3. Modify its content to cc = clang
  4. Compile Nim file for example nim c fiddle.nim
  5. See "Command for C compiler" comment in cache folder, for example cat ~/.cache/nim/fiddle_d/fiddle.nim.c

Expected Output

/* Generated by Nim Compiler v1.0.0 */
/*   (c) 2019 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, clang */
/* Command for C compiler:
   clang -c -w  -I/home/asmar/.choosenim/toolchains/nim-1.0.0/lib -I/home/asmar/projects/nim/fiddle -o /home/asmar/.cache/nim/fiddle_d/fiddle.nim.c.o /home/asmar/.cache/nim/fiddle_d/fiddle.nim.c */
...

Additional Information

$ nim -v
Nim Compiler Version 1.0.0 [Linux: amd64]
Compiled at 2019-09-23
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: f7a8fc46c0012033917582eb740dc0343c093e35
active boot switches: -d:release

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions