Skip to content

vagrant: 2.4.1 -> 2.4.3 - #362117

Merged
bjornfor merged 1 commit into
NixOS:masterfrom
tylerjl:tylerjl/vagrant-2.4.3
Dec 6, 2024
Merged

bjornfor merged 1 commit into
NixOS:masterfrom
tylerjl:tylerjl/vagrant-2.4.3

Conversation

@tylerjl

@tylerjl tylerjl commented Dec 5, 2024

Copy link
Copy Markdown
Contributor

This has been marked broken on Darwin and Linux; after updating to latest stable and bumping dependencies in the vagrant-libvirt gemset (there were conflicting/outdated dependency conflicts after generating their Gemfile locks) I can vouch that it works on x86_64-linux at the very least (both building and managing a libvirt box - I tested w/RDP as well)

Resolves #354352 #348938

I have not built this on darwin, so I left the broken stanza in-place for that platform. If someone could checkout my branch and report success || failure on Darwin I'd appreciate it (then I'll remove meta.broken).

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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.

@github-actions github-actions Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 5, 2024

@bjornfor bjornfor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect timing! I've spent over a day trying to upgrade this package. I kept getting conflicts and hash mismatches. (I did bundler lock && bundix in vagrant and vagrant-libvirt source trees, but hit various build issues after that.)

Can you describe in the commit message exactly what you did?

Comment thread pkgs/by-name/va/vagrant/package.nix Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested that this builds and runs on Darwin, so we can remove this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I'll remove the broken stanza.

@tylerjl

tylerjl commented Dec 6, 2024

Copy link
Copy Markdown
Contributor Author

Perfect timing! I've spent over a day trying to upgrade this package. I kept getting conflicts and hash mismatches. (I did bundler lock && bundix in vagrant and vagrant-libvirt source trees, but hit various build issues after that.)

Can you describe in the commit message exactly what you did?

Sure thing; I'm going to remove broken so I'll rebase with an expanded commit message.

Long term I (or somebody) needs to punch out a small script to help generate updates because it.. isn't straightforward. The tl;dr is

  • Clone the vagrant repository; check out the desired version tag
  • bundle lock then bundix; overwrite gemset.nix
  • When crawling the diff I noted the old gemset doesn't include the vagrant gem itself. Unsure if this breaks the build or not but I removed it to stay consistent
  • Clone vagrant-libvirt, check out the desired tag
  • I commented out the development and test groups before bundle lock because they pulled in problematic dependencies that clashed with vagrant and bundle doesn't accept a group argument for lock.
  • bundix and tweak vagrant-libvirt in gemset.nix to change the source URL from a relative path
  • Copy over the vagrant-libvirt gemset.nix

Unfortunately this seems like a very brittle process since both upstream projects don't ship their own Gemfile.lock files and a bundle lock is inherently time-dependent and there isn't much of a guarantee you'd get the same result a month from now, but at least we have a functional commit at this point in time.

I'm including the steps I took to update this package to help the next
committer. Time permitting, this should probably be codified as a
formal update script:

1. Clone the upstream hashicorp/vagrant repository
2. Check out the desired version tag
3. Run `bundle lock` within the repository to generate `Gemfile.lock`
4. Run `bundix` to generate a `gemset.nix`
5. Move `gemset.nix` to overwrite this package's `gemset.nix`
6. Remove the self-referential `vagrant` attribute of the gemset
7. Clone vagrant-libvirt/vagrant-libvirt and check out the desired tag (probably latest release tag)
8. (Maybe optional?) because `bundle lock` lacks the ability to exclude groups; comment out groups unrelated to a release like `development` and `test, otherwise dependency conflicts with vagrant's `gemset.nix` are likely.
9. Run `bundle lock` within the repository to generate `Gemfile.lock`
10. Run `bundix` to generate a `gemset.nix`
11. Move `gemset.nix` to overwrite this package's `gemset_libvirt.nix`
12. Edit the `vagrant-libvirt` gem attribute to change its source to rubygems and not a relative path

Aside from these specific steps, the normal package update steps apply (update version, set hash to `lib.fakeHash`, get the updated hash to replace the old).
@tylerjl
tylerjl force-pushed the tylerjl/vagrant-2.4.3 branch from 60fb047 to dcc9178 Compare December 6, 2024 04:59

@bjornfor bjornfor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@bjornfor

bjornfor commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

Now I wonder whether it's a good idea to write an update script, or if we should just have the upgrade steps as a comment in .../vagrant/package.nix?

@andersk

andersk commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

An update script would be great, but we should merge this first to solve the build failure.

@nixpkgs-ci

nixpkgs-ci Bot commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-24.11:

@bjornfor

bjornfor commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

An update script would be great, but we should merge this first to solve the build failure.

Definitely!

@tylerjl
tylerjl deleted the tylerjl/vagrant-2.4.3 branch December 6, 2024 17:39
@ynishinaka ynishinaka mentioned this pull request Aug 27, 2025
2 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update request: Vagrant 2.4.1 → 2.4.3

3 participants