You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/10/11 09:07:04 UTC

[GitHub] [nifi-minifi-cpp] adam-markovics opened a new pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

adam-markovics opened a new pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198


   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728114240



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I tried to reproduce the issue on the main branch by building the project with `cmake -DENABLE_SENSORS=ON .. && make -j12 package` command, but after running the binary with the sensors extension present the ini file was not created. Is there something I was missing?

##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I was just wondering why I could not reproduce the issue without this change, maybe some other configuration parameter is missing on my side?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] fgerlits closed pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
fgerlits closed pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r727238354



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       Why does deferred initialization help? Doesn't it just delay the creation of the file?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r730632234



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I checked the fix by running the test on main and with the fix and it seems to be working so we can resolve this thread.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728131667



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       According to Adam, now it's not created unless onSchedule is called.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728229401



##########
File path: extensions/sensors/SensorBase.h
##########
@@ -74,8 +73,8 @@ class SensorBase : public core::Processor {
   };
 
  protected:
-  RTIMUSettings settings;
-  std::unique_ptr<RTIMU> imu;
+  std::unique_ptr<RTIMUSettings> settings_;

Review comment:
       Consider using `std::optional` for late initialization. It avoids one indirection.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
adam-markovics commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r730667551



##########
File path: extensions/sensors/SensorBase.h
##########
@@ -74,8 +73,8 @@ class SensorBase : public core::Processor {
   };
 
  protected:
-  RTIMUSettings settings;
-  std::unique_ptr<RTIMU> imu;
+  std::unique_ptr<RTIMUSettings> settings_;

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728136490



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I was just wondering why I could not reproduce the issue without this change, maybe some other configuration parameter is missing on my side?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728114240



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I tried to reproduce the issue on the main branch by building the project with `cmake -DENABLE_SENSORS=ON .. && make -j12 package` command, but after running the binary with the sensors extension present the ini file was not created. Is there something I was missing?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728131667



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       According to Adam, now it's not created unless onSchedule is called.

##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       Not sure where else to put this file when the processor is actually used, so I'd say leave it as is for now.

##########
File path: extensions/sensors/SensorBase.h
##########
@@ -74,8 +73,8 @@ class SensorBase : public core::Processor {
   };
 
  protected:
-  RTIMUSettings settings;
-  std::unique_ptr<RTIMU> imu;
+  std::unique_ptr<RTIMUSettings> settings_;

Review comment:
       Consider using `std::optional` for late initialization. It avoids one indirection.

##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I missed that part about main, but I saw the issue previously on my machine. My concerns about this are resolved. Let me know @lordgamez if you want to keep this thread open.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
adam-markovics commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r727844473



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       There is another constructor for RTIMUSettings, where we can specify a directory where the settings file will be created. This could be preferred if we can agree on where to put it. Definitely not in the current working directory.
   `RTIMUSettings(const char *settingsDirectory, const char *productType);`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
adam-markovics commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728136970



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       Gábor said he tried it on main. I'm not sure why you didn't see it, perhaps there are some other conditions. I tried it with just the same CMake options as the ones for Ubuntu 20.04 from ci.yml. Also you could try running ManifestTests:
   `ctest -R ManifestTests`
   After this, git should notice there is a new untracked file.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
adam-markovics commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r727790479



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       The file is not created if the processor is not scheduled. Creating the manifest calls the constructor, but does not schedule the processor. I don't think it is possible to avoid file creation if the processor is actually used.

##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       There is another constructor for RTIMUSettings, where we can specify a directory where the settings file will be created. This could be preferred if we can agree on where to put it. Definitely not in the current working directory.
   `RTIMUSettings(const char *settingsDirectory, const char *productType);`

##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       Gábor said he tried it on main. I'm not sure why you didn't see it, perhaps there are some other conditions. I tried it with just the same CMake options as the ones for Ubuntu 20.04 from ci.yml. Also you could try running ManifestTests:
   `ctest -R ManifestTests`
   After this, git should notice there is a new untracked file.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r728230684



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       I missed that part about main, but I saw the issue previously on my machine. My concerns about this are resolved. Let me know @lordgamez if you want to keep this thread open.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi-minifi-cpp] adam-markovics commented on a change in pull request #1198: MINIFICPP-1664 - Unnecessary RTIMULib.ini file is created

Posted by GitBox <gi...@apache.org>.
adam-markovics commented on a change in pull request #1198:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1198#discussion_r727790479



##########
File path: extensions/sensors/SensorBase.cpp
##########
@@ -51,11 +51,15 @@ void SensorBase::initialize() {
 }
 
 void SensorBase::onSchedule(const std::shared_ptr<core::ProcessContext>& /*context*/, const std::shared_ptr<core::ProcessSessionFactory>& /*sessionFactory*/) {
-  imu = std::unique_ptr<RTIMU>(RTIMU::createIMU(&settings));
-  if (imu) {
-    imu->IMUInit();
-    imu->setGyroEnable(true);
-    imu->setAccelEnable(true);
+  // Deferred instantiation of RTIMUSettings, because it can create a file "RTIMULib.ini" in the working directory.
+  // SensorBase is instantiated when creating the manifest.
+  settings_ = std::make_unique<RTIMUSettings>();

Review comment:
       The file is not created if the processor is not scheduled. Creating the manifest calls the constructor, but does not schedule the processor. I don't think it is possible to avoid file creation if the processor is actually used.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org