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

Using dev mode for git/hg checkouts #263

Open
nadako opened this issue Dec 11, 2015 · 12 comments
Open

Using dev mode for git/hg checkouts #263

nadako opened this issue Dec 11, 2015 · 12 comments
Assignees
Labels

Comments

@nadako
Copy link
Member

nadako commented Dec 11, 2015

Right now, when one does haxelib git libname ..., it checks out into git directory inside library folder and then sets it as a .dev path. I think that doesn't make much sense, and we should keep dev mode separated from git/hg checkouts. What I propose is to remove setting .dev and store "git" version to .current like it's a normal version.

@nadako
Copy link
Member Author

nadako commented Dec 11, 2015

you can currently achieve that with haxelib git libname ...; haxelib dev libname; haxelib set git and it seems to work okay

@ibilon
Copy link
Member

ibilon commented Dec 11, 2015

I remember doing this at some point, never had issues.

It would be nice if you could install it like this haxelib install libname source or dev/git.

Would require a source field in haxelib.json, even if this idea isn't kept the source field would allow to have both github and website link.

@nadako
Copy link
Member Author

nadako commented Dec 14, 2015

Okay, one reason for using dev mode is that it allows to specify subdir to use as a library root inside of a checkout directory. It seems that we easily can't get rid of using devmode for vcs checkouts without losing that feature.

@nadako
Copy link
Member Author

nadako commented Apr 10, 2016

One viable option was discussed in #238:

Only use library as a dev dependency when the subfolder is given.

However I would like to completely remove the feature of using subfolders inside checkouts, it doesn't seem to worth it and it introduces unnecessary obstacles.

This should be backward-compatible in the sense already checked out dirs will continue to work, since they are using .dev files pointing to a subdir and git/hg update should work from within a subdir.

So, let's do this and then remove usage of .dev for git/hg checkouts as described in this original issue?

@ibilon
Copy link
Member

ibilon commented Apr 10, 2016

I'm all for it.

And it's not like you can't manually do a checkout+dev if you really need it.

@nadako nadako closed this as completed in 1390259 Apr 10, 2016
@nadako nadako reopened this Apr 10, 2016
@nadako
Copy link
Member Author

nadako commented Apr 10, 2016

We might need to revert 1390259 and stick with "using devmode when subdir is given" because apparently some popular libs can't be installed from git without specifying a subdir: https://github.com/massiveinteractive/mcover/tree/master/src

@ibilon
Copy link
Member

ibilon commented Apr 10, 2016

That's not exactly something I'd consider good practice, but well too late now.

Another option would be to add a .path file or something that would allow us to alter the output of path, and so let us checkout without using dev after.

@nadako
Copy link
Member Author

nadako commented Apr 10, 2016

Or, we can keep the break, change our CI scripts to use git checkout + haxelib dev and delegate responsibility to library authors, but that's probably not a good thing to do.

@ibilon
Copy link
Member

ibilon commented Apr 10, 2016

If the feature was new I'd say yes, but sadly it's not the case.

So we need to remove the need of dev while keeping the subdir feature,
would be the best outcome, but could be hard to do that before the rc.

@nadako nadako closed this as completed in 866f009 Apr 10, 2016
@nadako
Copy link
Member Author

nadako commented Apr 10, 2016

I wonder if we should print a deprecation message when subdir is used, so we can remove that eventually?

@ibilon
Copy link
Member

ibilon commented Apr 11, 2016

Not sure, since people are using it we could try and make it work without dev mode.

tobil4sk added a commit to tobil4sk/haxelib that referenced this issue Apr 4, 2022
The check to see if the dev version is equal to the directory to be
removed is no longer needed

See:
HaxeFoundation#263 and 1390259, 866f009
Simn pushed a commit that referenced this issue Apr 4, 2022
* Clean up imports in client.Main

Removed redundant ones and ordered them
Avoid * imports where possible

* Fix grammar of --quiet flag description

* Fix compiler version check in `run` command

* Fix a typo in Vcs module

* Fix std@host_resolve error message

- Correct spelling mistake
- Update command suggestion

* Fix incorrect hg command

Non-existent option was being used: "--no-ext-diff"

* Fix proxy not loading when updating through `set`

* Cleanup switch case

* Fix duplicate colon in install argument prompt

* Remove no longer needed check

The check to see if the dev version is equal to the directory to be
removed is no longer needed

See:
#263 and 1390259, 866f009

* Remove unused import

* Use defined dependency versions in checks
@tobil4sk
Copy link
Member

There is another issue with using dev mode for the subdir option, which is that it can be forgotten, leading to a broken installation.

# install a version from git
haxelib git hashlink https://github.com/HaxeFoundation/hashlink.git master other/haxelib/
# then decide to temporarily use a dev version
haxelib dev hashlink /some/path
# unset the dev version, and try to switch back to the git version
haxelib dev hashilnk
haxelib set hashlink git

Now the other/haxelib/ subdirectory we specified when installing has been forgotten and we can no longer use the library properly. This is because manually setting the dev version overwrote the dev version configured when installing the git library.

Storing a file for how a git/hg library was installed would also allow for smarter git installations/updates so that is probably the best solution. The subdir option is useful for a lot of hashlink libraries (hlsdl, hlopenal, hldx, hashlink) and it's been around for a long time so I think it would be better not to remove it.

@tobil4sk tobil4sk reopened this Sep 24, 2022
@tobil4sk tobil4sk self-assigned this Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants