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

Readme Instructions do not appear to work as described #70

Closed
BryanCrotaz opened this issue Apr 9, 2016 · 9 comments
Closed

Readme Instructions do not appear to work as described #70

BryanCrotaz opened this issue Apr 9, 2016 · 9 comments

Comments

@BryanCrotaz
Copy link

Example: https://github.com/silver-curve/broccoli-archiver

build function creates a zip file from the input tree

Expected zip file is created in both output folder and cache folder
Actual zip file is created in output folder only. Cache folder is empty

Adding the following options makes no difference:

    options.cacheInclude = [/.*/];
    options.inputFiles = ['**/*'];
@BryanCrotaz
Copy link
Author

Simplest possible BrocFile:

var archiver = require('broccoli-archiver');

module.exports = new archiver("src");

This shows broccoli-archiver's build method being called every time even when no source files have changed.

@BryanCrotaz
Copy link
Author

@joliss is this something you can comment on? Feels like I've built a very simple plugin but I can't for the life of me work out how to enable caching

@BryanCrotaz
Copy link
Author

for avoidance of doubt I'm running with broccoli-clext
broccoli-clext build dist --once

@BryanCrotaz
Copy link
Author

Seems like caching only works if you leave broccoli running but if you run broccoli twice the cache doesn't work - build gets called twice.

broccolijs/broccoli-plugin#11

@stefanpenner
Copy link
Contributor

Seems like caching only works if you leave broccoli running but if you run broccoli twice the cache doesn't work - build gets called twice.

this is by design. broccoli-persistent-filter does have a second level of caching, which allows it to persist beyond the life of the process. But it is very tricky to get the cache keys just right, and with persistent-filter the inputs aren't opaque but with this tool... they are quite tricky.

Persistent-filter largely works as expected, but it is still quite riddled with caveats and some bugs that must be fixed.

TL;DR that sort of caching, done without issue will most likely (for now anyways) be a one-off solution for the specific use-case.

It is possible to solve this problem, but deriving the appropriate cache key is surprisingly quite difficult, especially in the general case.

@BryanCrotaz
Copy link
Author

Where are the caveats documented?

@stefanpenner
Copy link
Contributor

@BryanCrotaz typical cache key problems, if something isn't included in the cache key, and it alone changes you will have a stale build.

@BryanCrotaz
Copy link
Author

What needs to go in the cache key other than the last modified of the source files?

@stefanpenner
Copy link
Contributor

@BryanCrotaz what other information may change between restarts?

The source-code that is being executed (and their dependent files), the node version, the OS, the ENV vars etc.etc.

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

No branches or pull requests

2 participants