chriseppstein/compass — Issue #695: Compass sprites fail on Windows
Author: StanAngeloff
Created: 2012-02-02 09:11:38+00:00
State: open

Following the [brief discussion](https://twitter.com/#!/StanAngeloff/status/164825220534902784) of this issue on Twitter, I set up a VM to see if I can reproduce. The following was installed in a vanilla Windows XP installation:

```
> ruby -v
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

> gem install --no-ri --no-rdoc --pre compass

> gem list
bigdecimal (1.1.0)
chunky_png (1.2.5)
compass (0.12.rc.0)
fssm (0.2.8.1)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)
sass (3.1.12)

> compass version
Compass 0.12.rc.0 (Alnilam)
```

I created the following directory structure in `C:\Documents and Settings\Administrator\My Documents\hello`:

```
├───images
│ └───icon
│ delete.png
│ new.png
│ save.png
│
└───styles
config.rb
default.scss

```

The contents of `config.rb` are as follows:

```ruby
css_dir = ''
sass_dir = ''
images_dir = '../images'
relative_assets = true
line_comments = false
environment = :development
```

The contents of `default.scss` are as follows:

```scss
@import "icon/*.png";
@include all-icon-sprites;

// $icons: sprite-map('icon/*.png');
// body { background: $icons; }
```

While inside the `C:\Documents and Settings\Administrator\My Documents\hello\styles` directory, I run:

```
> compass compile --force --trace
Errno::EINVAL on line ["40"] of c: Invalid argument - C:/Documents and Settings/Administrator/My Documents/hello/styles/.sass-cache/50b16097822ce3f9f8dd4d64a94efaa25cc9c088/*.pngc
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/filesystem.rb:40:in `open'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/filesystem.rb:40:in `_store'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/base.rb:51:in `store'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/chain.rb:19:in `block in store'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/chain.rb:19:in `each'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/cache_stores/chain.rb:19:in `store'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/engine.rb:338:in `_to_tree'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/engine.rb:259:in `to_tree'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:144:in `visit_import'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `map'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:53:in `visit_children'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `block in visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/base.rb:37:in `visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:18:in `visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/visitors/perform.rb:7:in `visit'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/tree/root_node.rb:20:in `render'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/engine.rb:300:in `_render'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/sass-3.1.12/lib/sass/engine.rb:247:in `render'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:140:in `block (2 levels) in compile'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:126:in `timed'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:139:in `block in compile'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/logger.rb:45:in `red'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:138:in `compile'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:118:in `compile_if_required'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:103:in `block (2 levels) in run'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:101:in `each'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:101:in `block in run'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:126:in `timed'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/compiler.rb:100:in `run'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/commands/update_project.rb:45:in `perform'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/commands/base.rb:18:in `execute'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/commands/project_base.rb:19:in `execute'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/lib/compass/exec/sub_command_ui.rb:15:in `run!'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/bin/compass:29:in `block in '
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/bin/compass:43:in `call'
c:/bin/ruby/lib/ruby/gems/1.9.1/gems/compass-0.12.rc.0/bin/compass:43:in `'
c:/bin/ruby/bin/compass:19:in `load'
c:/bin/ruby/bin/compass:19:in `

'
```

If I uncomment the `sprite-map` lines and comment the top of the file, the stylesheet compiles successfully and a sprite is generated.

I hope this helps. I am keeping the VM around in case I need to provide more details.