shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

Build error with ../configure --ios --cpu arm64 #87

Open Romantic-LiXuefeng opened 4 years ago

Romantic-LiXuefeng commented 4 years ago
LiXuefengs-Mac-mini:myBuild lixuefeng$ ../configure --ios --cpu arm64
Loading required submodules...
Downloading GN from cloud storage...
Generating files for boringssl...
Traceback (most recent call last):
  File "../configure", line 836, in <module>
    sys.exit(main(sys.argv[1:]))
  File "../configure", line 811, in main
    if GenGn(gn_args, parsed_args.ide_) != 0:
  File "../configure", line 215, in GenGn
    return _SilentRun(*cmd)
  File "../configure", line 77, in _SilentRun
    **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
Romantic-LiXuefeng commented 4 years ago

Enverment: macOS Mojave version 10.14.5

TheModMaker commented 4 years ago

Can you still reproduce this? Did you try deleting the whole folder and re-downloading everything? Can you try with the latest master? This appears to be a file permission error, so downloading things could fix things.

Romantic-LiXuefeng commented 4 years ago

@TheModMaker I'm sorry for later response. As you said, I delete the whole folder and re-downloading everything.

LiXuefengs-Mac-mini:foo lixuefeng$ ../configure
Loading required submodules...
Downloading GN from cloud storage...
Generating files for boringssl...
INFO:bootstrap:Installing Go toolset.
INFO:bootstrap:  Old toolset is None
INFO:bootstrap:  New toolset is https://storage.googleapis.com/golang/go1.10.3.darwin-amd64.tar.gz
INFO:bootstrap:Removing /Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/golang
INFO:bootstrap:Downloading https://storage.googleapis.com/golang/go1.10.3.darwin-amd64.tar.gz...
INFO:bootstrap:Extracting...
Traceback (most recent call last):
  File "/Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/go/env.py", line 34, in <module>
    new = bootstrap.prepare_go_environ()
  File "/Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 266, in prepare_go_environ
    bootstrap(logging.INFO)
  File "/Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 258, in bootstrap
    ensure_toolset_installed(TOOLSET_ROOT)
  File "/Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 199, in ensure_toolset_installed
    install_toolset(toolset_root, available)
  File "/Users/lixuefeng/Documents/github/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 134, in install_toolset
    with tarfile.open(pkg_path, 'r:gz') as f:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1685, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1739, in gzopen
    t = cls.taropen(name, mode, fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1715, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1581, in __init__
    self.firstmember = self.next()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2359, in next
    raise ReadError("empty file")
tarfile.ReadError: empty file

There is a new error.

TheModMaker commented 4 years ago

Is that from the first run, or did you run once and that is a second attempt? Are you filtering the logs at all? When I run, I see logs showing downloads for the submodules and progress on downloading the toolset. Could you also post the output of env so I can see environment variables (you can remove session IDs, PATH, etc for privacy)?

It also appears that the file isn't present after downloading it, maybe you have a antivirus or some other program that is deleting it after downloading? I know that my work machine needed an exception to our security system to allow arbitrary, unsigned binaries to be run.

Romantic-LiXuefeng commented 4 years ago

@TheModMaker Thanks for your help! I manually download the [https://storage.googleapis.com/golang/go1.10.3.darwin-amd64.tar.gz](), and place to /shaka-player-embedded/third_party/boringssl/src/util/bot/golang. then modify the /shaka-player-embedded/third_party/boringssl/src/util/bot/bootstrap.py, Delete the shutil.rmtree(p, onerror=onerror if sys.platform == 'win32' else None) and download_file(url, pkg_path)

def remove_directory(path):
  """Recursively removes a directory."""
  assert isinstance(path, (list, tuple))
  p = os.path.join(*path)
  if not os.path.exists(p):
    return
  LOGGER.info('Removing %s', p)
  # Crutch to remove read-only file (.git/* in particular) on Windows.
  def onerror(func, path, _exc_info):
    if not os.access(path, os.W_OK):
      os.chmod(path, stat.S_IWUSR)
      func(path)
    else:
      raise
#  shutil.rmtree(p, onerror=onerror if sys.platform == 'win32' else None)

def install_toolset(toolset_root, url):
  """Downloads and installs Go toolset.

  GOROOT would be <toolset_root>/go/.
  """
  if not os.path.exists(toolset_root):
    os.makedirs(toolset_root)
  pkg_path = os.path.join(toolset_root, url[url.rfind('/')+1:])

  LOGGER.info('Downloading %s...', url)
#  download_file(url, pkg_path)

  LOGGER.info('Extracting...')
  if pkg_path.endswith('.zip'):
    with zipfile.ZipFile(pkg_path, 'r') as f:
      f.extractall(toolset_root)
  elif pkg_path.endswith('.tar.gz'):
    with tarfile.open(pkg_path, 'r:gz') as f:
      f.extractall(toolset_root)
  else:
    raise Failure('Unrecognized archive format')

  LOGGER.info('Validating...')
  if not check_hello_world(toolset_root):
    raise Failure('Something is not right, test program doesn\'t work')

then there is new error!

LiXuefengs-Mac-mini:foo lixuefeng$ ../configure --ios
Loading required submodules...
Downloading GN from cloud storage...
Generating files for boringssl...
Running configure for binutils...
Running configure for clang...
Running configure for sdl2...
Running configure for ffmpeg...
Running configure for gflags...
Running configure for glog...
Running configure for libxml...
Generating build files...
LiXuefengs-Mac-mini:foo lixuefeng$ ../build.py 
[668/1182] ACTION //third_party/ffmpeg:ffmpeg_libs_framework_shared_library(//build/toolchain/mac:ios_clang_x64)
FAILED: obj/third_party/ffmpeg/ShakaPlayerEmbedded.FFmpeg ShakaPlayerEmbedded.FFmpeg.dSYM ShakaPlayerEmbedded.FFmpeg.dSYM/Contents/Info.plist ShakaPlayerEmbedded.FFmpeg.dSYM/Contents/Resources/DWARF/ShakaPlayerEmbedded.FFmpeg 
python ../build/toolchain/mac/linker_driver.py xcrun lipo -create -output obj/third_party/ffmpeg/ShakaPlayerEmbedded.FFmpeg obj/third_party/ffmpeg/x64/ShakaPlayerEmbedded.FFmpeg -Wcrl,dsym,. -Wcrl,dsymutilpath,../tools/clang/dsymutil/bin/dsymutil
Traceback (most recent call last):
  File "../build/toolchain/mac/linker_driver.py", line 287, in <module>
    Main(sys.argv)
  File "../build/toolchain/mac/linker_driver.py", line 103, in Main
    linker_driver_outputs += linker_driver_actions[name](args)
  File "../build/toolchain/mac/linker_driver.py", line 137, in <lambda>
    lambda full_args: action(sub_arg[len(name):], full_args))
  File "../build/toolchain/mac/linker_driver.py", line 163, in RunDsymUtil
    subprocess.check_call(DSYMUTIL_INVOKE + ['-o', dsym_out, linker_out])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[675/1182] CXX clang_x64/obj/third_party/protobuf/protobuf_full/descriptor.o
ninja: build stopped: subcommand failed.
TheModMaker commented 4 years ago

Did you install Xcode and the command-line utilities? Can you run xcrun? You may need to run sudo xcode-select --install.

Romantic-LiXuefeng commented 4 years ago

Yes, I have installed the Xcode ahnd xcode-select. @TheModMaker

Romantic-LiXuefeng commented 4 years ago

@TheModMaker Hope add some detail documents about compile for ios on Mac, I still can't compile at now, and don't know why. I find have released v1.0, I'm interested to this project, thanks for your work!

minhtoantm commented 4 years ago

@TheModMaker Hope add some detail documents about compile for ios on Mac, I still can't compile at now, and don't know why. I find have released v1.0, I'm interested to this project, thanks for your work!

Me too, I have no way to compile for iOS on Mac

TheModMaker commented 4 years ago

@minhtoantm is the error exactly the same? If not, please post some logs.

Both: what is the output of ls -lA tools/clang/dsymutil/bin when in the source root?

minhtoantm commented 4 years ago

@TheModMaker Thank for reply. It is log:

bash: cannot set terminal process group (24346): Inappropriate ioctl for device bash: no job control in this shell Using ./out/sample_xcode_project_ios_sim! Traceback (most recent call last): File "../../build.py", line 88, in sys.exit(main(sys.argv[1:])) File "../../build.py", line 78, in main if Build(ns.clean) != 0: File "../../build.py", line 58, in Build return subprocess.call(['ninja', 'player']) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 172, in call return Popen(*popenargs, **kwargs).wait() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in init errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory Command PhaseScriptExecution failed with a nonzero exit code

Both: what is the output of ls -lA tools/clang/dsymutil/bin when in the source root?

image

TheModMaker commented 4 years ago

We require the use of Depot Tools. You'll also need to add the path to your PATH variable in your .bashrc (or other shell init file). If you run this within Xcode, you'll need to include the path in your Xcode settings too.

Also, what is the output of the following: cipd ensure -ensure-file cipd.ensure -root . and then see if the files exist: ls -lAR tools/clang/dsymutil. If cipd isn't available, you haven't setup PATH correctly.

minhtoantm commented 4 years ago

Thank you. I will try.

minhtoantm commented 4 years ago

cipd is avaiable, I done for "../configure" and "make" But in folder "sample_xcode_project ", when i run "sh build.sh", get error bellow:

image

TheModMaker commented 4 years ago

You cannot run that build.sh file by itself; it can be only run as part of the Xcode build step. It assumes certain Xcode shell variables were set. I'll make a change to return an error in this case. When run directly, just use configure and make.

minhtoantm commented 4 years ago

You cannot run that build.sh file by itself; it can be only run as part of the Xcode build step. It assumes certain Xcode shell variables were set. I'll make a change to return an error in this case. When run directly, just use configure and make.

I run with steps:

  1. cd ~/Download/shaka-player-embedded/sample_xcode_project
  2. ../configure
  3. ../make
  4. open sample_xcode_project.xcodeproj && build. Getting bellow error

image

image

TheModMaker commented 4 years ago

You don't run configure when using the sample_xcode_project, it will run configure itself. You run configure and make in an empty directory and copy the resulting framework to your project. The sample_xcode_project has a build.sh file that does that part for you.

minhtoantm commented 4 years ago

Bu when I build sample_xcode_project with Xcode, getting error: image

TheModMaker commented 4 years ago

Try clearing out the sample_xcode_project folder. The extra files you added may be confusing things. You can use git clean -xfd sample_xcode_project.

minhtoantm commented 4 years ago

I try but not success, I don't add any files. Please check again. Thank you

TheModMaker commented 4 years ago

You implicitly added a bunch of files when you ran configure in the wrong directory. You should try again with everything cleared out. You could delete the whole folder and clone the repo again, or you could use the following:

git reset --hard
git clean -xfd

Also, could you post the logs from the Xcode run? They are found in the tab with the speech bubble.

minhtoantm commented 4 years ago

I remove completly project and re-clone again, Now I can run demo project. Thank you for your support and sorry about this inconvinient.