chef / dep-selector-libgecode

Bundled Gecode Libraries for dep-selector
Apache License 2.0
11 stars 26 forks source link

Configure Window’s environments to use `bsdtar` #33

Closed schisamo closed 10 years ago

schisamo commented 10 years ago

The Ruby DevKit ships with bsdtar instead of tar. This change just ensures the environment is configured to use it.

Up until this point we have gotten lucky as our ChefDK builds build Chef first which in turn copies bsdtar.exe over to tar.exe: https://github.com/opscode/omnibus-chef/blob/master/config/software/chef.rb#L61

/cc @opscode/client-engineers @opscode/release-engineers

schisamo commented 10 years ago

The bug manifests like this:

    C:/opscode/chefdk/embedded/bin/ruby.exe extconf.rb
checking for the host operating system... Windows
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for diff... ok
checking for tar... no
configure: error: In order to compile Gecode, you need the tar tool.
extconf.rb:98:in `block in run': Failed to build gecode library. (GecodeBuild::BuildError)
    from extconf.rb:97:in `chdir'
    from extconf.rb:97:in `run'
    from extconf.rb:104:in `<main>'
-> sh C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/vendor/gecode-3.7.3/configure --prefix=C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/dep-selector-libgecode-1.0.2/lib/dep-selector-libgecode/vendored-gecode --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --disable-flatzinc --with-host-os=windows

Gem files will remain installed in C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/dep-selector-libgecode-1.0.2 for inspection.
Results logged to C:/opscode/chefdk/embedded/lib/ruby/gems/2.0.0/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/gem_make.out
danielsdeleo commented 10 years ago

:+1:

To recap a private conversation we had: it's possible to make your own Unixy environment on windows by installing MinGW and other unix tools on your own, in which case "tar.exe" may be the correct copy of tar that you want to use. I think the vast majority of users will be using the DevKit, so it's correct to optimize for the DevKit case, but we need to ||= the env var so users who roll their own unixy environment can at least set PROG_TAR to tar if they need to.

schisamo commented 10 years ago

@danielsdeleo the ||= has been added.

danielsdeleo commented 10 years ago

Yup, hence the :+1: I was just recapping our conversation for posterity.