Skip to content

Use std compliant non-method std::filesystem::exists function#1502

Merged
clalancette merged 1 commit intoros2:masterfrom
jdlangs:fix/std-filesystem-compliance
Jan 5, 2021
Merged

Use std compliant non-method std::filesystem::exists function#1502
clalancette merged 1 commit intoros2:masterfrom
jdlangs:fix/std-filesystem-compliance

Conversation

@jdlangs
Copy link
Copy Markdown
Contributor

@jdlangs jdlangs commented Jan 2, 2021

I was looking into updating rcpputils::fs to be more compliant with std::filesystem for an eventual C++17 migration and found the current functionality includes a path::exists() method which doesn't exist in std::filesystem. This simply changes usage to the non-member function and can be merged regardless of any future changes to rcpputils.

Signed-off-by: Josh Langsfeld <josh.langsfeld@gmail.com>
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Seems reasonable. I'll run CI on it next.

@clalancette
Copy link
Copy Markdown
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@clalancette
Copy link
Copy Markdown
Contributor

All right, CI looks good, so merging. Thanks for the contribution.

@clalancette clalancette merged commit b9ef1fe into ros2:master Jan 5, 2021
@jdlangs jdlangs deleted the fix/std-filesystem-compliance branch January 5, 2021 17:05
@jdlangs
Copy link
Copy Markdown
Contributor Author

jdlangs commented Jan 5, 2021

Thanks!

I'm not familiar with the procedure for getting stuff like this backported; what are the usual steps? Am I expected to take the lead on it?

@clalancette
Copy link
Copy Markdown
Contributor

I'm not familiar with the procedure for getting stuff like this backported; what are the usual steps? Am I expected to take the lead on it?

That's most expedient, yes. Though I'm not entirely sure this makes sense to backport. First, it is only in a test. And second, we won't be switching Foxy to C++17, so the fact that it isn't 100% compliant with std::filesystem doesn't matter as much. What's your thinking here?

@jdlangs
Copy link
Copy Markdown
Contributor Author

jdlangs commented Jan 6, 2021

It's really just so I don't have to keep around a forked version if combined with a modified rcpputils (since I'll have foxy versions as my baseline). But yeah, it's not a huge improvement since the std::filesystem stuff can't be backported anyways.

Is the process just opening a PR against foxy with this commit cherry-picked on to a new branch?

@clalancette
Copy link
Copy Markdown
Contributor

Is the process just opening a PR against foxy with this commit cherry-picked on to a new branch?

Yeah, that should do it for this PR.

@jdlangs
Copy link
Copy Markdown
Contributor Author

jdlangs commented Jan 6, 2021

Ok thanks; if it looks like it will save some effort I'll go ahead with that, otherwise I won't bother you guys.

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.

3 participants