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

lalrpop compile error with Rust 1.56+ #32

Closed
indygreg opened this issue Sep 9, 2021 · 9 comments
Closed

lalrpop compile error with Rust 1.56+ #32

indygreg opened this issue Sep 9, 2021 · 9 comments

Comments

@indygreg
Copy link
Contributor

indygreg commented Sep 9, 2021

I know version 0.3.1 of this crate is old. But I wanted to give a heads up that it stops building on Rust 1.56+ due to a build error in the lalrpop crate:

   Compiling lalrpop v0.16.3
error[E0034]: multiple applicable items in scope
  --> /home/gps/.cargo/registry/src/github.com-1ecc6299db9ec823/lalrpop-0.16.3/src/message/horiz.rs:25:14
   |
25 |             .intersperse(self.separate)
   |              ^^^^^^^^^^^ multiple `intersperse` found
   |
   = note: candidate #1 is defined in an impl of the trait `Iterator` for the type `std::iter::Map<I, F>`
   = note: candidate #2 is defined in an impl of the trait `Itertools` for the type `T`
help: disambiguate the associated function for candidate #1
   |
22 ~         Iterator::intersperse(self.items
23 +             .iter()
24 +             .map(|c| c.min_width()), self.separate)
   |
help: disambiguate the associated function for candidate #2
   |
22 ~         Itertools::intersperse(self.items
23 +             .iter()
24 +             .map(|c| c.min_width()), self.separate)
   |

For more information about this error, try `rustc --explain E0034`.
error: could not compile `lalrpop` due to previous error

I'd love to port my code to version 0.5 of starlark-rust. But I haven't put in the time yet (and I'd really like #7 before I do so). The apparent imminent inability to build starlark-rust 0.3.1 on Rust stable is probably going to cause a number of bug reports for me :/

Would you be willing to publish a 0.3.2 release of this crate that uses newer versions of its dependencies so it continues to build on Rust stable / 1.56+?

(I wish I could commit to porting past the ancient 0.3 release, but I still haven't found the time to port the significant amount of code I have depending on the 0.3 semantics. But this lalrpop issue may force my hand...)

@ndmitchell
Copy link
Contributor

The 0.3.1 release was made by @damienmg, and the code behind it isn't even in this repo. That's not to say a new release couldn't take place (if someone gave me a package and told me how to upload it I have permissions). However, I see this is really an issue in lalrpop itself? I suspect some more restrictive upper bounds on lalrpop 0.16 and a new release of that would be the right way to solve the issue, might also benefit others, and as a happy side effect, means we need to make no changes?

@indygreg
Copy link
Contributor Author

indygreg commented Sep 9, 2021

It looks like that if a compatible lalrpop 0.16.4 were published that starlark 0.3.1 would pick it up and this would solve my problem. I agree that fixing this in lalrpop is the preferred solution and filed lalrpop/lalrpop#629.

@indygreg
Copy link
Contributor Author

There's radio silence from the lalrpop project.

I took the liberty of creating a branch that ports to the latest lalrpop and is compatible with Rust 1.56+. If you are willing to publish an official 0.3.2, I can send a PR. If you don't publish an official 0.3.2, I'll probably publish a starlark-03-legacy crate or something so my builds keep working with Rust 1.56+.

https://github.com/indygreg/starlark-rust/tree/starlark-03-fork

@ndmitchell
Copy link
Contributor

A PR to this repo is useless since the history doesn't go back far enough. A PR to the old repo is useless since it's been archived. How about I grab your tree/branch, review it in place, and just make a direct release of 0.3.2 from there?

@indygreg
Copy link
Contributor Author

A PR to this repo is useless since the history doesn't go back far enough. A PR to the old repo is useless since it's been archived. How about I grab your tree/branch, review it in place, and just make a direct release of 0.3.2 from there?

This is fine for me if it is for you. Do I need to commit to keeping the repo/commit/tag around forever? I imagine some people might question where the 0.3.2 release came from: they may want to see a corresponding tag on the canonical repo. (But the only thing I care about is a usable 0.3.x version of the crate on crates.io.)

@ndmitchell
Copy link
Contributor

I would suggest keeping the repo/commit/tag around, so that if you need to make a 0.3.3 release to update another library it's easy and we have a track of what the delta is over the last release. I suggest I make the release (can you confirm that the repo is in the releasable state? perhaps make a v0.3.3 tag?) and update the CHANGELOG.md in this repo so point at your repo, so anyone who wonders about hacks or what not can find some verifiable trace back to a source/discussion/code.

@indygreg
Copy link
Contributor Author

I agree that you/Facebook should perform the release. That keeps things simpler.

I've pushed a v0.3.2 tag to my fork: https://github.com/indygreg/starlark-rust/releases/tag/v0.3.2. I believe this commit to be releasable. Although I couldn't get GitHub Actions to run for some reason.

FWIW cargo test in the repo root appears to fail with all Rust versions before and after my commits due to some weird crate version issue when generating the docs. However, cargo test in the starlark directory does work. I'm not sure what's going on here. But it appears to be a pre-existing condition.

I'll send a PR to update CHANGELOG.md in this repo.

@ndmitchell
Copy link
Contributor

For me, cargo test fails because I'm on Windows and the tests end up with \ characters in the path, which then are treated as broken escape characters. I reviewed the changes since your diff and have published. If that works, I think we can close this issue.

facebook-github-bot pushed a commit that referenced this issue Oct 1, 2021
Summary:
Updating the changelog as requested in #32.

Pull Request resolved: #33

Reviewed By: stepancheg

Differential Revision: D31315848

Pulled By: ndmitchell

fbshipit-source-id: 889af06246dd74c354c35b3a3aeaf39448e16348
@indygreg
Copy link
Contributor Author

I forgot to say thank you for publishing the 0.3.2 release. So, thank you so much!

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

No branches or pull requests

2 participants