fix Issue 20457 - Asserts must not be turned off in release builds of dmd#10679
fix Issue 20457 - Asserts must not be turned off in release builds of dmd#10679WalterBright wants to merge 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#10679" |
There was a problem hiding this comment.
Does not work until the minmal compiler used by the auto-tester becomes 2.084+.
As an intermediate solution -release could be replaced with -boundscheck=safeonly. That would keep asserts and other contracts but would change the default assertion failure handling from C to D
Can build.d be changed to bootstrap with one set of flags, and then do the final build with a different set and compile itself with the latest version? This disabling of assert's is a serious problem. |
00e87f6 to
092f981
Compare
I guess, but I thought it's the point of the build script to be fast.
|
|
@wilzbach (1) and (2) are set by the compiler that compiles |
|
This causes the semaphoreci DMD x86 build to fail with: which seems totally weird to me. I have no idea what makes the semaphoreci DMD x86 build different. @wilzbach do you have an idea? |
8d8065d to
21d2d22
Compare
Sorry, but I don't have an idea either :/ |
|
If it isn't different, why is it being tested? Who made semaphoreci? Who maintains it? |
|
It tests that you can actually compile and run D code with the latest D compiler (not 2.079) + LDC + GDC. It does this via a two-stage bootstrap process: compile DMD with latest DMD. Use this DMD to compile DMD and then run the testsuite. SemaphoreCI is built and maintained by the people from Semaphore. |
I removed the |
|
@wilzbach thanks for the explanation. I'm interested in which of us is building/maintaining the semaphoreci tests, not who the semaphoreci organization is. |
|
To confirm, the failing test is using the 32 bit Linux DMD to build the 32 bit Linux DMD? |
|
I am finally able to repro it. |
21d2d22 to
57db68e
Compare
|
Found the problem: #10696 |
57db68e to
e5e767d
Compare
|
I refactored the code a bit so it will not trigger https://issues.dlang.org/show_bug.cgi?id=20466 and compile successfully with older compilers. |
dea3505 to
fd4fca6
Compare
|
@wilzbach this is ready to go. |
|
Last time this was tried it was deemed to be too expensive: #7344 (comment) Checking the autotester, the effect is visible in the logs (i.e. search for 10679 here https://auto-tester.puremagic.com/hosts/details.ghtml?hostid=53 or here https://auto-tester.puremagic.com/hosts/details.ghtml?hostid=46 ): builds are about 5-10% slower with this PR. |
I know, that is because of the ongoing trend to make assert()s ever more expensive. This is why the There are also some poor placements of assert()s in hot code in DMD. |
IMO the reporting code has very little impact on the execution of the condition. (I know there is some difference but I expect it to be hardly notable in build times). The major difference is code size.
That is definitely more likely to be an issue. BTW: the Azure x64-debug-dmd build also runs the tests with all debug code enabled. |
|
|
||
| /* This is what we really want, but it fails in auto-tester and semaphoreci | ||
| * because they don't use compilers that support the check switches. | ||
| * Can we fix this? |
There was a problem hiding this comment.
Yes, you can add -check= and -checkaction= as accepted but ignored arguments in the gdmd script (although -check=assert is equivalent to -fassert in gdc).
|
The change to hdrgen seems unrelated and should be explained. |
|
This found an OSX failure: |
ghost
left a comment
There was a problem hiding this comment.
You could remove some of the poorly placed assert that you mentioned, with this PR, just as example.
|
@NilsLankila why do you ask for our opinions via the review feature and simultaneously add "auto-merge"? |
|
Superseded by #11523 |
No description provided.