@@ -1403,8 +1403,17 @@ class MkdirCommand : public Command {
1403
1403
// FIXME: This seems wasteful.
1404
1404
std::string description;
1405
1405
1406
+ // / Declared command inputs, used only for ordering purposes.
1407
+ std::vector<BuildNode*> inputs;
1408
+
1406
1409
virtual uint64_t getSignature () {
1407
- return basic::hashString (output->getName ());
1410
+ // FIXME: Use a more appropriate hashing infrastructure.
1411
+ using llvm::hash_combine;
1412
+ llvm::hash_code code = hash_value (output->getName ());
1413
+ for (const auto * input: inputs) {
1414
+ code = hash_combine (code, input->getName ());
1415
+ }
1416
+ return size_t (code);
1408
1417
}
1409
1418
1410
1419
virtual void configureDescription (const ConfigureContext&,
@@ -1429,7 +1438,10 @@ class MkdirCommand : public Command {
1429
1438
1430
1439
virtual void configureInputs (const ConfigureContext& ctx,
1431
1440
const std::vector<Node*>& value) override {
1432
- ctx.error (" unexpected explicit input: '" + value[0 ]->getName () + " '" );
1441
+ inputs.reserve (value.size ());
1442
+ for (auto * node: value) {
1443
+ inputs.emplace_back (static_cast <BuildNode*>(node));
1444
+ }
1433
1445
}
1434
1446
1435
1447
virtual void configureOutputs (const ConfigureContext& ctx,
@@ -1511,6 +1523,15 @@ class MkdirCommand : public Command {
1511
1523
1512
1524
// Eventually we would like to use the system itself to manage recursive
1513
1525
// directory creation.
1526
+
1527
+ // The command itself takes no inputs, so just treat any declared inputs as
1528
+ // "must follow" directives.
1529
+ //
1530
+ // FIXME: We should make this explicit once we have actual support for must
1531
+ // follow inputs.
1532
+ for (auto it = inputs.begin (), ie = inputs.end (); it != ie; ++it) {
1533
+ bsci.taskMustFollow (task, BuildKey::makeNode (*it));
1534
+ }
1514
1535
}
1515
1536
1516
1537
virtual void providePriorValue (BuildSystemCommandInterface&, core::Task*,
@@ -1613,11 +1634,20 @@ class SymlinkCommand : public Command {
1613
1634
// / The command description.
1614
1635
std::string description;
1615
1636
1637
+ // / Declared command inputs, used only for ordering purposes.
1638
+ std::vector<BuildNode*> inputs;
1639
+
1616
1640
// / The contents to write at the output path.
1617
1641
std::string contents;
1618
1642
1619
1643
virtual uint64_t getSignature () {
1620
- return basic::hashString (output->getName ()) ^ basic::hashString (contents);
1644
+ using llvm::hash_combine;
1645
+ llvm::hash_code code = hash_value (output->getName ());
1646
+ code = hash_combine (code, contents);
1647
+ for (const auto * input: inputs) {
1648
+ code = hash_combine (code, input->getName ());
1649
+ }
1650
+ return size_t (code);
1621
1651
}
1622
1652
1623
1653
virtual void configureDescription (const ConfigureContext&,
@@ -1642,7 +1672,10 @@ class SymlinkCommand : public Command {
1642
1672
1643
1673
virtual void configureInputs (const ConfigureContext& ctx,
1644
1674
const std::vector<Node*>& value) override {
1645
- ctx.error (" unexpected explicit input: '" + value[0 ]->getName () + " '" );
1675
+ inputs.reserve (value.size ());
1676
+ for (auto * node: value) {
1677
+ inputs.emplace_back (static_cast <BuildNode*>(node));
1678
+ }
1646
1679
}
1647
1680
1648
1681
virtual void configureOutputs (const ConfigureContext& ctx,
@@ -1715,6 +1748,15 @@ class SymlinkCommand : public Command {
1715
1748
core::Task* task) override {
1716
1749
// Notify the client the command is preparing to run.
1717
1750
bsci.getDelegate ().commandPreparing (this );
1751
+
1752
+ // The command itself takes no inputs, so just treat any declared inputs as
1753
+ // "must follow" directives.
1754
+ //
1755
+ // FIXME: We should make this explicit once we have actual support for must
1756
+ // follow inputs.
1757
+ for (auto it = inputs.begin (), ie = inputs.end (); it != ie; ++it) {
1758
+ bsci.taskMustFollow (task, BuildKey::makeNode (*it));
1759
+ }
1718
1760
}
1719
1761
1720
1762
virtual void providePriorValue (BuildSystemCommandInterface&, core::Task*,
0 commit comments