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

Escape special characters #1862

Conversation

jorblancoa
Copy link
Contributor

Escape characters is needed when compiling with cmake in WSL and nrnivmodl is called passing Windows paths with parenthesis.

Solves #1770

@@ -143,6 +143,8 @@ function(nrn_add_test_group)
# Add a rule to build the modfiles for this test group. Multiple groups may ask for exactly the
# same thing (testcorenrn), so it's worth deduplicating.
set(hash_components ${NRN_ADD_TEST_GROUP_NRNIVMODL_ARGS})
# Escape special characters (problematic with Windows paths when calling nrnivmodl)
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" NRN_RUN_FROM_BUILD_DIR_ENV "${NRN_RUN_FROM_BUILD_DIR_ENV}")
Copy link
Member

Choose a reason for hiding this comment

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

@jorblancoa : could you copy here the problematic path here in this comment? (as an example / as a future reference)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cd /home/jblanco/repos/nrn_master/build/test/nrnivmodl/0a0cdc56d575785edb29649a19eac3b04e88c22c708b0f82d85d347bab8d189a && cmake -E env LD_LIBRARY_PATH=/home/jblanco/repos/nrn_master/build/lib: NEURONHOME=/home/jblanco/repos/nrn_master/build/share/nrn NRNHOME=/home/jblanco/repos/nrn_master/build PATH=/home/jblanco/repos/nrn_master/build/bin:/home/jblanco/.local/bin:/home/jblanco/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program\ Files\ (x86)/NVIDIA\ Corporation/PhysX/Common:/mnt/c/Program\ Files/NVIDIA\ Corporation/NVIDIA\ NvDLISR:/mnt/c/Users/nanak/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/nanak/AppData/Local/Programs/Microsoft\ VS\ Code/bin:/mnt/c/Work/nrn/bin:/mnt/c/Work/nrn/mingw/usr/bin:/snap/bin:/home/jblanco/.fzf/bin PYTHONPATH=/home/jblanco/repos/nrn_master/build/lib/python:/home/jblanco/repos/nrn_master/test/rxd: /home/jblanco/repos/nrn_master/build/bin/nrnivmodl .
/bin/sh: 1: Syntax error: "(" unexpected

As you can see the spaces are escaped but the "(" and ")" are not
/mnt/c/Program\ Files\ (x86)/NVIDIA\ Corporation/PhysX/Common

@codecov-commenter
Copy link

Codecov Report

Merging #1862 (90e28a9) into master (f242cc8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1862   +/-   ##
=======================================
  Coverage   47.12%   47.12%           
=======================================
  Files         543      543           
  Lines      112964   112964           
=======================================
  Hits        53239    53239           
  Misses      59725    59725           

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@azure-pipelines
Copy link

✔️ 90e28a9 -> Azure artifacts URL

@alexsavulescu alexsavulescu merged commit 0dd688a into neuronsimulator:master Jun 22, 2022
alexsavulescu pushed a commit that referenced this pull request Jun 28, 2022
* Escape special characters for problematic Windows paths when calling nrnivmodl
@alexsavulescu alexsavulescu linked an issue Jun 28, 2022 that may be closed by this pull request
alexsavulescu pushed a commit that referenced this pull request Jun 29, 2022
* Escape special characters for problematic Windows paths when calling nrnivmodl
alexsavulescu pushed a commit that referenced this pull request Jul 1, 2022
* Escape special characters for problematic Windows paths when calling nrnivmodl
@alexsavulescu alexsavulescu mentioned this pull request Jul 1, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build on Ubuntu 21.10 (wsl1 or wsl2 on win 10) broken
5 participants