nitely / nim-regex

Pure Nim regex engine. Guarantees linear time matching
https://nitely.github.io/nim-regex/
MIT License
227 stars 20 forks source link

error installation `Error: 'srcdir' should be: 'srcDir'` #55

Open enthus1ast opened 4 years ago

enthus1ast commented 4 years ago
[david@eb ~]$ nimble install regex@#head
Downloading https://github.com/nitely/nim-regex using git
       Tip: 1 messages have been suppressed, use --verbose to show them.
     Error: Could not read package info file in /tmp/nimble_6678/githubcom_nitelynimregex_#head/regex.nimble;
        ...   Reading as ini file failed with: 
        ...     Invalid section: .
        ...   Evaluating as NimScript file failed with: 
        ...     /tmp/nimble_6678/githubcom_nitelynimregex_#head/regex_6678.nims(12, 1) Error: 'srcdir' should be: 'srcDir'
        ... printPkgInfo() failed.
[david@eb ~]$ nim --version
Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2020-01-03
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 12ad02731f33bd54d180ad519051905a66d17604
active boot switches: -d:release
nitely commented 4 years ago

I think this was fixed in nimble[0], however the latest release is older than the fix. That said, I cannot reproduce the error.

[0] https://github.com/nim-lang/nimble/pull/744

SolitudeSF commented 4 years ago

you have stylecheck:error in your config, probably

nitely commented 4 years ago

mmh the stylecheck checking every dependency, even Nim itself instead of the project/app/lib being built is a PITA.

genotrance commented 4 years ago

cc @alaviss @dom96

This is breaking nimble-packages testing. Any reason why this isn't being fixed? Simplest fix is to remove the styleCheck until this change becomes old enough.

nitely commented 4 years ago

What if we rename srcdir to srcDir in regex.nimble? I can't reproduce this, so no idea whether that fixes it.

Simplest fix is to remove the styleCheck until this change becomes old enough.

I guess that should fix nimble-package CI, but it won't help those using the style checker.

genotrance commented 4 years ago

Agreed - best to change regex.nimble to srcDir since that's the correct fix anyway.

nitely commented 4 years ago

I just did that. Let me know if it's fixed now.

nitely commented 4 years ago

I did this:

when (NimMajor, NimMinor) >= (1, 1):
  srcDir = "src"
else:
  srcdir = "src"

Now it fails for me with Error: 'srcDir' should be: 'srcdir'. I guess the reason is I'm using choosenim (Nim 1.1 with an old nimble version?).

genotrance commented 4 years ago

Koch pulls a specific Nimble commit - https://github.com/nim-lang/Nim/blob/devel/koch.nim#L137. Only if run with --latest, does it pull latest Nimble.

Seems like you need to turn off the style check as well.

dom96 commented 4 years ago

@genotrance Why does Nimble care about this anyway? Nim is style insensitive, why isn't Nimble?

genotrance commented 4 years ago

@dom96: His config makes Nim care.

https://github.com/nitely/nim-regex/blob/master/config.nims#L4

nitely commented 4 years ago

Seems like you need to turn off the style check as well.

That won't quite work. Users import nim-regex and then compile their programs with the stylecheck on, and AFAIK nim-regex gets stylechecked as well. That'll fail depending on the Nim version, and I'll receive complains.

I didn't try this, though, may be it won't fail? I'll try it later.

genotrance commented 4 years ago

Most people aren't keeping styleCheck:error by default. That is not the Nim default. It is breaking both in Nim package testing as well as during install time since the setting is in your root.

nitely commented 4 years ago

See https://github.com/nitely/nim-regex/pull/40. I guess I should remove that config, and just reject PRs fixing style...

genotrance commented 4 years ago

@kaushalmodi - what's your take on this?

@dom96 - changing srcdir to srcDir is causing more heartburn than expected. What do you suggest to get this resolved?

kaushalmodi commented 4 years ago

@genotrance Unless the packages (like regex) pass the stylechecks, the users cannot use styleCheck:error for their own packages depending on them.

I like consistencies and enforce styleCheck:error in my config. If the nimble and other popular packages cannot play well with styleCheck:error, they may be that feature should be removed.

My take would be to do whatever is needed to make styleCheck:error work. How can I help there?

genotrance commented 4 years ago

I appreciate your point of view and that packages like nim-regex could conform so that users can use the flag. That being said, the whole point of Nim's style insensitivity is to allow users and packages the flexibility that they prefer and not impose it on others. Regardless, I don't want to make it a big discussion around this feature. @Araq can share his thoughts on this in general.

The specific question here is that Nimble recently changed srcdir to srcDir. and nim-regex used srcdir and it is causing complaints with newer Nimble versions. nimterop on the other hand always used srcDir but I never got complaints that I had it wrong in my config all this time. It isn't as popular as regex though.

Not sure how to proceed here. Ideas appreciated.

kaushalmodi commented 4 years ago

Not sure how to proceed here. Ideas appreciated.

It looks like removing styleCheck:error from nim-regex config.nims is the only way forward.

kaushalmodi commented 4 years ago

@nitely I apologize for my PR causing all this trouble.

nitely commented 4 years ago

I've removed the config for the time being https://github.com/nitely/nim-regex/commit/4360c267af5390221f285561195b1166b3fec1c9

Araq commented 4 years ago

So use --styleCheck:hint.