Versioning with Pkg

Hi everyone,

I wanted to help with the development of a Julia package. To do so I wanted to use Pkg.dev(Package) command but it does not work. I think that the reason is that the authors of that package append -DEV to the version in their Project.toml to avoid Pkg to update the package every time they push a change on master.

I was wondering, in general, what is is the correct way to deal with the update problem while still been able to use Pkg. Does Pkg implicitly assume that master is never broken and that it should be possible to constantly update every change?

Moreover, where can I find a reference for this things? I looked in to the documentation but I could not find anything that really clarified my mind.

thanks a lot in advance.

To do so I wanted to use Pkg.dev(Package) command but it does not work.

what specific behavior leads you to believe it does not work?

I was wondering, in general, what is is the correct way to deal with the update problem while still been able to use Pkg.

I’m not clear on what the “update problem” is. Pkg.develop will never change the files of the directory it is tracking (aside from possibly the initial download). If you want to update the files at that directory, you have to change them manually.

what are you trying to get Pkg to do? or what behavior did you expect but did not see?

2 Likes

Basically, I want to use Pkg.dev to copy the current version of LanguageServer.jl from github but it crashes with the following error

 CSTParser [00ebfdb7] log:
 ├─possible versions are: [0.4.0-0.4.1, 0.5.0-0.5.2, 0.6.0-0.6.2, 1.0.0, 1.1.0-1.1.1, 2.0.0] or uninstalled
 ├─restricted to versions 2 by LanguageServer [2b0e0bc5], leaving only versions 2.0.0
 │ └─LanguageServer [2b0e0bc5] log:
 │   ├─possible versions are: 1.1.0 or uninstalled
 │   └─LanguageServer [2b0e0bc5] is fixed to version 1.1.0-DEV
 └─restricted to versions 1.1.1 by an explicit requirement — no versions left

If read the message correctly the problem here is that -DEV in the versioning, right?

I assume that the reason why that -DEV is there to avoid Pkg to interpret any change in master as an update the package. I was wondering if there is a better or more canonical way to achieve the same result.

If read the message correctly the problem here is that -DEV in the versioning, right?

No, the problem is that you have CSTParser as a direct dependency (in your project file) so Pkg is refusing to change the version.

This should work:

pkg> rm CSTParser; dev LanguageServer; add CSTParser

Thanks now it works. I am still a bit confused about how Pkg works. I will read up more about it.

Very welcome.

Pkg has been adjusted to be more flexible in 1.4. It will automatically find the correct solution:

julia> Pkg.develop("LanguageServer")
Path `/home/david/.julia/dev/LanguageServer` exists and looks like the correct package. Using existing path.
 Resolving package versions...
  Updating `/tmp/foobizzle/Project.toml`
  [00ebfdb7] ↑ CSTParser v1.1.1 ⇒ v2.0.0
  [2b0e0bc5] + LanguageServer v1.1.0-DEV [`~/.julia/dev/LanguageServer`]
  Updating `/tmp/foobizzle/Manifest.toml`
  [00ebfdb7] ↑ CSTParser v1.1.1 ⇒ v2.0.0
  [ffa9a821] + DocumentFormat v1.1.1
  [48062228] + FilePathsBase v0.7.0
  [682c06a0] + JSON v0.21.0
  [2b0e0bc5] + LanguageServer v1.1.0-DEV [`~/.julia/dev/LanguageServer`]
  [69de0a69] + Parsers v0.3.10
  [b3cc710f] + StaticLint v3.0.0
...
1 Like

Ah cool, I will keep an eye out for the new version. Thanks.