HaxeFoundation / haxelib

The Haxe library manager
https://lib.haxe.org/
MIT License
173 stars 77 forks source link

When installing default libs (eg. hxcpp) check that lib isn't already specified #511

Closed haxiomic closed 2 years ago

haxiomic commented 3 years ago

I need to use a specific version of hxcpp, so I add --library hxcpp:git:https://github.com/haxiomic/hxcpp#patch-3 to the hxml

when users run haxelib install build.hxml. The result is both hxcpp 4.2.1 and git are installed but 4.2.1 takes priority:

Loading info about the required libraries
Haxelib is going to install these libraries:
  hxcpp
  haxe-c-bridge - 0.5.3
  hxcpp - 4.2.1
Continue? [y/n/a] ? y
haxiomic commented 3 years ago

Hope to PR a fix myself soon and it's not a major change

Simn commented 2 years ago

I got a request from a Haxe Foundation partner to prioritize this issue. So, any chance for that PR? :)

haxiomic commented 2 years ago

It’s crunch time this week for me on contract work :(:(, I can get to this but after Nov 19th

RealyUniqueName commented 2 years ago

I've pushed a fix, but it needs a test to close the issue.

tobil4sk commented 2 years ago

I've looked into this a bit, and it seems to be completely unrelated from the fact that it is a "default lib". The issue arrises from doing this:

-lib heaps
-lib heaps:1.8.0

This is because in the entry in the map for the first one is "heaps", but for the second one it's "heaps:1.8.0", so they don't get treated as the same library as they should.

Edit: Nevermind, I was talking about something separate which is intentional behaviour.

tobil4sk commented 2 years ago

#530 fixes this, and includes a test.

tobil4sk commented 2 years ago

Apologies, I misunderstood the problem because I couldn't reproduce it (the -cpp flag has to be in a separate hxml). Here's the test for it: #532.

tobil4sk commented 2 years ago

I've pushed a fix, but it needs a test to close the issue.

Should be good to close now that the test is done, right?