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: removed duplicate file #920

Merged
merged 11 commits into from
Nov 6, 2024
Merged

fix: removed duplicate file #920

merged 11 commits into from
Nov 6, 2024

Conversation

james-ctc
Copy link
Contributor

Describe your changes

EnumFlags.hpp was in two places. Removed duplicate file

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

Copy link
Contributor

@SebaLukas SebaLukas left a comment

Choose a reason for hiding this comment

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

I have compared the two EnumFlags.hpp. There are a few small differences. But they are so small that it is okay.

@SebaLukas
Copy link
Contributor

The bazel build fails because EnumFlags.hpp is missing. So you should change the bazel stuff, too.

@james-ctc
Copy link
Contributor Author

The bazel build fails because EnumFlags.hpp is missing. So you should change the bazel stuff, too.

I'm not sure how bazel works, it doesn't seem to like having relative paths added.
Is bazel actually supported any more, hardly any modules are built using it and none that would provide a good example of how to reference another include directory ...

  • rust_examples/RsExample
  • rust_examples/RsExampleUser
  • PhyVersoBSP/phyverso_gpio
  • PhyVersoBSP/phyverso_mcu_comms
  • GenericPowermeter
  • EnergyNode
  • PersistentStore
  • RsPaymentTerminal
  • EnergyManager
  • SerialCommHub
  • RsIskraMeter
  • Auth
  • DummyTokenValidator
  • EvseManager (for now)

@dorezyuk
Copy link
Contributor

@james-ctc we can probably help fix bazel but removing it to "fix" cannot a serious idea

@@ -21,6 +21,10 @@ target_sources(${MODULE_NAME}
PersistentStore.cpp
)

target_include_directories(${MODULE_NAME} PRIVATE
../../lib/staging/util
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we just link against the lib/stating/util?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why don't we just link against the lib/stating/util?

because there are no object files to link against. EnumFlags.hpp is a header file only.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did we already consider to create a library target for the lib/staging/util stuff (maybe that's what @dorezyuk means)? The library target could be named something like everest::staging::util. Code like here would consume it then via target_link_libraries(${MODULE_NAME} PRIVATE everest::staging::util).
This works also for header-only libraries.
Furthermore we would decouple the information from where the library is located from the consuming code.
@james-ctc: if you need help with this (cmake related), I could help here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@a-w50 thank you for the useful information. I've not heard the term header-only library. I'm still relatively new to cmake (used make for 30+ years) so your help is much appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

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

I will add a commit here

Copy link
Contributor

Choose a reason for hiding this comment

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

@james-ctc I added a commit as a draft on how to include additional libraries (in this case everest::staging::util) including the test via cmake.
It is working now, but I'm not really happy with the namespacing/naming so far. The namespace is quite long. Maybe we can reduce this a bit by using ev instead of everest and staging could become draft. And once it becomes stable it might go to ev::std::util or something similar. Accordingly the include directory structure would need to be adopted.
For now the commit could be taken as is, but soon we should come up with some naming conventions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you for your help.

@james-ctc
Copy link
Contributor Author

@james-ctc we can probably help fix bazel but removing it to "fix" cannot a serious idea

please feel free to add a fix - I don't know bazel at all.

lib/staging/util/CMakeLists.txt Outdated Show resolved Hide resolved
lib/staging/util/tests/CMakeLists.txt Outdated Show resolved Hide resolved
modules/EvseManager/tests/CMakeLists.txt Outdated Show resolved Hide resolved
modules/EvseV2G/tests/CMakeLists.txt Outdated Show resolved Hide resolved
@@ -7,7 +7,7 @@
#include <atomic>
#include <type_traits>

namespace util {
namespace everest::staging::util {

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure how you structure it but I would find the include path everest/staging/util more logical

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, for now this would be more consistent. I'll change that

Copy link
Contributor

Choose a reason for hiding this comment

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

@dorezyuk I removed the one line from the EvseManager/bazel file, as this should not be needed there

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the build works but where do we include it then?

@james-ctc james-ctc merged commit 2ec32d8 into main Nov 6, 2024
10 checks passed
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.

6 participants