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

Dependency: Isolate SemVer version logic in its own struct #2271

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Jun 16, 2022

Currently, Dependency is a mesh of logic, having evolved from a SemVer + branch only
version specification to semver, branch, path, repository.
In order to bring it under control, and attempt to have a smarter dependency matching,
we must first isolate the different ways we specify dependencies.

Code has been mostly moved. I assume the CI will yell at me, so I'll likely break this down.

@Geod24 Geod24 force-pushed the version_range branch 2 times, most recently from 193febb to d371cd4 Compare June 16, 2022 16:02
Currently, Dependency is a mesh of logic, having evolved from a SemVer + branch only
version specification to semver, branch, path, repository.
In order to bring it under control, and attempt to have a smarter dependency matching,
we must first isolate the different ways we specify dependencies.
@s-ludwig
Copy link
Member

Same idea, but it got lost on the sideway: #1284

@Geod24
Copy link
Member Author

Geod24 commented Jun 16, 2022

@s-ludwig : Ideally I'd like to move this logic to a single module, namely https://github.com/dcarp/semver/ . I'll vendor it in DUB for the time being, but ideally I'd like to move it to dlang-community as many people would probably have similar needs.

Then the idea would be to make Dependency use SumType so that there is only one "provider" active at a time (path, repository, or version range).

@Geod24 Geod24 requested review from s-ludwig and thewilsonator June 16, 2022 17:39
@s-ludwig
Copy link
Member

@s-ludwig : Ideally I'd like to move this logic to a single module, namely https://github.com/dcarp/semver/ . I'll vendor it in DUB for the time being, but ideally I'd like to move it to dlang-community as many people would probably have similar needs.

It would be really nice to switch to a self-hosted workflow where we can just use dub packages. There can still be a bootstrap script, and we could even include copies of external dependencies, instead of downloading them on demand, if someone deems that necessary. Although there should really be no need for that, considering that there is a binary included in every compiler distribution.

Then the idea would be to make Dependency use SumType so that there is only one "provider" active at a time (path, repository, or version range).

Sounds good.

@dlang-bot dlang-bot merged commit 5450020 into dlang:master Jun 17, 2022
@PetarKirov
Copy link
Member

@Geod24 I suggest splitting dub into subpackages, similar to vibe-d, all hosted in this repo. A good example of other package managers whose repo is split like I envision is Yarn: https://github.com/yarnpkg/berry/tree/master/packages

@rikkimax
Copy link
Contributor

rikkimax commented Jun 17, 2022 via email

@Geod24 Geod24 deleted the version_range branch June 17, 2022 08:16
@Geod24
Copy link
Member Author

Geod24 commented Jun 17, 2022

It would be really nice to switch to a self-hosted workflow where we can just use dub packages.

I agree. I should restart work on #1972 (Two years, wow!).

There can still be a bootstrap script, and we could even include copies of external dependencies, instead of downloading them on demand, if someone deems that necessary. Although there should really be no need for that, considering that there is a binary included in every compiler distribution.

The only negative feedback to the above PR was asking for a bootstrap, so I think I'll pick the latest version and add a CI check to make sure we don't break it.

@Geod24 I suggest splitting dub into subpackages, similar to vibe-d, all hosted in this repo. A good example of other package managers whose repo is split like I envision is Yarn: https://github.com/yarnpkg/berry/tree/master/packages

I'm really not found of subpackages at the moment. They have quite a few quirks, and overlap with configurations. But I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants