-
Notifications
You must be signed in to change notification settings - Fork 190
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
Locally developed packages are not taken into account when resolving http dependencies #543
Comments
@dom96, can you comment on which of the proposed solutions would be considered most acceptable? |
I think the package name can be reverse looked up in the package list. It wouldn't be perfect but I don't particularly like any of the other solutions. To be honest, I consider this as more of a user issue. Don't specify dependencies using URLs. |
Using URLs is mandatory when your packages are not registered in the Nimble package list. This will be true for example if your packages are considered private. Also, every package starts as being private. During the initial most active development, most users are likely to experience the problems described here. |
IIUC, this is also useful if, for example one builds a package that depends on a fork of the canonical package. This is a situation that I'm currently encountering. |
This issue can be solved by implementing a proper lock file (#127). The lock file would include the resolved package name, the URL appearing in the nimble file and the revision hash/tag. The resolved package name would be enough for Nimble to look for a locally linked development version of the package. When I create new commits in a locally linked library, the lock files of other projects that depend on it will be updated every time |
Not high-pri as it will be fixed via lock file support. |
I believe this one is already fixed (most likely when nimble.develop was introduced). I tested with the following steps:
I tested also with |
Consider the following scenario:
You check out a project having a nimble file specifying some of its dependencies as a HTTP URLs.
You want to fix an issue in one of the HTTP dependencies, so you clone the this package locally and you run
nimble develop
to make it available system-wide. You fix the issue and you delete any previously downloaded version from your~/.nimble/pkgs
folder.You run
nimble test
in the original repo, cloned in step 1. At this point, Nimble doesn't recognize your local copy of the dependent package and instead downloads a fresh copy from the specified HTTP URL. Your local fixes are ignored in favor of the downloaded unmodified copy.Expected outcome:
Nimble should be able to recognize that a locally linked version of a package (with
nimble develop
) satisfies a HTTP dependency for the same package.Possible solutions:
The problem is that Nimble cannot figure out that a particular URL used as a dependency matches a locally installed package. One way to solve this is to introduce a local database for the installed packages which will keep a reverse "URL to package name" lookup table.
Nimble can download the HTTP dependency in a temporary location, then it can inspect the downloaded package name and figure out that it's already present as a
nimble develop
link.The user may be required to specify the package name when introducing a HTTP dependency. The syntax may look like this:
The specified package name will allow Nimble to check for an existing installation of the package. A similar solution is used by other build tools such as Scala's SBT. Alternatively, we can introduce some new properly typed dependency-specification API:
I've pushed a very simple project demonstrating the issue here:
https://github.com/zah/nim-nimble-issue
To see the issue, you'll also need to clone the
httputils
package from https://github.com/status-im/nim-http-utils and then attempt to introduce changes in it after linking it withnimble develop
.The text was updated successfully, but these errors were encountered: