hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.25k stars 4.43k forks source link

vagrant 2.2.9 fails to install vagrant-aws plugin macOS 10.15 #11619

Open PaulForgey opened 4 years ago

PaulForgey commented 4 years ago

Vagrant version

Vagrant 2.2.9

Host operating system

macOS 10.15.4 xcode 11.4.1 (this is relevant)

Guest operating system

n/a

Vagrantfile

n/a (this is an issue with installation)

Debug output

https://gist.github.com/PaulForgey/607463ba29e850e7ba9ae4d72d41a547

output of nokogiri's mkmf.log:

clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from conftest.c:1:
In file included from /opt/vagrant/embedded/include/ruby-2.6.0/ruby.h:33:
In file included from /opt/vagrant/embedded/include/ruby-2.6.0/ruby/ruby.h:29:
/opt/vagrant/embedded/include/ruby-2.6.0/ruby/defines.h:123:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

A WORKING COMPILER IS INSTALLED ON THIS SYSTEM. The configuration script is wrongly telling the compiler to ignore the system header search path and presuming much about the compiler's invocation.

> #include <stdio.h>
> int main() {
> printf("hello\n");
> return 0;
> }
> EOF
$ ./out
hello

Expected behavior

The plugin should have installed successfully

Actual behavior

The nokogiri dependency is broken

Steps to reproduce

  1. vagrant plugin install vagrant-aws

References

briancain commented 4 years ago

Hey there @PaulForgey - This was already fixed via https://github.com/hashicorp/vagrant-installers/pull/164 and should be in the next release, Vagrant 2.2.10. Sorry for the trouble!

briancain commented 4 years ago

Oops, I seem to have misread the version you listed. Interesting. I think this should of been fixed in 2.2.9 according to the issue I posted.

PaulForgey commented 4 years ago

issue does not reproduce for me in 2.2.6 FWIW

stephenreay commented 4 years ago

TLDR: if you're trying to make vagrant work until it's patched, install the Xcode CLI tools.

I'm getting the same error trying to update installed plugins (vagrant plugin update) after install v2.2.9.

I did not previously have the Xcode CLI tools installed, and as such the path /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk did not exist on my machine.

After installing the CLI tools, it exists as a symlink, and it appears to work.

But original issue has a comment identifying an easier solution than relying on that symlink: use the path given by xcrun --sdk macosx --show-sdk-path instead of the hard-coded path.