Skip to content

Comments

Only compile the failing spec tester example#2345

Closed
wilzbach wants to merge 1 commit intodlang:masterfrom
wilzbach:failing-spec-tester-example
Closed

Only compile the failing spec tester example#2345
wilzbach wants to merge 1 commit intodlang:masterfrom
wilzbach:failing-spec-tester-example

Conversation

@wilzbach
Copy link
Contributor

This currently fails on some PRs with:

Test the D Language specification
../dmd/generated/linux/release/64/dmd -run tools/dspec_tester.d --compiler=../dmd/generated/linux/release/64/dmd
---
void main() {
import std.stdio;
import std.algorithm;
int[] s = [1, 2, 3, 4];

copy(s[1..3], s[0..2]);
assert(s == [2, 3, 3, 4]);

}
---
gcc: error: __stdin.o: No such file or directory
Error: linker exited with status 1

(e.g. dlang/phobos#6443, dlang/phobos#6453 or dlang/dmd#8168)

Hence, I think for now the best strategy is to just compile the respective test.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Contributor Author

I also opened a Bugzilla issue, s.t. this doesn't get lost and can be tracked when there's time: https://issues.dlang.org/show_bug.cgi?id=18762
(it's probably related to the way the spec tester runs the test in parallel as this would explain why it happens only spuriously)

The TravisCi error is unrelated as we are currently trying to re-add Travis to dlang.org (see e.g. #2340)

@wilzbach wilzbach force-pushed the failing-spec-tester-example branch from 42f790f to c45a16c Compare April 14, 2018 22:18
@wilzbach
Copy link
Contributor Author

Observed another probably related failure:

../dmd/generated/linux/release/64/dmd -run tools/dspec_tester.d --compiler=../dmd/generated/linux/release/64/dmd
---
void main() {
import std.stdio;
        struct S { int x; float y; }

        int foo(S s) { return s.x; }

        foo( S(1, 2) ); // set field x to 1, field y to 2
        
}
---
/usr/bin/ld: error in __stdin.o(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: __stdin.o: invalid string offset 1096055152 >= 528 for section `.strtab'
/usr/bin/ld: unknown operator '(' in complex symbol
/usr/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status

(and converted the test to compile only)

@CyberShadow
Copy link
Member

Observed another probably related failure:

This doesn't look like a scalable approach. Won't failures like these just keep cropping up until the root problem is fixed?

(it's probably related to the way the spec tester runs the test in parallel as this would explain why it happens only spuriously)

From a glance at the relevant code in dspec_tester and DMD, it seems fine, but there may be other parts like the linker affected by it.

@wilzbach wilzbach closed this Apr 14, 2018
@wilzbach wilzbach reopened this Apr 14, 2018
@wilzbach
Copy link
Contributor Author

(wrong button)

Fully agreed and I would love to fix the actual problem, but I have honestly no idea why we sometimes get these linker errors...

@CyberShadow
Copy link
Member

What do you think about instead of using -run and making DMD read from stdin, to save it to a .d file to a guaranteed-unique directory (probably just use an integer counter)?

@CyberShadow
Copy link
Member

I can reproduce this on my machine, looking into it.

@CyberShadow
Copy link
Member

The problem is in DMD's handling of programs from stdin:
https://issues.dlang.org/show_bug.cgi?id=18762#c1

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.

3 participants