Skip to content

genscript generated broken script for {.compile.} #26060

Description

@arnetheduck

Nim Version

2.2.10

Description

Consider:

{.compile: "test.c".}
echo "hello"

When doing nim --genScript c test.nim, this results in a script containing:

  "compile": [
    [
      "/tmp/test.c",
      "clang -c -w -ferror-limit=3 -fno-strict-aliasing -pthread   -I/Nim-v2.2/lib -I/tmp -o @mtest.c.o test.c"
    ],
    [
      "/.cache/nim/test_d/@mtest.nim.c",
      "clang -c -w -ferror-limit=3 -fno-strict-aliasing -pthread  -I/hNim-v2.2/lib -I/tmp -o @mtest.nim.c.o @mtest.nim.c"
    ]

test.c is relative to the nim file that's being compiled while other C files are relative to nimcache - this of course isn't useful, ie the command as written in the script file is obviously broken.

Paths in the script could be either relative to the working directory (that's part of the script) or absolute.

Current Output


Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

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