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

Windows Compat #1

Closed
wants to merge 6 commits into from
Closed
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
24 changes: 24 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
os: Visual Studio 2015
version: "{build}"
build: off
clone_depth: 10
install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- ruby --version
- gem --version
- gem install bundler --quiet --no-ri --no-rdoc
- bundler --version
- bundle install
test_script:
- bundle exec rake test

environment:
matrix:
- ruby_version: "193"
- ruby_version: "200"
- ruby_version: "200-x64"
- ruby_version: "21"
- ruby_version: "21-x64"
- ruby_version: "22"
- ruby_version: "22-x64"
2 changes: 1 addition & 1 deletion lib/sassc/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def output_style

def load_paths
paths = @options[:load_paths]
paths.join(":") if paths
paths.join(File::PATH_SEPARATOR) if paths
end
end
end
7 changes: 6 additions & 1 deletion lib/sassc/native.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ module Native

spec = Gem.loaded_specs["sassc"]
gem_root = spec.gem_dir
ffi_lib "#{gem_root}/ext/libsass/lib/libsass.so"
if RUBY_PLATFORM =~ /mswin|mingw/
libsass_path = "#{gem_root}/ext/libsass/win/bin/libsass.dll"
else
libsass_path = "#{gem_root}/ext/libsass/lib/libsass.so"
end
ffi_lib libsass_path

require_relative "native/sass_value"

Expand Down
10 changes: 5 additions & 5 deletions lib/tasks/libsass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
file "lib/libsass.so" => "Makefile" do
make_program = ENV['MAKE']
make_program ||= case RUBY_PLATFORM
when /mswin/
'nmake'
when /mswin|mingw/
Copy link

Choose a reason for hiding this comment

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

As far as I understand Ruby for Windows DevKits are based on MinGW and Visual Studio should not be used due to various incompatibilities related to the runtime C++ support. Can you try switching to make and the Unix-style build (which is also supported by libsass) and see if that fixes the segmentation fault?

'msbuild /m:4 /p:Configuration=Release win/libsass.sln'
when /(bsd|solaris)/
'gmake'
'gmake lib/libsass.so'
else
'make'
'make lib/libsass.so'
end
sh "#{make_program} lib/libsass.so"
sh "#{make_program}"
end
end