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
Build vagrant from source #30952
Build vagrant from source #30952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, first of all this is awesome. I am glad to see the omnibus go away.
Would you mind submitting the ruby changes separately so that they can be reviewed more easily? Once this is merged the vagrant package would go in next.
]; | ||
|
||
postInstall = let | ||
# Why is this 2.3.0 and not ${ruby.version}? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, why is this hard-coded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to ${ruby.version.libDir}
, which appears to be what I want here.
d4992bc
to
d9b17f5
Compare
Rebased for Vagrant 2.0.1, which has native Virtualbox 5.2 support. |
Also cc @ryanartecona @zzamboni @nixy: I'd love if you could test this branch out on Darwin if you get a chance, as I can't test that myself! |
@aneeshusa thanks for this - unfortunately I have not been able to test due to NixOS/nix#1583, which causes my Mac to freeze whenever I try to compile anything heavy-duty. I will test when I'm able to upgrade to 10.13.2 (my Mac is centrally managed at work, so I cannot upgrade yet) and report back. |
Just tested this locally, and it works great for me! I got the result The "You appear to be running Vagrant outside of the official installers" warning is pretty annoying, but agreed on not trying too hard to hack around it. We could get it to stop printing by setting |
@aneeshusa I upgraded my Mac to 10.3.2 this morning so I now had a chance to test this branch - it seems to work perfectly well. As @ryanartecona mentioned, I get a warning about not running Vagrant from an official installer. I have for now suppressed it by setting Thanks for your work on this! |
d9b17f5
to
61d85d9
Compare
Thanks for testing @ryanartecona @zzamboni! |
thanks @aneeshusa. I merged the main PR, let's wait 1 day to see how this goes. Ping me if I forget this PR. |
This just defers to `fetchurl` for fetching. Additionally, update the `nix-bundle-install.rb` script to handle gems installed from a path, i.e. those with a `url` source. Some parts of that script have been disabled in the `path` case that likely shouldn't be, but cause errors and aren't necessary to get `vagrant` to work.
61d85d9
to
fd2390f
Compare
This is not quite as elegant as using `bundlerApp`, which I could not get working. However, this still uses most of the Ruby infrastructure, including stock bundix, and should be fairly reasonable to maintain. This means no more hacks to work around wrong embedded binaries, and no need for an old version of Ruby. Note that `vagrant share` is no longer included, as that functionality is closed-source and not present in the upstream source code. The Vagrant maintainers publish official Vagrant installers, which they prefer people use as most platforms don't have great support for pinning known-good dependencies. When run outside one of the offical installers, Vagrant normally prints a warning to that effect. However, Vagrant does run outside the installer environment (nominally to support Vagrant development), and this has the effect of functioning better by respecting OS certs and shared libraries, as opposed to trying to use bundled versions. To keep these postive side effects without having to see the warning on every Vagrant invocation, patch out the call to print the warning. Note that I have reset the maintainers since the implementation is totally redone; I'm happy to re-add any of the current maintainers.
fd2390f
to
8c3553b
Compare
ping @zimbatm :) |
thanks :) |
Motivation for this change
I got tired enough of all the hacks in the Vagrant derivation to take an excursion into Ruby-land packaging. The end result isn't perfect, but IMO it's a great deal better.
See individual commit messages for details.
Other highlights:
url
source type for Ruby gemsThings done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)cc maintainers @lovek323 @globin @jgeerds @kamilchm
cc @zimbatm and @cstrahan as Ruby maintainers
cc @samueldr: I tried to preserve the completions from #30482, but didn't know how to test this