Open Dushistov opened 7 years ago
I need to think about this properly, but at the moment, this library could be used to build anything, including non-rust stuff. Might it be better to create another library that re-exports stuff from this library, and adds any useful rust stuff, like the above?
@derekdreery
I need to think about this properly, but at the moment, this library could be used to build >anything, including non-rust stuff.
Oh, I missed this point.
Might it be better to create another library that re-exports stuff from this library, and adds any useful rust stuff, like the above?
Is it too complicated, why not just add method like all_rules_depend_on_build_rs()
to DepGraphBuilder
?
ok I could do that.
@derekdreery
ok I could do that.
Great, I would like integrate depgraph
into one of my opensource projects,
to use this project you have to use build.rs
, and users complain about its
complexity, I hope with help of depgraph
to make it little simplier.
I've added a function in commit e2009f3 that adds a dependency to all previously added files, so at the end of a chain, you can do
.add_dep_to_all("build.rs")
Does this solve your problem?
@derekdreery
Yes, thank you.
@derekdreery
I did additional testing, and see one bad thing, depgraph gives build.rs
as dependency
to rule. Is it possible to not inform rules about this depedency?
Because of it is inconvinient in each rule add .filter_map
to remove build.rs
.
OK, so maybe instead of adding this file as a dependency, it could go into a separate global pool of files that will always trigger rebuilds, but don't inform the build functions of their presence.
At now if you change something in
build.rs
, rust-lang/cargo automaticaly runbuild.rs
, but rules run only you explicity addbuild.rs
to dependency graph.Of course explicity better then implicity, but I can not think of usage scenario where you not need dependency from
build.rs
?So why not add implicity rule that any rule depend also from
build.rs
?