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

dub-to-nix,buildDubPackage: allow git-type dependencies #305582

Merged
merged 1 commit into from
May 8, 2024

Conversation

TomaSajt
Copy link
Contributor

@TomaSajt TomaSajt commented Apr 20, 2024

Description of changes

Closes: #305440

This PR adds support to dub-to-nix for processing other types of entries in dub.selections.json.

It will now be able to parse and prefetch git-type dependencies and it will filter out path type dependencies.
The custom lockfile format is only extended, so no breaking changes for previously generated lockfiles.

I also added the relevant logic to buildDubPackage that copies the directory fetched by fetchgit to the appropriate location.


The PR only causes rebuilds for other packages because of comment/whitespace differences in buildDubPackage. Other than this, other packages should be unaffected.


I temporarily added the sideloader package's derivation to the PR to show that it works.

Edit: I've removed it.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Copy link
Member

@tomodachi94 tomodachi94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dub-to-nix succeeds in generating the lockfile for Sideloader locally on my machine. Thank you @TomaSajt for such a quick response and fix ❤️

@TomaSajt
Copy link
Contributor Author

@tomodachi94 by the way, are you planning on adding the Sideloader package to Nixpkgs?

@tomodachi94
Copy link
Member

@\tomodachi94 by the way, are you planning on adding the Sideloader package to Nix pkgs?

Yes, I was, but feel free to PR it in yourself since you've packaged it already (though I am interested in being on the maintainers list).

@TomaSajt
Copy link
Contributor Author

TomaSajt commented Apr 20, 2024

@\tomodachi94 by the way, are you planning on adding the Sideloader package to Nix pkgs?

Yes, I was, but feel free to PR it in yourself since you've packaged it already (though I am interested in being on the maintainers list).

I think it's better if you open the PR yourself, as that package out of scope for this PR and I don't have any IOS devices.
You can copy the derivation I've written if you want to.

By the way, I also tried using qt-frontend, but for some reason after prompting to download the apple APK it just locked up with a dialog box saying nothing.
The dlangui-frontend requires some patching around for fontconfig, probably, so I don't recommend it.
I think the gtk-frontend is good enough.

Copy link
Member

@tomodachi94 tomodachi94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproving

Copy link
Member

@jtbx jtbx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1598

@TomaSajt TomaSajt requested a review from Atemu May 2, 2024 19:58
Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Nix part LGTM and while I'm not qualified to review the other parts, I don't see any obvious issues.

If nobody objects, I'm inclined to merge :)

@TomaSajt
Copy link
Contributor Author

TomaSajt commented May 8, 2024

Result of nixpkgs-review pr 305582 run on x86_64-linux 1

8 packages built:
  • Literate
  • btdu
  • dstep
  • dub-to-nix
  • inochi-creator
  • inochi-session
  • luneta
  • serve-d

@Atemu Atemu merged commit 6d5fc9c into NixOS:master May 8, 2024
25 of 26 checks passed
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.

dub-to-nix: fails to build lockfile with git+https://... dependencies
5 participants