-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
tools/build.hpp
Outdated
@@ -18,7 +18,7 @@ namespace antler { | |||
subcommand->footer(std::string(R"(Examples:)") | |||
+ "\n\t" + app.get_name() +R"( build -j3)"); | |||
subcommand->add_option("-p, path", path, "This is the path to the root of the project."); | |||
subcommand->add_option("-j, --jobs", jobs, "The number of submodules fetched at the same time.")->default_val(1); | |||
subcommand->add_option("-j, --jobs", jobs, "The number of submodules fetched at the same time. Default is 0, which means to use git default.")->default_val(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe copy the text from git --help
and specify what git will do when passed 0:
subcommand->add_option("-j, --jobs", jobs, "The number of submodules fetched at the same time. Default is 0, which means to use git default.")->default_val(0); | |
subcommand->add_option("-j, --jobs", jobs, "The number of submodules cloned in parallel. Default is 0, use cpu count.")->default_val(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that because of if git
going to ever change it we should do the same. Also I'm not sure this is same for all git versions so I would rather leave that to git. Your statement sounds like more specific but not 100% correct in all cases. my git says:
-j <n>, --jobs <n> The number of submodules fetched at the same time. Defaults to the submodule.fetchJobs option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point.But I'm not sure sending -j0
uses git's default either.
After more investigation, I don't think --jobs
is used unless --recurse-submodules
is also specified. We don't do that. I am less certain that this is the right answer for #28.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's just remove it at all? Any clue why it was added? It seems to me this is useless. At least in mvp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No clue. I believe removal is appropriate. Our code will be simpler and more maintainable without jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I removed its usage for clone
however it was also used for cmake
build so I set it to processors number by default if specifying zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
Based on this commit I do not believe sending Our target OSes do not contain the fixed release, 2.40. |
include/antler/project/location.hpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for adding docs!
@@ -97,7 +101,7 @@ namespace antler { | |||
|
|||
CLI::App* subcommand = nullptr; | |||
std::string path; | |||
uint32_t jobs = 1; | |||
uint32_t jobs = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we switch this to a negative number then we don't NEED to pass it to cmake. I generally dislike when we lack an option to leave things alone.
uint32_t jobs = 0; | |
int32_t jobs = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And line 43 could switch to
if(jobs < 0)
return system::execute("cmake", {"--build", bin_dir.string()});
return system::execute("cmake", {"--build", bin_dir.string(), "-j", std::to_string(jobs)});
tools/build.hpp
Outdated
@@ -18,7 +19,7 @@ namespace antler { | |||
subcommand->footer(std::string(R"(Examples:)") | |||
+ "\n\t" + app.get_name() +R"( build -j3)"); | |||
subcommand->add_option("-p, path", path, "This is the path to the root of the project."); | |||
subcommand->add_option("-j, --jobs", jobs, "The number of submodules fetched at the same time.")->default_val(1); | |||
subcommand->add_option("-j, --jobs", jobs, "The number of jobs to use with cmake. If 0 is specified (default value) antler will use number of available processors.")->default_val(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subcommand->add_option("-j, --jobs", jobs, "The number of jobs to use with cmake. If 0 is specified (default value) antler will use number of available processors.")->default_val(0); | |
subcommand->add_option("-j, --jobs", jobs, "The number of jobs to use with cmake. If 0 is specified antler will use number of available processors."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that we not ALWAYS pass jobs flag. See comments. But I am willing to accept this as is.
solved #28