I want to develop a package locally and found there is a command for that:
The develop command allows you to link an existing copy of a package into your installation directory. This is so that when developing a package you don't need to keep reinstalling it for every single change.
$ cd ~/projects/jester
$ nimble develop
I tried, but it's not working. I noticed a new folder was created under ~/.nimble/, but I'm don't know how would it influence my program:
=>> pwd
/Users/chen/.nimble/pkgs/cirruEdn-#head
=>> tree
.
├── cirruEdn.nimble-link
└── nimblemeta.json
0 directories, 2 files
So I got a bit confused how it's working internally?
My package cirru-edn is not listed in official packages, so I required it via a url with a tag. Does it also breaks the develop mode?
requires "nim >= 0.20.0"
requires "https://github.com/Cirru/cirru-edn.nim#v0.1.8"
My package cirru-edn is not listed in official packages, so I required it via a url with a tag. Does it also breaks the develop mode?
Yes, you need to list it as requires "cirruEdn". Then Nimble will pick up the one you linked via nimble develop.
@jiyinyiyong i recognize your name, cool to see you are using nim!
@dom96 while we are on this subject, it would be really nice if it indicated in the nimble output when nimble develop is being used for any dep. Right now i believe it still shows the normal version number, so i find myself defensively doing nimble uninstall asdf@#head sometimes just in case it is still connected to a local copy.
changing to cirruEdn#head is likely to work... however it seems not working very correctly.
I updated the source code in cirruEdn project and run nimble develop. Then I run nimble install in my current project, it showing type errors based on my updated source. And I run a task, it shows type errors from my old source, so it's loading wrong copy of cirruEdn.
I checked ~/.nimble/pkgs and found cirruEdn#head and cirruEdn#0.1.8. I removed [email protected] and both are based on new copy of source. This is probably a bad way using nimble... So I'm still not sure how it's working internally.
I don't agree with that - once a package is in develop mode, the version is treated as #head. It is up to the user to keep it up to date since they are actively developing that package. The package version is irrelevant after that point. Any package that requires that package will get #head unless it uses <=.
If this is not the intention then use project local deps mode.