-
Notifications
You must be signed in to change notification settings - Fork 6
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
Pass emsdk path from Taskfile to CMake build; Fix emsdk task name in README. #16
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
README.md (1)
37-37
: LGTM! Consider adding a brief explanation.The change from
task emscripten
totask emsdk
accurately reflects the correct task name as mentioned in the PR objectives. This update improves clarity for users setting up the development environment.To further enhance user understanding, consider adding a brief explanation of what the
emsdk
task does. For example:-task emsdk +task emsdk # Downloads and sets up the Emscripten SDKThis addition would provide more context for new contributors.
Taskfile.yml (1)
53-59
: Excellent improvements to the CMake configuration!The changes effectively address the PR objectives by passing the emsdk path from the Taskfile to the CMake build. This approach eliminates the need for hard-coded paths in both the Taskfile and CMakeLists.txt, improving maintainability.
A few observations:
- The use of
{{.G_EMSDK_DIR}}
ensures that the emsdk path is dynamically set, which is great for flexibility.- Splitting the
cmake
command into multiple lines significantly improves readability.- Separating the configuration and build steps is a good practice for clarity.
For consistency with other multi-line commands in this file, consider adding a
|-
after thecmake \
line:- |- cmake \ -G "Unix Makefiles" \ -DCMAKE_TOOLCHAIN_FILE="{{.G_EMSDK_DIR}}/upstream/emscripten/cmake/Modules/Platform/\ Emscripten.cmake" \ -S "{{.ROOT_DIR}}" \ -B "{{.OUTPUT_DIR}}" - "cmake --build '{{.OUTPUT_DIR}}' --parallel --target '{{.G_CLP_FFI_JS_TARGET_NAME}}'"This change would maintain consistency with the formatting style used elsewhere in the file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- README.md (1 hunks)
- Taskfile.yml (1 hunks)
🔇 Additional comments (1)
Taskfile.yml (1)
Line range hint
1-124
: Reminder: Update README with correct emsdk task nameThe changes in this file successfully address the part of the PR objectives related to passing the emsdk path from Taskfile to CMake build. However, the PR objectives also mention fixing the emsdk task name in the README. Please ensure that the README file has been updated accordingly to maintain consistency with these changes.
To verify the README update, you can run the following command:
This will help ensure that the documentation accurately reflects the task name used in the Taskfile.
✅ Verification successful
✅ README Updated with Correct
task emsdk
ReferenceThe
README.md
file includes the correcttask emsdk
reference at line 37, ensuring consistency with the changes made inTaskfile.yml
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if README.md mentions the correct emsdk task name grep -n "task emsdk" README.mdLength of output: 46
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.
Validated by changing G_EMSDK_DIR to a directory outside of project root and running task
still succeeded.
The code changes lgtm and the PR title is fine for the final commit message.
Description
Currently, the
emsdk
path in the Taskfile and the one in CMakeLists.txt (forCMAKE_TOOLCHAIN_FILE
) are both set tobuild/emsdk
; this means changing one requires changing the other. Instead, this PR setsCMAKE_TOOLCHAIN_FILE
when configuring the CMake project in the Taskfile (so the Taskfile becomes the single source of truth).Of course, for IDEs that use CMakeLists.txt directly, they will use the hard-coded path in the CMakeLists.txt which may be out of sync with the one in the Taskfile. Ideally, both the Taskfile and CMakeLists.txt could read from some kind of
.env
file, but that seems like more work than it's worth.This PR also corrects the
emsdk
task name in the README.Validation performed
task clp-ffi-js
succeeded.G_EMSDK_DIR
in the Taskfile andtask clp-ffi-js
still succeeded.Summary by CodeRabbit
Documentation
README.md
to reflect the correct command for initializing Emscripten.Chores
clp-ffi-js
task inTaskfile.yml
for improved readability and updated thecmake
command to include the Emscripten toolchain file.