Skip to content
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

Fix Issue 23838 - DMD lexer / parser examples might not compile #15106

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

RazvanN7
Copy link
Contributor

This patch:

  • updates paths to dub.sdl file
  • updates dub.sdl to contain errorsink
  • updates the test to compile and run

It seems that the dub tests are not run by the testing pipeline. Anyone knows how to enable them?

If we want dmd as a lib to be usable we should be more careful when breaking the user facing api, such as the constructors of the lexer and parse (cc @WalterBright - you broke the api with your work on the parser/lexer).

Also, one thing to take into account is the fact that the parser expects a null terminated string that is bases as a const(char)[]. So you either use parseModule from frontend.d which adds the \0 or you need to manually add it (as can be seen in the updated test).

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
23838 normal DMD lexer / parser examples might not compile

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15106"

@ghost
Copy link

ghost commented Apr 14, 2023

The tests are fixed but are they executed now ?

Anyone knows how to enable them?

If the problem is that they rely on DUB maybe something could be added to the buildkite check then ?

@RazvanN7
Copy link
Contributor Author

No, they are not enabled now. IIRC they were run at some point, but I have no idea why they were disabled.

Anyway, the retrieveScope test fails with a segfault. I haven't fixed that cause I did not want to bundle too many changes in a single PR. But I will try to find a way to enable these tests in a future pr that also makes the retrieveScope test compile.

import dmd.console;
import dmd.arraytypes;
import dmd.compiler;
import dmd.frontend;

Choose a reason for hiding this comment

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

frontend is already imported in line 22

@WalterBright
Copy link
Member

(cc @WalterBright - you broke the api with your work on the parser/lexer)

I'm not surprised. But I don't know what uses that API outside of the test suite.

@RazvanN7 RazvanN7 merged commit dd4fbf4 into dlang:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants