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

Fix version aliases #71

Open
bendlas opened this issue Jul 17, 2023 · 4 comments
Open

Fix version aliases #71

bendlas opened this issue Jul 17, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@bendlas
Copy link
Contributor

bendlas commented Jul 17, 2023

deps.edn allows to use version aliases, like RELEASE or LATEST.

For deps cache, clj-nix resolves these to versions, without keeping the original alias resolvable.

Test case

{:deps {binaryage/devtools {:mvn/version "RELEASE"}}}

There are similar differences in given and used version for

  • version ranges, e.g. [1.4,1.6)
  • version patterns, e.g. *
  • SNAPSHOTS
@jlesquembre
Copy link
Owner

Good catch, I'll add support for RELEASE / LATEST.

SNAPSHOTS are already supported, I even have some tests:

(deftest maven-deps-test

What's the difference between version ranges and version patterns? I'm not familiar with * patterns in maven dependencies, and I didn't find any documentation about it.

I tried to add support for version ranges, but they are quite tricky. Here I have an example for version ranges, but it's quite hacky (for an old clojure-lsp version) :
https://github.com/jlesquembre/clojure-lsp/blob/58947e43f51641b571682918a63e4e1e6b54bc4a/flake.nix

Anyways, given that I think version ranges are a bad idea, and how much time I already spent wasted trying to support version ranges, I don't have any plans to add support in the near future.

@jlesquembre jlesquembre added the bug Something isn't working label Jul 23, 2023
@bendlas
Copy link
Contributor Author

bendlas commented Jul 23, 2023

What's the difference between version ranges and version patterns? I'm not familiar with * patterns in maven dependencies, and I didn't find any documentation about it.

I think I was confusing with exclusion wildcards please disregard.

Anyways, given that I think version ranges are a bad idea, and how much time I already spent wasted trying to support version ranges, I don't have any plans to add support in the near future.

Ack. Do you think we can make this case work: A transitive dependency has a version range, which gets overridden by a "closer" dependency with a regular version? Right now, that errors.

Maybe unsupported version expressions could be demoted to a warning, and assumed to be provided otherwise?

@jlesquembre
Copy link
Owner

Do you think we can make this case work: A transitive dependency has a version range, which gets overridden by a "closer" dependency with a regular version? Right now, that errors.

I think that was the case building clojure-lsp, there is a maven-metadata-central.xml file that is not captured in the lock file, and I went with the hacky solution of adding it manually. That's why mkCljBin accepts an undocumented maven-extra attribute. You could try that too.

While I don't plan to work on this, if you find a solution, I'm happy to help with a PR.

@bendlas
Copy link
Contributor Author

bendlas commented Jul 24, 2023

Interesting, I'll try that workaround.

In the mean time, I may have a go at this at some point. But no promises either, I didn't end up needing that transitive dependency, for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants