Skip to content

fixes #26060; genscript generated broken script for {.compile.} - #26077

Open
ringabout wants to merge 2 commits into
develfrom
pr_secur9e
Open

fixes #26060; genscript generated broken script for {.compile.}#26077
ringabout wants to merge 2 commits into
develfrom
pr_secur9e

Conversation

@ringabout

Copy link
Copy Markdown
Member

fixes #26060

uses absolute path for CfileFlag.External

Comment thread compiler/extccomp.nim Outdated

let cf = if noAbsolutePaths(conf): AbsoluteFile extractFilename(cfile.cname.string)
else: cfile.cname
# Generated files live in nimcache, but external files are not copied there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still doesn't make sense - the "current" directory, when executing a json script, is whatever the current directory was at the time .. we don't change to the nimcache folder before running the compiler so the relative paths will be off in the "json build instructions file"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I will use absolute paths for c files in nimcache

@ringabout ringabout Aug 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to absolute paths, thought it would hurt relocatablility

To cross compile, use for example:


  nim c --cpu:i386 --os:linux --compileOnly --genScript myproject.nim


Then move the C code and the compile script `compile_myproject.sh`:cmd: to your
Linux i386 machine and run the script.

see 6260757#diff-b0b97f6f8f8480e70f544088bcbf3acdf9a381c4b677f9e67d47022541913e0c

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

genscript generated broken script for {.compile.}

2 participants