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

Solution for issue#8 #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xadaemon
Copy link
Contributor

@xadaemon xadaemon commented Feb 20, 2023

This is my initial solution, needs the tests and such, but I wanted to get your opinion on it before going further in this path.

Should fix #8

@xadaemon xadaemon changed the title RFC of the solution for #8 RFC of the solution for issue#8 Feb 20, 2023
@gregschmit
Copy link
Owner

Since only some arguments are supposed to be passed to sub-make, we might want a helper method on Args to compile an argument string from those options which should be passed to sub-make.

@gregschmit gregschmit self-requested a review February 20, 2023 21:15
@gregschmit gregschmit self-assigned this Feb 20, 2023
@xadaemon
Copy link
Contributor Author

Since only some arguments are supposed to be passed to sub-make, we might want a helper method on Args to compile an argument string from those options which should be passed to sub-make.

Yeah, I think it's a good way to do it, I will implement the function.

@xadaemon
Copy link
Contributor Author

I have moved the submake arg str generation to arg.rs

@xadaemon xadaemon changed the title RFC of the solution for issue#8 Solution for issue#8 Feb 22, 2023
src/vars.rs Outdated Show resolved Hide resolved
src/vars.rs Outdated Show resolved Hide resolved
src/vars.rs Outdated Show resolved Hide resolved
src/vars.rs Outdated Show resolved Hide resolved
src/args.rs Outdated
Comment on lines 88 to 97
if arg_mod.starts_with("--") {
arg_mod = arg_mod[2..].to_string();
} else if arg_mod.starts_with('-') {
arg_mod = arg_mod[1..].to_string();
}

// remove special cases
if SUBMAKE_FORBIDDEN_FLAGS.contains(&arg_mod.as_str()) {
arg_mod = "".to_string();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure, but I think this would fail for an argument like -abc, where it's 3 single flags passed as a single arg. I know clap handles that, so it might be better to add this as a method under impl Args and use the struct information to construct args to pass to any sub-make.

If I'm wrong about this not working for coalesced flags, then feel free to ignore this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will get around to this one tomorrow, should we add the args to the context?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think context should contain the args, I just think the helper should use the args struct that is attached to the Makefile.

@xadaemon
Copy link
Contributor Author

xadaemon commented Mar 2, 2023

I didn't get notified about your reviews, github... I will work on those :)

@xadaemon
Copy link
Contributor Author

xadaemon commented Mar 2, 2023

Some, I believe unrelated tests, have started failing I will make sure they are not related tomorrow.

@gregschmit
Copy link
Owner

Let me know if you want help getting this branch up to date with master; I am happy to merge master in and resolve conflicts. If you do want help, just let me know when you're at a good stopping point.

@xadaemon
Copy link
Contributor Author

xadaemon commented Mar 2, 2023

Let me know if you want help getting this branch up to date with master; I am happy to merge master in and resolve conflicts. If you do want help, just let me know when you're at a good stopping point.

I think I'm at a good stopping point, might want to get them merged before I work on the last point (the args one), maybe merge this and I open up another pr with the final improvement on that one?

@gregschmit
Copy link
Owner

Sounds good; I'll merge master into this, fix tests, and get it merged and we can continue work on this is another branch.

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 this pull request may close these issues.

Auto-fill the MAKE variable.
2 participants