-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 grammar verifcation #34994
Fix grammar verifcation #34994
Conversation
I was able to fix the errors, yay 😁 The API of libsyntax was changed (eg 24e7491) but the veryfy.rs is not getting build. Should we include the antlr4-complete.jar or just build the |
@@ -4,11 +4,11 @@ Uses [antlr4](http://www.antlr.org/) and a custom Rust tool to compare | |||
ASTs/token streams generated. You can use the `check-lexer` make target to | |||
run all of the available tests. | |||
|
|||
To use manually: | |||
To use manually, assuming antler4 ist installed at `/usr/share/java/antlr-complete.jar`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably say "antlr", not "antler".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes thank you 👍
I run the test result: failed. 4764 passed; 125 failed; 2 skipped I am curious, what are the next steps to fix the failed tests? |
@@ -37,7 +37,7 @@ $(BG): | |||
|
|||
$(BG)RustLexer.class: $(BG) $(SG)RustLexer.g4 | |||
$(Q)$(CFG_ANTLR4) -o $(BG) $(SG)RustLexer.g4 | |||
$(Q)$(CFG_JAVAC) -d $(BG) $(BG)RustLexer.java | |||
$(Q)$(CFG_JAVAC) -d $(BG) -classpath /usr/share/java/antlr-complete.jar $(BG)RustLexer.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, is this always going to be where this is? Feels system-specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the place in Arch Linux, but not on Mac OS X. I have not tested other distros.
@alexcrichton what do you think of this PR? |
It does seems system specific, perhaps that could be refactored? That being said I know very little about all of this, and we don't run it on the bots, so I don't mind merging basically whatever here. |
I'm cool with pushing these improvements through even with the hardcoded path. It's better than it was, and I'm glad somebody is looking at this stuff. Would be good to get this onto a bot #28592 |
The system specific path could be obmittet with an environement variable, so the Another alternative would be to include the jar file and just ship it. Is this a good idea? cc: @nikomatsakis |
10f7384
to
e8f4f4f
Compare
I add the target I think this is a good state freeze/merge for now. I planed to add some documumentation about the process in the next weeks, but I am no sure whether it will be in a good shape before the 18. august or not. |
@bors: r+ rollup now, we can make it better eventually 😄 |
📌 Commit 76026d1 has been approved by |
Fix grammar verifcation I wanted to improve the [grammar-section](https://doc.rust-lang.org/grammar.html#items-and-attributes) but I can not build it. r? @steveklabnik @brson EDIT: I resolved some of the issues, removed the compiler output from the entry.
Fix grammar verifcation I wanted to improve the [grammar-section](https://doc.rust-lang.org/grammar.html#items-and-attributes) but I can not build it. r? @steveklabnik @brson EDIT: I resolved some of the issues, removed the compiler output from the entry.
@@ -47,6 +47,10 @@ clean-misc: | |||
$(Q)rm -Rf dist/* | |||
$(Q)rm -Rf doc | |||
|
|||
clean-grammar: | |||
@$(call E, cleaning grammar verification) | |||
$(Q)cd src/grammar && rm -Rf verify *.class *.java *.tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not handle an out-of-tree build directory, which our bots use.
cleaning grammar verification
/bin/sh: 1: cd: can't cd to src/grammar
/buildslave/rust-buildbot/slave/auto-linux-64-nopt-t/build/mk/clean.mk:51: recipe for target 'clean-grammar' failed
make: *** [clean-grammar] Error 2
program finished with exit code 2
elapsedTime=0.958165
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, looking on it.
@bors r- |
* Use make check-lexer to verify the grammar. * Extend grammar/README * Add make clean-grammar rule * Add target check-build-lexer-verifier to make tidy, so it will build the verifier with every build and catch future errors
I moved the in-tree part to the README of the manual process, since it was just for convenience. I was looking for the structure of the build bot, can I run one locally? |
@alexcrichton ping re last comment here, can @dns2utf8 do something to test this out? |
We've got a number of docker images which our bots are running, so running the tests inside those containers would perhaps be enough to test out? |
I was able to start a container and access it with this command: docker run --rm -it --entrypoint=/bin/bash alexcrichton/rust-slave-linux:2016-08-04 then inside clone my branch like the script: git clone https://github.com/dns2utf8/rust.git --branch doc_grammar I can then build my branch: cd rust
./configure && make -j$(nproc) docs but I am not sure this is the same as you do. EDIT: I am doing this, because the |
@dns2utf8 yeah that's basically the same as what we do, this'd just be testing for presence of the relevant tools. Is this running by default on |
Closing due to inactivity, but feel free to resubmit with a rebase! |
Thanks for the reminder, I rebased it. Can I reopen the issue just with a comment? |
Fix grammar verification * Use make check-lexer to verify the grammar. * Extend grammar/README * Add make clean-grammar rule * Add target check-build-lexer-verifier to make tidy, so it will build the verifier with every build and catch future errors This is the continuation of #34994 r? @steveklabnik @jonathandturner @alexcrichton
I wanted to improve the grammar-section but I can not build it.
r? @steveklabnik @brson
EDIT: I resolved some of the issues, removed the compiler output from the entry.