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

Core dump on nested @extend #11

Closed
thepratt opened this issue Feb 13, 2016 · 10 comments
Closed

Core dump on nested @extend #11

thepratt opened this issue Feb 13, 2016 · 10 comments

Comments

@thepratt
Copy link

I noticed this when using the materialize 0.97.5 web jar. When @extend runs more than 1 level deep, everything dies in a core dump.

Inside the materialize _buttons.scss there is a nested include:

.btn {
  text-decoration:none;
  color: $button-color-raised;
  background-color: $button-color;
  text-align: center;
  letter-spacing: .5px;
  @extend .z-depth-1;
  transition: .2s ease-out;
  cursor: pointer;

  &:hover {
    background-color: lighten($button-color, 5%);
    @extend .z-depth-1-half;
  }
}

.btn-large {
  @extend .btn;
  height: $button-height * 1.5;
  line-height: 56px;

  i {
    font-size: $button-large-icon-font-size;
  }
}

Commenting out @extend .btn lets everything compile, and all is fine.

@irundaia
Copy link
Owner

Were you using "org.webjars.bower" % "materialize" % "0.97.5"? If so, I'll have a look once I get home. Which OS you're using?

@thepratt
Copy link
Author

Yes, it was the bower version.

@irundaia
Copy link
Owner

Okay, I've had a quick look. This bug seems to have been introduced with the upgrade to libsass 3.3.3. A quick workaround would be to use sbt-sassify version 1.4.1. I've tested it there, and it seems to work in this version.

@irundaia
Copy link
Owner

I've tried to compile using sassc with libsass 3.3.3. This also fails with a segmentation fault. I've been trying to generate a minimal example exhibiting this behaviour, but I as soon as I've condensed it to a small example, libsass will compile it, so I'm unsure how I should report this issue to the libsass team. :(

@thepratt
Copy link
Author

Sorry, didn't see the second part of your question on my phone. I'm using Ubuntu 15.04.

Here is a base case that I found (using the stuff from materialize to help narrow down) that fails when using 1.4.2:

.yellow {
  color: white;
  background-color: yellow;
}

.z-depth-1 {
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

.z-depth-half-1 {
  box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}

.btn {
  text-decoration:none;
  text-align: center;
  @extend .z-depth-1;

  &:hover {
    @extend .z-depth-1-half;
  }
}

.btn--yellow {
  @extend .yellow;
  @extend .btn;
}

Everything succeeds when I remove &:hover.

@irundaia
Copy link
Owner

I added the second part to my question later, it's likely that's why you missed it. I just wanted to make sure that I could reproduce the error.

In any case, this seems to be a different issue. In your example you use @extend .z-depth-1-half; while the selector is defined as .z-depth-half-1. This should not cause a segfault so I've reported this issue with libsass.

If this issue is fixed, I'm not convinced materialize will compile though.

@irundaia
Copy link
Owner

The bug causing the example to crash has been fixed. However, materialize still causes libsass to crash. I'll try to determine the cause tomorrow again.

@CapeSepias
Copy link

any progress? love your plugin.

@irundaia
Copy link
Owner

Thanks for the love, I appreciate it.

I've filed an issue with libsass. They'll fix the segfault in the next release (most likely). Unfortunately, this will result in incorrect CSS. The issue has been scheduled to be fixed in the release afterwards (planned for June 20th).

@irundaia
Copy link
Owner

I've just released sbt-sassify v1.4.6. With the new version of libsass, the compile issues with materializecss seems to have been fixed. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants