-
Notifications
You must be signed in to change notification settings - Fork 472
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
replace shell scripts with x.py #725
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
x.py
Outdated
find_command("autoconf", msg="autoconf is required to build jemalloc") | ||
cmake = find_command("cmake", msg="CMake is required") | ||
|
||
output = run([cmake, "-version"], stdout=subprocess.PIPE) | ||
output = run(["head", "-n", "1"], stdin=output, stdout=subprocess.PIPE) | ||
output = run(["sed", "s/[^0-9.]*//g"], stdin=output, stdout=subprocess.PIPE) | ||
cmake_version = output.read().decode().strip() | ||
if semver.compare(cmake_version, CMAKE_REQUIRE_VERSION) < 0: | ||
raise RuntimeError(f"CMake {CMAKE_REQUIRE_VERSION} or higher is required, got: {cmake_version}") |
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 download CMake here if it's missing. Since it causes issue like #712 and I'd prefer to let the user explicit download such significant and complex configurable dependency.
Anyway, if we don't automatically download autoconf, why CMake?
Signed-off-by: tison <wander4096@gmail.com>
02a6f5f
to
a60825e
Compare
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Look like we run out of OSS only credit on Travis CI and all pending jobs (at least of Kvrocks) are hanging to be queued. I'm asking INFRA on Slack for help. UPDATE - It seems something wrong with Travis CI. Waiting for verification :( |
Co-authored-by: Twice <twice@apache.org>
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.
LGTM
cmake_require_version = '.'.join(map(str, CMAKE_REQUIRE_VERSION)) | ||
cmake_semver = SEMVER_REGEX.match(cmake_version) | ||
if cmake_semver is None: | ||
raise RuntimeError(f"CMake {cmake_require_version} or higher is required, got: {cmake_version}") |
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 think we can provide a URL for users and developers to download suitable cmake, like https://github.com/Kitware/CMake/releases or https://cmake.org/download/
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.
Also, I think it would be good to provide a --cmake-bin
to customize the use of the cmake executable.
These can be done in subsequent PRs.
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 think it's too cumbersome to convey possible download links. Still we don't recommend for autoconf and users should be easily to search how to download CMake. For example, as a macOS user I'd prefer to manage CMake via Homebrew instead of download from either links provided here.
It's too much to a downstream project heuristically educating users to install a dependency.
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.
Also we already provide some preferred defaults about getting prerequisites in the README.md file.
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.
Also, I think it would be good to provide a
--cmake-bin
to customize the use of the cmake executable.
Yes. This sounds reasonable to me.
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.
@PragmaTwice since this patch merged, you may create an issue for --cmake-bin
.
- name: Lint and check code | ||
run: | | ||
./cpplint.sh | ||
./cppcheck.sh | ||
./x.py check cpplint |
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.
Just curious, why do we call this file x.py
?
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.
Naming is hard. I stolen the idea from rust-lang/rust to call the universal script entrypoint x.py
.
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.
Got it, thanks @tisonkun
@PragmaTwice @git-hulk I'll run Hope Travis CI can fix the queuing issue in time :( |
Merging... |
See also #692 (comment)