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

} character in a file-path - windows #7458

Closed
IvanRenison opened this issue Jun 26, 2021 · 30 comments
Closed

} character in a file-path - windows #7458

IvanRenison opened this issue Jun 26, 2021 · 30 comments
Labels
Cabal: parser status: fixed in master The fix or feature is already included on master branch type: bug
Milestone

Comments

@IvanRenison
Copy link

IvanRenison commented Jun 26, 2021

Hello, I have a } character in my users' path in windows: C:\Users\usuario}\ and when I try to install something with cabal, like these: cabal install ansi-terminal I get an error like these:

cabal.exe: Error parsing config file
C:\Users\usuario}\AppData\Roaming\cabal\config:28:
mismatched brackets, unexpected }  

And the line 28 of that file is:

remote-repo-cache: C:\Users\usuario}\AppData\Roaming\cabal\packages

The first line of that file to have a path. I tried putting the path in that file with " ". ' ' and < > but it didn't work.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Hi @IvanRenison,

I've put such a line into my config file and I experience no problem. What is the output of cabal --version on your system?

@IvanRenison
Copy link
Author

cabal --version returns:

cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library

I downloaded it yesterday form: https://www.haskell.org/cabal/download.html

@IvanRenison
Copy link
Author

It is strange, because I am seeing that there are version up tu 3.4.0.0

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Indeed, 2.4 is very old. You probably need to find and uninstall the old cabal (renaming the cabal executable to cabal.old should be enough).

@jneira
Copy link
Member

jneira commented Jun 26, 2021

cabal --version returns:

cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library

I downloaded it yesterday form: https://www.haskell.org/cabal/download.html

hi, some reason to not download the last version, 3.4.0.0?

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Yeah, I assumed the new version is somehow obscured by the old one, but I'm just guessing.

@IvanRenison
Copy link
Author

IvanRenison commented Jun 26, 2021

Yes, It seems that that is happening

@IvanRenison
Copy link
Author

Manual using the new .exe I get the same error:

PS C:\Users\usuario}\Desktop> ./cabal.exe --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
PS C:\Users\usuario}\Desktop> ./cabal.exe install ansi-terminal
cabal.exe: Error parsing config file
C:\Users\usuario}\AppData\Roaming\cabal\config:28:
mismatched brackets, unexpected } 

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

I was trying with development version, but perhaps there is something in the other parts of your config file (or with Windows). If the config file is not secret (no passwords in there), could you paste it, e.g., at https://gist.github.com?

It's also possible something else in our computer setups differs, though it's doubtful.

@IvanRenison
Copy link
Author

@IvanRenison
Copy link
Author

I never touched that file, it was generated like that

@IvanRenison
Copy link
Author

IvanRenison commented Jun 26, 2021

I tried deleting the file, and 3.4.0.0 version generated a new one, but with the same problem

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Thank you for the full file. Still can't reproduce with cabal 3.5. @jneira: can you? Does anybody have 3.4 handy to try on Linux and on Windows?

@jneira
Copy link
Member

jneira commented Jun 26, 2021

will try to reproduce in windows

@jneira
Copy link
Member

jneira commented Jun 26, 2021

I've reproduced in windows simple adding a } in the store-dir field

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Wild. So it looks like it happens only in Windows and in all versions of cabal?

@phadej
Copy link
Collaborator

phadej commented Jun 26, 2021

Try with master. The (old parsing) code generating mismatched brackets errors have been removed in fe82a92, so the parsing shouldn't fail anymore.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 26, 2021

Thank you @phadej. I do try with master and it doesn't fail for me. The commit you point to is probably the reason.

@jneira jneira added this to the 3.6.0.0-rc1 milestone Jun 28, 2021
@jneira jneira added the status: fixed in master The fix or feature is already included on master branch label Jun 28, 2021
@jneira
Copy link
Member

jneira commented Jun 28, 2021

I can confirm master works in windows too:

D:\ws\haskell\cabal-test>cabal build
cabal: Error parsing config file
D:\user\AppData\Roaming\cabal\config:30:
mismatched brackets, unexpected }

D:\ws\haskell\cabal-test>D:\user\AppData\Roaming\cabal\bin\cabal.exe build
Resolving dependencies...

D:\ws\haskell\cabal-test>cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library

D:\ws\haskell\cabal-test>D:\user\AppData\Roaming\cabal\bin\cabal.exe --version
cabal-install version 3.5
compiled using version 3.5.0.0 of the Cabal library

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

Splendid. @IvanRenison: will you wait for 3.6 release or try to use a pre-release? I think some windows artefacts are being built by CI, but I don't know how to get to them --- do we have any nightly builds available to users?

@phadej
Copy link
Collaborator

phadej commented Jun 28, 2021

@Mikolaj

EDIT: clicking the green mark of the latest commit on the main page also leads into similar place:
Screenshot from 2021-06-28 11-46-53

Then you need to click on artifacts workflow summary (on the left) to get to the page where artifacts are listed.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

Amazing! @IvanRenison: would you kindly try and become an early adopter of the development snapshot artefacts feature and try to install the latest development version of cabal (as linked above) and become an early adopter of cabal 3.6-rc1 as well, which solves your bug (please do report whether it does)? Any feedback along the way would be much appreciated, e.g., which step was particularly confusing. Thank you!

@IvanRenison
Copy link
Author

IvanRenison commented Jun 28, 2021

Yes, I will try it.
Any way, don't worry about me. I use linux for all the coding. I only wanted to try my project in windows. But I have no hurry for doing it

@IvanRenison IvanRenison changed the title } carácter in a file-path - windows } character in a file-path - windows Jun 28, 2021
@IvanRenison
Copy link
Author

Yes, it worked, but I had to manually delete the old config file

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

So, apparently, the dev binary artefacts are usable and the issue is indeed fixed. Success. Thank you all!

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

BTW, any idea where we could advertise what @phadej pictured above, that is, wow to get the dev build binaries? Even just to point users to, after their bugs are fixed on master.

@fgaz
Copy link
Member

fgaz commented Jun 28, 2021

Maybe on the cabal website, next to the other downloads

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

Indeed, this looks a good location to me: https://www.haskell.org/cabal/download.html, somewhere closer to the bottom.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 28, 2021

Anybody up to making a PR at https://github.com/haskell/cabal-website? I take it upon myself to badger @emilypi to rebuild the docs after it's merged (just as I annoyingly badger weekly right now:).

@emilypi
Copy link
Member

emilypi commented Jun 28, 2021

Anybody up to making a PR at https://github.com/haskell/cabal-website

I feel badgered, and therefore will make a PR 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cabal: parser status: fixed in master The fix or feature is already included on master branch type: bug
Projects
None yet
Development

No branches or pull requests

7 participants