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

File task dependency handling buggy #423

Closed
martinholters opened this issue Mar 8, 2023 · 0 comments · Fixed by #424
Closed

File task dependency handling buggy #423

martinholters opened this issue Mar 8, 2023 · 0 comments · Fixed by #424

Comments

@martinholters
Copy link
Contributor

MWE:

const fs = require('fs');
const { directory, file } = require('jake');

directory('build');

file('build/output1.txt', ['build'], () => {
  console.log('writing build/output1.txt');
  fs.writeFileSync('build/output1.txt', 'Contents of build/output1.txt');
});

file('build/output2a.txt', ['build/output1.txt'], () => {
  console.log('writing build/output2a.txt');
  fs.writeFileSync('build/output2a.txt', 'Contents of build/output2a.txt');
});

file('build/output2b.txt', ['build/output1.txt'], () => {
  console.log('writing build/output2b.txt');
  fs.writeFileSync('build/output2b.txt', 'Contents of build/output2b.txt');
});

file('build/output3.txt', [ 'build/output2a.txt', 'build/output2b.txt'], () => {
  console.log('writing build/output3.txt');
  fs.writeFileSync('build/output3.txt', 'Contents of build/output3.txt');
});

Starting from a state where build/output1.txt (or build entirely) is missing, everything is built with jake build/output3.txt as desired. But if only build/output2b.txt or build/output3.txt are missing, nothing gets rebuild. Yes, jake build/output3.txt does not even build build/output3.txt. If build/output1.txt is touched, only build/output2a.txt is rebuilt by jake build/output3.txt. No errors are shown for any of these cases.

This might be a duplicate of #388, but that has a rather vague description, so I'm not sure. If it is, this MWE might be a starting point for a test case for #387.

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

Successfully merging a pull request may close this issue.

1 participant