Giter Site home page Giter Site logo

EMFILE error about broccoli-compass HOT 27 CLOSED

quaertym avatar quaertym commented on August 16, 2024
EMFILE error

from broccoli-compass.

Comments (27)

g13013 avatar g13013 commented on August 16, 2024

Did you use the exclude option to exclude unwanted files ? See the README

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

@g13013 I didn't have a chance yet but I will try exclude and broccoli-static-compiler options as you suggested. Can you please also explain how does caching work in broccoli compass?

from broccoli-compass.

gigr avatar gigr commented on August 16, 2024

Just wanted to chime in, because I ran into the same issue. I'm on ember-cli 0.0.44 as well, and adding the following to my Brocfile.js fixed the issue:

var app = new EmberApp({
  // ...
  compassOptions: {
    // ...
    exclude: ['tmp/**', 'vendor/**', 'node_modules/**', 'bower_components/**'],
  }
});

@quaertym It might be worth adding that line or something similar as a default to ember-cli-compass-compiler.

It's also worth noting that I'm excluding vendor/** simply because we install compass into vendor/bundle—we don't use the globally installed version.

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

@quaertym take a look at broccoli-caching-writer

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

@gigr thanks for your feedback

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

@g13013 I am aware that broccoli-compass uses broccoli-caching writer but what does broccoli-compass is doing in its updateCache function. What does it cache and how that cache is updated by broccoli-compass?

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

No cache is done yet, updateCache is called only when the source tree changes, that's a first step, so it compiles, copies files and finally cleanup source tmp files, implementing a second cache step is planned to copy only changed files from source to destination.

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

@g13013 Thanks for the explanation. I have another question why don't we use broccoli-static-compiler when copying the files?

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

A good question:

Because @ferrydeboer have done so much good work on this PR that I couldn't delay its merge.

Also, we can't use broccoli-static-compiler because it involves issuing a merged tree using broccoli-merge-tree, or, if broccoli supports it (I think it does), returning the tree within the returned promise, which is in my opinion not advised:

  • if an error raises in the process, it could report a problem with broccoli-static-compiler it self rather than with broccoli-compass, so it could be confusing and very hard to debug.
  • it is in my sens very much faster to handle changes using broccoli-kitchen-sink-helpers and copying files with native APIs than adding an another tree to broccoli stack, especially when the user is not aware of such details.

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

broccoli-kitchen-sink-helpers are not used in broccoli-compass as far as I can tell copying is done with fs-extra. Another thing I have noticed is that inputTree is never used by broccoli-compass it is only used by broccoli-caching-writer to determine whether to call updateCache or not. In my use case(using this in ember-cli-compass-compiler), this inputTree always changes (e.g if templates or js files are changed let's say.). I will make changes to ember-cli-compass-compiler to pickFiles with broccoli-static-compiler but as I said before this input tree is not used in broccoli-compass. I think we should fix this line to use inputTree somehow.

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

@quaertym I think you didn't get the point, I am not saying that we are using broccoli-kitchen-sink-helpers, I just said that I will use broccoli-kitchen-sink-helpers in place of broccoli-static-compiler.
If your files are changing a lot in the source Tree, just use broccoli-static-compiler and filter out your compass project before submitting the tree to broccoli-compass.

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

closing for now

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

Actually the issue is not fixed yet. I only see a solution by adding an include option. exclude option does not work in my case because I have to write exclude for every type of file that can be included in an ember-cli app. I would really appreciate it if you can explain how inputTree is used in broccoli-compass. This is my last question I promise :)

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

why just don't use ?:

var pickFiles = require('broccoli-static-compiler');
var compassTree = pickFiles({
  srcDir: '/'
  files: ['sass/**', 'images/**', 'fonts/**'],
  destDir: '/'
});
var stylesTree = compileCompass(compassTree);

While you need to copy only files related to compass, others can find it useful to process only css and issue all files without the scss/sass source and cache.

that said a second level of cache have to be implemented, but don't have the time right now to do it.

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

I do this, but it does not have any effect since the input tree is never used with broccoli-compass. Am I wrong?

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

What do you mean by "input tree is never used with broccoli-compass":

The write function called by broccoli is handled by broccoli-caching-writer that lookup for changes, in source tree that call updateCache of broccoli-compass if a change is detected.

What didn't work for you? please give me a gist of your project configuration, need more details.

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

Ok I understand that broccoli-caching-writer uses inputTree to determine whether to call updateCache or not. However inputTree is never reached by broccoli-compass, then why am I using broccoli-compass instead of broccoli-caching-writer directly? It should have to do something with the inputTree, right?

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

updateCache just like write receive the srcDir param, this is the directory that contains files of inputTree see

from broccoli-compass.

shwoodard avatar shwoodard commented on August 16, 2024

@gigr I tried adding these config options to Brocfile.js and still get the error. Can anyone sort this out? My entire team is blocked because we can't build, serve, or test our ember cli app.

from broccoli-compass.

quaertym avatar quaertym commented on August 16, 2024

@scwoodard I have a solution, planning to push a new version of ember-cli-compass-compiler to npm.

from broccoli-compass.

gigr avatar gigr commented on August 16, 2024

@shwoodard Weird. If you want to post your Brocfile.js I can take a look and see if there are any other differences.

from broccoli-compass.

shwoodard avatar shwoodard commented on August 16, 2024

@gigr Brocfile.js,

/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp({
  compassOptions: {
    exclude: ['tmp/**', 'vendor/**', 'node_modules/**', 'bower_components/**']
  }
});
app.import('bower_components/i18n-js/vendor/assets/javascripts/i18n.js');
app.import('vendor/translations.js');
app.import('bower_components/cookies-js/dist/cookies.min.js');
app.import({
  development: 'bower_components/underscore/underscore.js',
  production:  'bower_components/underscore/underscore-min.js'
});
app.import('vendor/jquery.placeholder.js');

module.exports = app.toTree();

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

@shwoodard I am not sure this have anything to do with broccoli-compass Can you post the error message please ?

@gigr @shwoodard I would not advise to use ember-cli without broccoli-compass, maintaining two projects to do the same thing will fragment the tool, and you could face another problems that might be already solved here. contributing, making suggestions or even better, submitting pull requests is more productive.

I am working to improve the cache and and include will be added soon.

from broccoli-compass.

stefanpenner avatar stefanpenner commented on August 16, 2024

related: #27

from broccoli-compass.

stefanpenner avatar stefanpenner commented on August 16, 2024

If https://github.com/g13013/broccoli-compass/blob/master/index.js#L60 where to limit the concurrency, we would likely never run into problems.

https://github.com/g13013/broccoli-compass/blob/master/index.js#L74 copy could only allow N active current copies. Something similar to https://www.npmjs.org/package/filequeue ?

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

thanks @stefanpenner, i started a important refactoring where I need your feedbacks to take a decision #27

from broccoli-compass.

g13013 avatar g13013 commented on August 16, 2024

I close, should be fixed with the last release. if it happens again reopen.

from broccoli-compass.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.