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

feature request: implicit dependency on build.rs? #4

Open
Dushistov opened this issue Jul 28, 2017 · 8 comments
Open

feature request: implicit dependency on build.rs? #4

Dushistov opened this issue Jul 28, 2017 · 8 comments
Assignees

Comments

@Dushistov
Copy link
Contributor

At now if you change something in build.rs,
rust-lang/cargo automaticaly run build.rs,
but rules run only you explicity add build.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?

@richard-uk1 richard-uk1 self-assigned this Jul 29, 2017
@richard-uk1
Copy link
Owner

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?

@Dushistov
Copy link
Contributor Author

@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?

@richard-uk1
Copy link
Owner

ok I could do that.

@Dushistov
Copy link
Contributor Author

@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.

@richard-uk1
Copy link
Owner

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?

@Dushistov
Copy link
Contributor Author

@derekdreery

Yes, thank you.

@Dushistov
Copy link
Contributor Author

@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.

@Dushistov Dushistov reopened this Aug 1, 2017
@richard-uk1
Copy link
Owner

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.

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