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

fix(c++): using C++17's nested namespaces #489

Merged
merged 18 commits into from
May 23, 2024

Conversation

ywh555hhh
Copy link
Contributor

Initial modifications to feat(c++): Use C++17's nested namespaces #473 completed, involving content of anonymous namespace and content in result.hpp not changed yet

Reason for this PR

to slove the issue #473

What changes are included in this PR?

Most cpp folders need to use cpp17 nested loops

Are these changes tested?

No local tests

Are there any user-facing changes?

no

Initial modifications to feat(c++): Use C++17's nested namespaces apache#473 completed, involving content of anonymous namespace and content in result.hpp not changed yet
fix: Corrected minor errors in uri_parser.h
@ywh555hhh ywh555hhh changed the title fix: Resolved the issue of using C++17's nested namespaces #473 fix: #473 Resolved the issue of using C++17's nested namespaces May 22, 2024
@ywh555hhh
Copy link
Contributor Author

I seem to be ignoring some of the call logic for nested namespaces and I'll fix it myself

@acezen
Copy link
Contributor

acezen commented May 22, 2024

Hi @ywh555hhh, thanks for the work, the CI indicate that the code format check is failed. Please follow the

sudo curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-22538c65/clang-format-8_linux-amd64 --output /usr/bin/clang-format
sudo chmod +x /usr/bin/clang-format

to install clang-format 8.0 and fix the format with

make graphar-clformat

@@ -89,7 +89,7 @@ struct Uri {
{}
};

}
Copy link
Contributor

Choose a reason for hiding this comment

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

we better to keep the thirdparty code as their origin, not to modify them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

received

@ywh555hhh
Copy link
Contributor Author

I encountered an error when trying to open a project in a container using vscode's remote container plug-in. How can I solve it?

Error response from daemon: pull access denied for registry.cn-hongkong.aliyuncs.com/graphscope/graphar-dev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

@acezen
Copy link
Contributor

acezen commented May 22, 2024

I encountered an error when trying to open a project in a container using vscode's remote container plug-in. How can I solve it?

Error response from daemon: pull access denied for registry.cn-hongkong.aliyuncs.com/graphscope/graphar-dev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

It seems that the image has been expired, I have re-pushed it, can you try again?

@ywh555hhh
Copy link
Contributor Author

info2.txt
I've tried it with both macos and linux and it still doesn't seem to work

@acezen
Copy link
Contributor

acezen commented May 22, 2024

info2.txt I've tried it with both macos and linux and it still doesn't seem to work

It seems that the image is a private repository, thanks for report the error.
I have created an issue #491 to fix this.

@acezen
Copy link
Contributor

acezen commented May 22, 2024

info2.txt I've tried it with both macos and linux and it still doesn't seem to work

It seems that the image is a private repository, thanks for report the error. I have created an issue #491 to fix this.

Hi, @ywh555hhh, the image has been updated, could you rebase the main and try again? sorry for the obstruction.

@ywh555hhh
Copy link
Contributor Author

I'm happy to contribute to the community, but I also want to know how to solve the formatting problem. If I can't use docker right now, it means I need to fix the problem on macOS

@acezen
Copy link
Contributor

acezen commented May 22, 2024

'm happy to contribute to the community, but I also want to know how to solve the formatting problem. If I can't use docker right now, it means I need to fix the problem on macOS

the clang-format-8 is also available for macos:

curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-22538c65/clang-format-8_macosx-amd64 --output clang-format

or you can edit the code directly and fix the format base on the information provided by CI:
https://github.com/apache/incubator-graphar/actions/runs/9188486680/job/25270239169?pr=489

cpp/include/graphar/util/filesystem.h Outdated Show resolved Hide resolved
cpp/include/graphar/util/filesystem.h Outdated Show resolved Hide resolved
cpp/include/graphar/util/filesystem.h Outdated Show resolved Hide resolved
cpp/include/graphar/fwd.h Show resolved Hide resolved
cpp/include/graphar/util/result.h Outdated Show resolved Hide resolved
@@ -349,5 +348,4 @@ Result<std::shared_ptr<arrow::Table>> EdgesBuilder::getOffsetTable(
return arrow::Table::Make(schema, arrays);
}

} // namespace builder
} // namespace graphar
} // namespace graphar::builder
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

cpp/src/filesystem.cc Outdated Show resolved Hide resolved
cpp/src/reader_util.cc Outdated Show resolved Hide resolved
cpp/src/util.cc Outdated Show resolved Hide resolved
cpp/src/vertices_builder.cc Outdated Show resolved Hide resolved
@acezen
Copy link
Contributor

acezen commented May 22, 2024

It's better not to delete the empty line in the end of the source file. FYI
https://stackoverflow.com/questions/2287967/why-is-it-recommended-to-have-empty-line-in-the-end-of-a-source-file

Copy link
Contributor

@acezen acezen left a comment

Choose a reason for hiding this comment

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

Seems that you have changed the permission of cpp/misc/cpplint.py, is there a reason to change this?

@ywh555hhh
Copy link
Contributor Author

ywh555hhh commented May 22, 2024

Seems that you have changed the permission of cpp/misc/cpplint.py, is there a reason to change this?

I had no intention of doing that. Could this have been some kind of operational error that I wasn't aware of. Sorry

@acezen
Copy link
Contributor

acezen commented May 22, 2024

Seems that you have changed the permission of cpp/misc/cpplint.py, is there a reason to change this?

I had no intention of doing that. Could this have been some kind of operational error that I wasn't aware of. Sorry

It would make the CI failed. see
https://github.com/apache/incubator-graphar/actions/runs/9190636917/job/25275644225?pr=489

You can revert it to the original commit with git
https://stackoverflow.com/questions/215718/how-can-i-reset-or-revert-a-file-to-a-specific-revision

@ywh555hhh
Copy link
Contributor Author

Seems that you have changed the permission of cpp/misc/cpplint.py, is there a reason to change this?

I had no intention of doing that. Could this have been some kind of operational error that I wasn't aware of. Sorry

It would make the CI failed. see https://github.com/apache/incubator-graphar/actions/runs/9190636917/job/25275644225?pr=489

You can revert it to the original commit with git https://stackoverflow.com/questions/215718/how-can-i-reset-or-revert-a-file-to-a-specific-revision

Thanks for the Pointers. I really appreciate you taking the time to mentor me

@acezen
Copy link
Contributor

acezen commented May 22, 2024

Seems that you have changed the permission of cpp/misc/cpplint.py, is there a reason to change this?

I had no intention of doing that. Could this have been some kind of operational error that I wasn't aware of. Sorry

It would make the CI failed. see https://github.com/apache/incubator-graphar/actions/runs/9190636917/job/25275644225?pr=489
You can revert it to the original commit with git https://stackoverflow.com/questions/215718/how-can-i-reset-or-revert-a-file-to-a-specific-revision

Thanks for the Pointers. I really appreciate you taking the time to mentor me

You are welcome. We are pleased to have your contribution.

@ywh555hhh
Copy link
Contributor Author

I'll give clang-format-8 a try

@ywh555hhh
Copy link
Contributor Author

The version of clang-format I used was wrong and I will try to install the required version myself

@ywh555hhh
Copy link
Contributor Author

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % 

I have successfully installed clang-format but I can't run the clformat command. What is the problem? And the cpp folder that I noticed contains the.clang-format file, which says the format standard

@acezen acezen changed the title fix: #473 Resolved the issue of using C++17's nested namespaces fix(c++): using C++17's nested namespaces May 23, 2024
@acezen
Copy link
Contributor

acezen commented May 23, 2024

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % 

I have successfully installed clang-format but I can't run the clformat command. What is the problem? And the cpp folder that I noticed contains the.clang-format file, which says the format standard

the command

make graphar-clformat

is run in the build directory if you create a build dir

@ywh555hhh
Copy link
Contributor Author

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % 

I have successfully installed clang-format but I can't run the clformat command. What is the problem? And the cpp folder that I noticed contains the.clang-format file, which says the format standard

the command

make graphar-clformat

is run in the build directory if you create a build dir

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % cd ..
yiweihan@yiweihandeMacBook-Air incubator-graphar % mkdir build
yiweihan@yiweihandeMacBook-Air incubator-graphar % cd build
yiweihan@yiweihandeMacBook-Air build % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air build % 

Did I misunderstand something? I don't even seem to be looking for the Makefile

Copy link
Contributor

@acezen acezen left a comment

Choose a reason for hiding this comment

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

Overall LGTM, and there have some nits to be fixed

cpp/include/graphar/util/reader_util.h Show resolved Hide resolved
namespace graphar {

namespace util {
namespace graphar::util {
Copy link
Contributor

Choose a reason for hiding this comment

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

add an empty line before namespace for code clarity


namespace graphar {
namespace builder {
namespace graphar::builder {
Copy link
Contributor

Choose a reason for hiding this comment

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

add an empty line before namespace for code clarity

namespace graphar {
namespace ds = arrow::dataset;
namespace detail {
namespace graphar::detail {
Copy link
Contributor

Choose a reason for hiding this comment

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

here need empty line between header include and implementation

@@ -79,7 +76,9 @@ static Status CastToLargeOffsetArray(
GAR_RETURN_ON_ARROW_ERROR_AND_ASSIGN(out, arrow::ChunkedArray::Make(chunks));
return Status::OK();
}
} // namespace detail
} // namespace graphar::detail
Copy link
Contributor

Choose a reason for hiding this comment

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

Add empty line here for code clarify

@acezen
Copy link
Contributor

acezen commented May 23, 2024

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % 

I have successfully installed clang-format but I can't run the clformat command. What is the problem? And the cpp folder that I noticed contains the.clang-format file, which says the format standard

the command

make graphar-clformat

is run in the build directory if you create a build dir

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % cd ..
yiweihan@yiweihandeMacBook-Air incubator-graphar % mkdir build
yiweihan@yiweihandeMacBook-Air incubator-graphar % cd build
yiweihan@yiweihandeMacBook-Air build % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air build % 

Did I misunderstand something? I don't even seem to be looking for the Makefile

you need to run cmake .. before make. It's the same with building process

@ywh555hhh
Copy link
Contributor Author

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % 

I have successfully installed clang-format but I can't run the clformat command. What is the problem? And the cpp folder that I noticed contains the.clang-format file, which says the format standard

the command

make graphar-clformat

is run in the build directory if you create a build dir

yiweihan@yiweihandeMacBook-Air cpp %  clang-format --version
clang-format version 8.0.1 (tags/RELEASE_801/final)
yiweihan@yiweihandeMacBook-Air cpp % make clformat          
make: *** No rule to make target `clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air cpp % cd ..
yiweihan@yiweihandeMacBook-Air incubator-graphar % mkdir build
yiweihan@yiweihandeMacBook-Air incubator-graphar % cd build
yiweihan@yiweihandeMacBook-Air build % make graphar-clformat
make: *** No rule to make target `graphar-clformat'.  Stop.
yiweihan@yiweihandeMacBook-Air build % 

Did I misunderstand something? I don't even seem to be looking for the Makefile

you need to run cmake .. before make. It's the same with building process

tks I've tried it. Can this be merged now?

@ywh555hhh
Copy link
Contributor Author

Overall LGTM, and there have some nits to be fixed

ok👌🏻

@acezen acezen merged commit d8abc0e into apache:main May 23, 2024
3 checks passed
Elssky pushed a commit to Elssky/incubator-graphar that referenced this pull request Oct 8, 2024
Initial modifications to feat(c++): Use C++17's nested namespaces apache#473 completed, involving content of anonymous namespace and content in result.hpp not changed yet

Reason for this PR
to slove the issue apache#473

What changes are included in this PR?
Most cpp folders need to use cpp17 nested loops

Are these changes tested?
No local tests

Are there any user-facing changes?
no
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.

2 participants