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

Process not handling spaces in executable path #1291

Open
Arthoni opened this issue Jan 21, 2025 · 1 comment
Open

Process not handling spaces in executable path #1291

Arthoni opened this issue Jan 21, 2025 · 1 comment

Comments

@Arthoni
Copy link
Member

Arthoni commented Jan 21, 2025

To replicate:

  1. Use an executable with space in path, eg link a cmake path :
mkdir /tmp/a\ b/
ln -s /usr/bin/cmake /tmp/a\ b/cmake
  1. Apply following patch to test
diff --git a/src/openfluid/utils/tests/Process_TEST.cpp b/src/openfluid/utils/tests/Process_TEST.cpp
index ab54ede3..36d29f29 100644
--- a/src/openfluid/utils/tests/Process_TEST.cpp
+++ b/src/openfluid/utils/tests/Process_TEST.cpp
@@ -81,6 +81,19 @@ BOOST_AUTO_TEST_CASE(check_object)
     BOOST_CHECK(!P.stdOutLines().empty());
   }
 
+  {
+    openfluid::utils::Process P("/tmp/a b/cmake",{"--version"});
+    BOOST_CHECK(P.run());
+    BOOST_CHECK_EQUAL(P.getExitCode(),0);
+    BOOST_CHECK(!P.stdOutLines().empty());
+    std::cout << "??" << std::endl;
+    for (const auto& l : P.stdErrLines())
+    {
+      std::cout << l << std::endl;
+    }
+    std::cout << ".." << std::endl;
+  }
+
   {
     openfluid::utils::Process P(CONFIGTESTS_CMAKE_PROGRAM,{"--version"});
     BOOST_CHECK(P.run());
@Arthoni Arthoni added this to the release-2.2.0 milestone Jan 21, 2025
DorianGerardin added a commit to DorianGerardin/openfluid that referenced this issue Jan 21, 2025
DorianGerardin added a commit to DorianGerardin/openfluid that referenced this issue Jan 21, 2025
Arthoni pushed a commit to Arthoni/openfluid that referenced this issue Jan 22, 2025
(references OpenFLUID#1291)

(co-authored-by: Armel Thöni)
@Arthoni
Copy link
Member Author

Arthoni commented Jan 22, 2025

Current patch not working on Proxy detection (potentially even a regression)
For example, a git.exe or cmake.exe located in "Program Files" directory will not be detected.

Requires further manual investigation

Tip: in Linux OS, copy a git program to new location with space, set PATH with precedence on this new location and check behaviour of Git unit tests

@Arthoni Arthoni assigned DorianGerardin and unassigned Arthoni Jan 22, 2025
Arthoni pushed a commit that referenced this issue Jan 29, 2025
(references #1291)

(co-authored-by: Armel Thöni)
@Arthoni Arthoni modified the milestones: release-2.2.0, release-2.2.+ Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants