swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

[SR-13934] build-script's --no-llvm-assertions also disables assertions for Swiftc #56331

Open typesanitizer opened 3 years ago

typesanitizer commented 3 years ago
Previous ID SR-13934
Radar rdar://problem/71983181
Original Reporter @typesanitizer
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Project Infrastructure | |Labels | Bug | |Assignee | @typesanitizer | |Priority | Medium | md5: e134a3763af24d57d0b69909f6a1e63d

Issue Description:

I tried 3 builds, and for each build, I checked the compilation command for SILVerifier.cpp in compile_commands.json.

1. build-script --release --no-assertions <other flags>: preprocessor flags -DGTEST_HAS_RTTI=0 -DNDEBUG -D__STDC_CONSTANT_MACROS.

  1. build-script --release --no-llvm-assertions <other flags>: preprocessor flags -DGTEST_HAS_RTTI=0 -DNDEBUG -D__STDC_CONSTANT_MACROS.
  2. build-script --release <other flags>: preprocessor flags -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -D_DEBUG -D__STDC_CONSTANT_MACROS.

I think the second one is incorrect; like the third case, it should not be passing -DNDEBUG when building the Swift compiler.

typesanitizer commented 3 years ago

@swift-ci create

typesanitizer commented 3 years ago

PR: https://github.com/apple/swift/pull/35115