cisco-open-source/qtwebdriver

Gyp invoked incorrectly by build.sh on Linux

cfyzium opened this issue · 3 comments

build.sh searches for gyp executable on PATH build.sh:33:

GYP=`which gyp`

and uses it as if it was a Python script build.sh:48:

python $GYP ...

But gyp executable from the corresponding repository is a shell script:

#!/bin/sh
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
base=$(dirname "$0")
exec python "${base}/gyp_main.py" "$@"

Which obviously results in error.

hm, must depend on the gyp version. On ubuntu14, centos6 and 7, I have

$ which gyp
/usr/bin/gyp

$ cat /usr/bin/gyp
#! /usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'gyp==0.1','console_scripts','gyp'
__requires__ = 'gyp==0.1'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
    )

GYP was changed to sh after commit: https://chromium.googlesource.com/external/gyp/+/7ebf72ab%5E%21/#F0

I guess you clone it. If yes either use this commit or install via the package manager of your distrib

Yeah, modifying the code is what we're using right now (as a part of a convoluted build system it is not easy to use the distro package).

However, wouldn't it be more correct to simply invoke the gyp as an executable it is (without explicit python)? That way it should work with any gyp variant without modifying anything.

Done. #43