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

Add dub.selections.json to .gitignore #136

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

nordlow
Copy link

@nordlow nordlow commented Oct 13, 2021

No description provided.

@ikod ikod merged commit 00e34bd into ikod:master Oct 13, 2021
@ikod
Copy link
Owner

ikod commented Oct 13, 2021

Thanks

@PetarKirov
Copy link

PetarKirov commented Oct 14, 2021

Lock files should always be committed, even for libraries. Check out e.g. https://classic.yarnpkg.com/blog/2016/11/24/lockfiles-for-all/ (this talks about yarn, but the same concepts apply to dub).

Traditionally, this is perhaps this was not the message that the D community has had on dub.selection.json files for libraries, but that really has to change.

@nordlow
Copy link
Author

nordlow commented Oct 14, 2021

Ok, What is the meaning of a lock-file in this context?

@nordlow
Copy link
Author

nordlow commented Oct 14, 2021

Can someone make a tag?

@ikod
Copy link
Owner

ikod commented Oct 14, 2021

done, thanks

@PetarKirov
Copy link

PetarKirov commented Oct 14, 2021

@nordlow A lock file is a general concept implemented by most language package managers. In the case of Dub, that's dub.selections.json. It is supposed to contain the complete set of dependency package names, versions, cryptographic hashes of the archives containing them and from where to obtain download them. Unfortunately, Dub doesn't include the hash of package archives, which makes building with Dub not fully reproducible: if someone force pushes a git tag of a package and dub-registry happens to goes down, next time it starts it will fetch the new package tag, which can contain completely different contents (including malware).

@nordlow
Copy link
Author

nordlow commented Oct 14, 2021

@nordlow A lock file is a general concept implement by most language package managers. In the case of Dub, that's dub.selections.json. It is supposed to contain the complete set of dependency package names, versions, cryptographic hashes of the archives containing them and from where to obtain download them. Unfortunately, Dub doesn't include the hash of package archives, which makes building not fully reproducible: if someone force pushes a git tag of a package and dub-registry happens to goes down next time it starts it will fetch the new package tag, which can contain completely different contents (including malware).

Thanks a lot for that explanation. Would it be possible to add support for that in dub, @s-ludwig?

FYI, @John-Colvin @skoppe.

@nordlow
Copy link
Author

nordlow commented Oct 14, 2021

It is supposed to contain the complete set of dependency package names, versions, cryptographic hashes of the archives containing them and from where to obtain download them. Unfortunately, Dub doesn't include the hash of package archives.

What is meant by the word "archive" in this regard considering the code is transferred via Git?

@PetarKirov
Copy link

It is supposed to contain the complete set of dependency package names, versions, cryptographic hashes of the archives containing them and from where to obtain download them. Unfortunately, Dub doesn't include the hash of package archives.

What is meant by the word "archive" in this regard considering the code is transferred via Git?

There are several package suppliers. The default, which most people are familiar with, is dub-registry and it powers code.dlang.org. dub-registry stores archives of all packages as zip files on its server. So, in most cases, dub fetch is simply a zip file download: https://github.com/dlang/dub/blob/v1.27.0/source/dub/packagesuppliers/registry.d#L51-L86

Would it be possible to add support for that in dub?

Yes, but it would require changes to both dub-registry and dub.

@nordlow
Copy link
Author

nordlow commented Oct 15, 2021

Yes, but it would require changes to both dub-registry and dub.

Seems to me like something worth investing in, @John-Colvin @skoppe.

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

Successfully merging this pull request may close these issues.

3 participants