Skip to content

Conversation

darkestpigeon
Copy link
Contributor

Subj, among other things slows down the compilation of large projects on linux significantly.


const useProcessAuxSpawn = declared(posix_spawn) and not defined(useFork) and
not defined(useClone) and not defined(linux)
not (defined(useClone) and defined(linux))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
not (defined(useClone) and defined(linux))
not defined(useClone)

var dataCopy = data

when defined(useClone):
when defined(useClone) and defined(linux):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
when defined(useClone) and defined(linux):
when defined(useClone):

Assumption here is that useClone implies Linux because it's a linux specific call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can lead to a bug in the current implementation, e.g. when useFork and useClone are defined, but we're not on linux.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the top of osproc.nim there is this:

when defined(linux) and defined(useClone):
  import std/linux

So I assumed it can happen that useClone is defined, but not linux. If this shouldn't happen, maybe an assertion should be added here, and useClone & linux check reduced to useClone?

@Araq Araq merged commit 440b55a into nim-lang:devel Oct 6, 2025
16 of 18 checks passed
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 440b55a

Hint: mm: orc; opt: speed; options: -d:release
183139 lines; 8.460s; 661.711MiB peakmem

narimiran pushed a commit that referenced this pull request Oct 7, 2025
Subj, among other things slows down the compilation of large projects on
linux significantly.

(cherry picked from commit 440b55a)
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.

2 participants