Linaro / OpenCSD

CoreSight trace stream decoder developed openly
https://github.com/Linaro/opencsd/wiki
Other
141 stars 53 forks source link

makefile is not tolerant of a path with spaces (OCSD_ROOT/awk script need quotes) #47

Closed mwsealey closed 2 years ago

mwsealey commented 2 years ago

Having OpenCSD source code in a file location with spaces in the path causes the OCSD_ROOT assignment and the awk script that uses it to mess up - creating folders outside the OpenCSD folder path or inside builddir.

Reproduce:

$ cd "/mnt/test/opencsd checkout/build/linux" $ make awk: warning: command line argument /mnt/test/' is a directory: skipped awk: fatal: cannot open filecheckout/decoder/include/opencsd/ocsd_if_version.h' for reading (No such file or directory) awk: warning: command line argument /mnt/test/' is a directory: skipped awk: fatal: cannot open filecheckout/decoder/include/opencsd/ocsd_if_version.h' for reading (No such file or directory) awk: warning: command line argument /mnt/test/' is a directory: skipped awk: fatal: cannot open filecheckout/decoder/include/opencsd/ocsd_if_version.h' for reading (No such file or directory)

Result:

I tried adding quotes as appropriate but never found the right combination in the right places.

mikel-armbb commented 2 years ago

Looking at this is is the sed generation of the OSCD_ROOT that is failing. It is possible to override this in the makefile by exporting a value of OCSD_ROOT in the environment before running make:- e..g. export OCSD_ROOT="\"/disk-2/mleach/opencsd install/decoder\"" This will solve some of the awk / copy issues, but the space in the path string then causes make to fail at a later stage, as the target strings are all ultimately based on OCSD_ROOT

Given that the easiest solution is to simply not have spaces in the checked out path - and the uncertainty of how long it will take to fix, nor the extent of changes required to solve this problem, this will not be investigated further.

A note has been added to the build documentation outlining this limit.