-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't require C compiler to codegen or link in CI when binaries won't be tested/used #5669
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verified with: proc dummy*[T: SomeNumber](a: T, b: T = 2.5): T =
result = a
echo dummy(2) which even with
and from nim-lang/Nim#22101 import std/pegs
discard pegs.peg("") similarly fails in the same way with
nim-lang/Nim#18429 is found likewise with
|
tersec
changed the title
don't require C compiler to codegen or link inCI when binaries won't be tested/used
don't require C compiler to codegen or link in CI when binaries won't be tested/used
Dec 14, 2023
Continuing checking against known fails-at-C-compilation stage examples, with 100% correlation so far of works/fails.
|
tersec
force-pushed
the
TnR
branch
2 times, most recently
from
January 19, 2024 10:54
6b62f09
to
d4e45a7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On a system with
nproc
of 16, this bringstests/all_tests
compilation from, with -d:debug --opt:none (which uses-0g
at the gcc level) i.e. already not optimizing, and not using LTO:to
It should have even more effect with fewer cores, such as the macOS and Windows cloud GitHub Actions CI builders with two cores only, because the
nim c -c
portion is intrinsically single-threaded regardless so doesn't depend on core count, and this cuts out the parallelizable portion.Currently, the GitHub Actions CI binary building for the targets it only builds but doesn't run (i.e.
make
all, in theBuild binaries (with trace logging enabled)
phase, notmake test
, the latter of which do run) compile debug/-Og
binaries, without LTO, which also aren't run.It is important to ensure that Nim isn't generating incorrect C code, because definitely has one that regularly (nim-lang/Nim#7593, nim-lang/Nim#18080, nim-lang/Nim#18081, nim-lang/Nim#22888, and nim-lang/Nim#22913 for some C examples, and nim-lang/Nim#22101 for C++). CI should catch this class of build issue.
This PR adjusts this to use
-fsyntax-only
to avoid the codegen and linking phases.It calls itself
syntax-only
, but that implies being able to resolve types sufficiently to figure out the kinds of tokens available, along with other compilation steps, so it would have caught For example,can be argued to have valid syntax, for a narrow definition of syntax but
because it can't figure out what
x
is supposed to be.This should catch all the issues of the sort liked in the Nim issue tracker where Nim generated invalid C code, while requiring half or less of the time for this part of the CI build.