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

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

Open
enthus1ast opened this issue Jan 4, 2020 · 21 comments
Open

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

enthus1ast opened this issue Jan 4, 2020 · 21 comments
Labels

Comments

@enthus1ast
Copy link

[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
Copy link
Owner

nitely commented Jan 4, 2020

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] nim-lang/nimble#744

@SolitudeSF
Copy link

you have stylecheck:error in your config, probably

@nitely
Copy link
Owner

nitely commented Jan 4, 2020

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

@genotrance
Copy link

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
Copy link
Owner

nitely commented Feb 10, 2020

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
Copy link

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

@nitely
Copy link
Owner

nitely commented Feb 10, 2020

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

@nitely
Copy link
Owner

nitely commented Feb 10, 2020

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
Copy link

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
Copy link

dom96 commented Feb 15, 2020

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

@genotrance
Copy link

@dom96: His config makes Nim care.

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

@nitely
Copy link
Owner

nitely commented Feb 16, 2020

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
Copy link

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
Copy link
Owner

nitely commented Feb 17, 2020

See #40. I guess I should remove that config, and just reject PRs fixing style...

@genotrance
Copy link

@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
Copy link
Contributor

@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
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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

@nitely
Copy link
Owner

nitely commented Feb 17, 2020

I've removed the config for the time being 4360c26

@Araq
Copy link

Araq commented Feb 17, 2020

So use --styleCheck:hint.

@nitely nitely added the upstream label Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants