miere43 / nim-registry

Deal with Windows Registry from Nim
http://miere.ru/docs/registry/
MIT License
29 stars 5 forks source link

Nimble install displays warnings, Code doesn't compile when imported and used #3

Closed genotrance closed 7 years ago

genotrance commented 7 years ago

On installing with Nim 0.16.0 and Nimble v0.8.2 on Windows 10 with Mingw-x64 setup:-

C:\Dropbox\Private\github\appsnap>nimble install registry Downloading https://github.com/miere43/nim-registry using git Warning: File 'winregistry.nim' inside package 'registry' is outside of the permitted namespace, should be inside a directory named 'registry' but is in a directory named 'private' instead. This will be an error in the future. Hint: Rename the directory to 'registry' or prevent its installation by adding skipDirs = @["private"] to the .nimble file. Verifying dependencies for registry@0.1.6 Installing registry@0.1.6 Success: registry installed successfully.

This doesn't seem to be an issue by itself, but when I "import registry" in my code and try to compile "var key: RegHandle", I get the following error: "Error: undeclared identifier: 'RegHandle'". Same issue with other symbols such as RegKeyRights, samRead, etc.

Renaming the "private" directory to something else does not help, nor does moving winregistry down into the root folder or other hacks I tried.

Now if I instead copy the entire "registry" code to my program folder and import "registry/registry" instead, everything works just fine.

miere43 commented 7 years ago

Fixed, run nimble uninstall registry -y, then nimble install registry and import module using import winregistry. If nimble install registry doesn't work, use nimble install winregistry. It seems that this package has name clashing with stdlib_registry file.

genotrance commented 7 years ago

New issue - nimble install no longer works:-

nimble install winregistry --verbose Reading official package list Downloading https://github.com/miere43/nim-registry using git Cloning latest tagged version: v0.1.7 Error: Traceback (most recent call last) ... nimble.nim(1073) nimble ... nimble.nim(999) doAction ... nimble.nim(606) install ... nimble.nim(570) downloadPkg ... download.nim(199) doDownload ... download.nim(165) verifyClone ... packageparser.nim(325) getPkgInfo ... packageparser.nim(313) getPkgInfoFromFile ... packageparser.nim(288) readPackageInfo ... Could not read package info file in C:\Users\user~1\AppData\Local\Temp\nimble_14248\githubcom_miere43nimregistry\winregistry.nimble; ... Reading as ini file failed with: ... Invalid section: . ... Evaluating as NimScript file failed with: ... Ident not found: foreignDeps.

miere43 commented 7 years ago

Nimble version? Works okay with nimble 0.8.4.

genotrance commented 7 years ago

The version of Nimble bundled with Nim 0.16.0 is 0.8.2 and that doesn't work. I tried updating Nimble with "koch nimble" but it didn't get bumped up to 0.8.4 so I just built Nimble directly from repo. Safe to say 0.8.4 works as expected.