giellalt / template-lang-und

A template repo for new languages, as well as to update existing language repos with.
https://giellalt.uit.no/
GNU Lesser General Public License v3.0
2 stars 1 forks source link

`./configure` chokes on giella-core version check if there are spaces in path #12

Open reynoldsnlp opened 3 years ago

reynoldsnlp commented 3 years ago

One of my students had a mysterious error complaining about a outdated giella-core, but the problem was that it was choking on a space in a directory name in her path (in her case, BYU Junior Year/:

checking for gt-version.sh... /Users/username/Documents/BYU Junior Year/GitHub/lang-fro/./../giella-core/scripts/gt-version.sh
checking the version of the Giella Core... ./configure: line 3296: /Users/username/Documents/BYU: No such file or directory
flammie commented 3 years ago

I think there will be lots more, also not merged to languages yet.

TinoDidriksen commented 3 years ago

Spaces in paths are generally just a bad idea when working with anything that builds or generates from sources. Should it work? Yes. Will it work? Probably not. And even when you fix all current paths, new ones will crop up.

flammie commented 3 years ago

I just made some extra testing to uncover other problems:

$  mkdir dir\ with\ spaces
$ cd dir\ with\ spaces
$  git clone git@github.com:giellalt/lang-zxx
$  cd lang-zxx/
$ ./autogen.sh 
basename: ekstra operand «spaces/lang-zxx»
Prøv å skrive «basename --help» for mer informasjon.

Looking for giella-core ...
./autogen.sh: linje 62: test: for mange argumenter
Nothing found, cloning giella-core in ../
Klone nach 'giella-core' ...
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
remote: Enumerating objects: 161, done.
remote: Counting objects: 100% (161/161), done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 20688 (delta 80), reused 139 (delta 71), pack-reused 20527
Empfange Objekte: 100% (20688/20688), 11.44 MiB | 7.49 MiB/s, Fertig.
Löse Unterschiede auf: 100% (12675/12675), Fertig.

Looking for giella-shared ...
./autogen.sh: linje 62: test: for mange argumenter
Nothing found, cloning giella-shared in ../
Klone nach 'giella-shared' ...
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
remote: Enumerating objects: 150, done.
remote: Counting objects: 100% (150/150), done.
remote: Compressing objects: 100% (129/129), done.
remote: Total 7754 (delta 61), reused 89 (delta 0), pack-reused 7604
Empfange Objekte: 100% (7754/7754), 3.28 MiB | 5.21 MiB/s, Fertig.
Löse Unterschiede auf: 100% (3064/3064), Fertig.

basename: ekstra operand «spaces/lang-zxx»
Prøv å skrive «basename --help» for mer informasjon.
Initial automake setup of 
configure.ac:160: installing 'build-aux/config.guess'
configure.ac:160: installing 'build-aux/config.sub'
configure.ac:34: installing 'build-aux/install-sh'
configure.ac:34: installing 'build-aux/missing'
albbas commented 3 years ago

For shell scripts we could probably use shellcheck to root out such problems. It gives e.g. these kinds of reports:

In autogen.sh line 157:
            cp $LOGINFILE $LOGINFILE.gtbackup.${DATE}-${TIME}
                                              ^-----^ SC2086: Double quote to prevent globbing and word splitting.
flammie commented 3 years ago

I kind of fixed most of the stuff but it turns out the fix for pkg-config not accepting spaces in explicit path only works for pkgconf and not the original pkg-config so the one remaining problem is with giella-common pkg-config stuff in configure