CocoaPods-app icon indicating copy to clipboard operation
CocoaPods-app copied to clipboard

CocoaPods-App cannot be built when there are spaces in the path

Open endocrimes opened this issue 8 years ago • 1 comments

The pkg-config build step doesn't seem to be escaping paths correctly.

$ pwd
/Users/daniel/Development/Open Source/CocoaPods-app
$ rake  bundle:build
cd workbench/pkg-config-0.28 && ./configure --enable-static --with-internal-glib --prefix '/Users/daniel/Development/Open Source/CocoaPods-app/destroot/dependencies'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
checking build system type... x86_64-apple-darwin15.0.0
checking host system type... x86_64-apple-darwin15.0.0
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... /usr/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/daniel/Development/Open Source/CocoaPods-app/workbench/pkg-config-0.28':
configure: error: C compiler cannot create executables
See `config.log' for more details
rake aborted!
Command failed with status (77): [cd workbench/pkg-config-0.28 && ./configur...]
/Users/daniel/Development/Open Source/CocoaPods-app/Rakefile:129:in `block in <top (required)>'
Tasks: TOP => bundle:build => bundle:build_tools => destroot/bundle/bin/ruby => workbench/ruby-2.2.3/libruby-static.a => destroot/dependencies/bin/pkg-config => workbench/pkg-config-0.28/pkg-config
(See full trace by running task with --trace)

config.log:

...
configure:3383: /usr/bin/clang -mmacosx-version-min=10.9 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I/Users/daniel/Development/Open Source/CocoaPods-app/destroot/dependencies/include -L/Users/daniel/Development/Open Source/CocoaPods-app/destroot/dependencies/lib conftest.c  >&5
clang: error: no such file or directory: 'Source/CocoaPods-app/destroot/dependencies/include'
clang: error: no such file or directory: 'Source/CocoaPods-app/destroot/dependencies/lib'
...

endocrimes avatar Nov 14 '15 19:11 endocrimes

Interesting, so it seems to be an internal configure (?) issue, as the path is given to the configure script in a quoted fashion.

Can you try fixing it by shell escaping the path when passing it to the configure script? E.g.

$ ruby
require 'shellwords'
puts '/foo bar/baz'.shellescape
ctrl^d

Which results in:

/foo\ bar/baz

alloy avatar Nov 14 '15 20:11 alloy