Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Initial merge with xeus-clang-repl (mini) #46

Merged

Conversation

alexander-penev
Copy link
Collaborator

No description provided.

@alexander-penev alexander-penev force-pushed the MergeXeusClangReplMini branch from 23fb2f4 to 78155cb Compare March 16, 2024 17:45
src/xinterpreter.cpp Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 53.70370% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 49.14%. Comparing base (2fcfd27) to head (8880063).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
- Coverage   49.29%   49.14%   -0.15%     
==========================================
  Files          15       15              
  Lines         779      643     -136     
==========================================
- Hits          384      316      -68     
+ Misses        395      327      -68     
Files Coverage Δ
src/xinterpreter.cpp 66.45% <74.19%> (+10.24%) ⬆️
src/xinspect.hpp 57.14% <26.08%> (+0.42%) ⬆️

... and 2 files with indirect coverage changes

Files Coverage Δ
src/xinterpreter.cpp 66.45% <74.19%> (+10.24%) ⬆️
src/xinspect.hpp 57.14% <26.08%> (+0.42%) ⬆️

... and 2 files with indirect coverage changes

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

github-actions[bot]

This comment was marked as resolved.

@vgvassilev vgvassilev force-pushed the MergeXeusClangReplMini branch from a65e661 to 057483b Compare March 19, 2024 21:26
github-actions[bot]

This comment was marked as resolved.

CMakeLists.txt Outdated Show resolved Hide resolved
@alexander-penev alexander-penev force-pushed the MergeXeusClangReplMini branch 2 times, most recently from b4c39de to 329a72b Compare March 21, 2024 01:58
github-actions[bot]

This comment was marked as resolved.

@alexander-penev alexander-penev force-pushed the MergeXeusClangReplMini branch from 60a8e7b to a3898f7 Compare March 21, 2024 02:32
@vgvassilev vgvassilev force-pushed the MergeXeusClangReplMini branch from f739d95 to 0be6de3 Compare March 21, 2024 09:01
github-actions[bot]

This comment was marked as resolved.

@vgvassilev vgvassilev force-pushed the MergeXeusClangReplMini branch from 0be6de3 to e75bdc8 Compare March 21, 2024 09:09
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
@compiler-research compiler-research deleted a comment from github-actions bot Mar 21, 2024
// Inject versions of printf and fprintf that output to std::cout
// and std::cerr (see implementation above).
inject_symbol("printf", llvm::pointerToJITTargetAddress(printf_jit), *m_interpreter);
inject_symbol("fprintf", llvm::pointerToJITTargetAddress(fprintf_jit), *m_interpreter);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious to know if/why we don't need these functions anymore ?

Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a better way to redirect i/o streams with CppInterOp. That will be part of a new PR as we discussed to do a minimal change with this one.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is fine removing the injection of printf, but I think we should keep the C++ buffer redirection bits (as you did in this PR).

A file-based redirection won't give the same level of control as the streambuf implementation, and will also redirect things such as std::clog which are meant for the console.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where does std::clog writes to? We only redirect file descriptors 1 and 2.

Copy link
Collaborator

Choose a reason for hiding this comment

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

std::clog will print to stdout by default - so will be directed to the frontend.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn’t that what we should expect if a user type std::clog in a jupyter cell? If not we can make the redirection of std::clog go somewhere else.

@anutosh491
Copy link
Collaborator

I think this looks fine to start with (still need to go through the changes in CMakeLists.txt). Wrote a few comments. I was anyways unhappy with the special branching we had in process_code which was being used in execute_request_impl . That makes more sense now.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@SylvainCorlay
Copy link
Collaborator

clang-tidy review says "All clean, LGTM! 👍"

Could we disable the clang tidy "LGTM" comments?

@mcbarton
Copy link
Collaborator

@SylvainCorlay The following changes can be made to the README now that the feedstock has been updated (cannot seem to provide a link to the readme so are detailed below)
xeus-cpp has not been packaged for the mamba (or conda) package manager.
Since it is now available to for multiple platforms through conda-forge this can be changed.

mamba install notebook cmake cxx-compiler xeus-zmq nlohmann_json=3.11.2 cppzmq xtl jupyterlab clangdev=16 cpp-argparse pugixml doctest -c conda-forge
Needs to be changed to include CppInterOp, and possibly the restriction to clangdev=16

The dependencies section table needs to be updated to include the dependency on CppinterOp, and updated restriction of cpp-argparse for main.

@SylvainCorlay
Copy link
Collaborator

@SylvainCorlay The following changes can be made to the README now that the feedstock has been updated (cannot seem to provide a link to the readme so are detailed below)
xeus-cpp has not been packaged for the mamba (or conda) package manager.
Since it is now available to for multiple platforms through conda-forge this can be changed.

The mention that xeus-cpp has not been packaged should probably be changed.
The mention to cppinterop should be included in this PR I guess.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

CMakeLists.txt Outdated Show resolved Hide resolved
@vgvassilev
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Could we disable the clang tidy "LGTM" comments?

We could but I find it useful for most PRs. That spares several clicks for the reviewers.

@vgvassilev
Copy link
Contributor

@SylvainCorlay, can we make another review iteration?

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

- xeus >=3.0.5,<4.0
- xtl >=0.7,<0.8
- llvm =16.0.6
- CppInterOp
- cpp-argparse
Copy link
Collaborator

@anutosh491 anutosh491 Mar 26, 2024

Choose a reason for hiding this comment

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

Should we pin this to <3.1 too ?

@vgvassilev
Copy link
Contributor

@SylvainCorlay, can we move forward here? Is there something else we should improve as part of this pull request?

@SylvainCorlay SylvainCorlay merged commit 06b171f into compiler-research:main Apr 2, 2024
7 checks passed
@SylvainCorlay
Copy link
Collaborator

Merged!

@@ -1,9 +1,16 @@
{
"display_name": "cpp 14 (xcpp)",
"env": {
"PATH":"@XEUS_CPP_PATH@",
"LD_LIBRARY_PATH":"@XEUS_CPP_LD_LIBRARY_PATH@"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I merged, but I wonder why we need to set these up exactly, if it wasn't required before?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @alexander-penev

I actually have a doubt along similar lines. I understand how something like resource dir can contribute and hence it is good to have it introduced in argv as done in the PR !

But I am not sure how PATH (especially LD_LIBRARY_PATH) has a role to play here. As pointed out by Sylvain, xeus-cling never needed these. Can it be removed ?

configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/xcpp/kernel.json.in"
"${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/xcpp/kernel.json"
)
Copy link
Collaborator

@SylvainCorlay SylvainCorlay Apr 2, 2024

Choose a reason for hiding this comment

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

What is the benefit of this version compared to the previous one?

(trying to understand better because keeping cmake files of xeus-based kernels similar makes it easier to make changes across all kernels).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants