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

Fix mixlib-archive on Windows, add Appveyor #31

Merged
merged 2 commits into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,18 @@ instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]
# If you want to load debugging tools into the bundle exec sandbox,
# add these additional dependencies into Gemfile.local
eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")

# These lines added for Windows (x64) development only.
# For ffi-libarchive to function during development on Windows we need the
# binaries in the RbConfig::CONFIG["bindir"]
#
# We copy (and overwrite) these files every time "bundle <exec|install>" is
# executed, just in case they have changed.
if RUBY_PLATFORM =~ /mswin|mingw|windows/
instance_eval do
ruby_exe_dir = RbConfig::CONFIG["bindir"]
assemblies = Dir.glob(File.expand_path("distro/ruby_bin_folder", Dir.pwd) + "/*.dll")
FileUtils.cp_r assemblies, ruby_exe_dir, verbose: false unless ENV["_BUNDLER_LIBARCHIVE_DLLS_COPIED"]
ENV["_BUNDLER_LIBARCHIVE_DLLS_COPIED"] = "1"
end
end
31 changes: 31 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "master-{build}"

os: Visual Studio 2017
platform:
- x64

environment:
matrix:
- ruby_version: "25-x64"

clone_folder: c:\projects\mixlib-archive
clone_depth: 1
skip_tags: true
branches:
only:
- master

install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- echo %PATH%
- ruby --version
- gem --version
- gem update --system
- gem install bundler --quiet --no-ri --no-rdoc
- bundler --version

build_script:
- bundle install

test_script:
- bundle exec rake
Binary file added distro/ruby_bin_folder/libarchive.dll
Binary file not shown.
Binary file added distro/ruby_bin_folder/liblzma-5.dll
Binary file not shown.
Binary file added distro/ruby_bin_folder/libxml2-2.dll
Binary file not shown.
8 changes: 1 addition & 7 deletions lib/mixlib/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@ def extract(destination, perms: true, ignore: [])

private

BACKSLASH = '\\'.freeze

def path_separator
if Gem.win_platform?
File::ALT_SEPARATOR || BACKSLASH
else
File::SEPARATOR
end
File::SEPARATOR
end

def create_and_empty(destination)
Expand Down