Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide a way to clean from a failed, partial run of kiwix-build.py #32

Open
julianharty opened this issue Apr 16, 2017 · 3 comments

Comments

@julianharty
Copy link
Contributor

I remember in Lyon that I had to delete a folder during the early stages of trying to get kiwis-build.py to run successfully to completion. I've run into what seems a similar problem when trying to run kiwis-build.py on a Raspberry Pi (with Python 3.4.3 provided using pyenv)

I've manually deleted various folders, including ARCHIVE, SOURCE and BUILD_native_dyn I've tried to see if there's a --clean option in the script (there doesn't seem to be one), and am now a bit stuck trying to make sense of what's causing the script to first SKIP and then ERROR when trying to obtain xapian-core. This could well be a local issue on my machine (a Raspberry Pi 3 running the latest patches of Raspbian) or perhaps the script isn't yet ready to run on a Pi / build for Pi's.

Anyway, back to the reason for this issue - I'd like a known, reliable way to reset the environment
and also (if practical) some better logging to help me uncover what's been going wrong.

@julianharty
Copy link
Contributor Author

FYI Here's the current error

pyenv exec python kiwix-build.py
[INSTALL PACKAGES]
 - automake : SKIP
 - gcc : SKIP
 - cmake : SKIP
 - libbz2-dev : SKIP
 - ccache : SKIP
 - zlib1g-dev : SKIP
 - uuid-dev : SKIP
 - libctpp2-dev : SKIP
 - libmicrohttpd-dev : SKIP
 - ccache : SKIP
SKIP, No package to install.
[PREPARE]
prepare sources pugixml :
  download pugixml : SKIP
  extract pugixml : SKIP
  patch pugixml : SKIP
prepare sources lzma :
  download lzma : SKIP
  extract lzma : SKIP
prepare sources xapian-core :
  download xapian-core : SKIP
  extract xapian-core : ERROR
Traceback (most recent call last):
  File "/home/pi/kiwix-dev/kiwix-build/utils.py", line 75, in extract_archive
    archive = tarfile.open(archive_path)
  File "/home/pi/.pyenv/versions/3.4.3/lib/python3.4/tarfile.py", line 1553, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "kiwix-build.py", line 811, in <module>
    builder.run()
  File "kiwix-build.py", line 780, in run
    self.prepare_sources()
  File "kiwix-build.py", line 761, in prepare_sources
    source.prepare()
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 117, in prepare
    self.command('extract', self._extract)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 86, in command
    return self.target.command(*args, **kwargs)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 50, in command
    ret = function(*args, context=context)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 106, in _extract
    name=self.source_dir)
  File "/home/pi/kiwix-dev/kiwix-build/utils.py", line 115, in extract_archive
    if archive is not None:
UnboundLocalError: local variable 'archive' referenced before assignment

@julianharty
Copy link
Contributor Author

FYI I had the same error when trying to test the current arm branch (which seemed sensible given I'm trying to build kiwix-lib for the Raspberry Pi)

Here's the error, I'll also raise this as a separate issue since there seems to be something awry with the xapian-core download

(kiwix)pi@rachel ~/kiwix-dev/kiwix-build $ pyenv exec python kiwix-build.py --target-platform raspberrypi_dyn
[INSTALL PACKAGES]
 - cmake : SKIP
 - automake : SKIP
 - ccache : SKIP
SKIP, No package to install.
[PREPARE]
prepare sources for toolchain armhf :
  gitclone armhf : OK
  gitupdate armhf : OK
prepare sources pugixml :
  download pugixml : SKIP
  extract pugixml : OK
  patch pugixml : OK
prepare sources zlib :
  download zlib : OK
  extract zlib : OK
  patch zlib : OK
prepare sources lzma :
  download lzma : SKIP
  extract lzma : OK
prepare sources uuid :
  download uuid : OK
  extract uuid : OK
prepare sources xapian-core :
  download xapian-core : SKIP
  extract xapian-core : ERROR
Traceback (most recent call last):
  File "/home/pi/kiwix-dev/kiwix-build/utils.py", line 75, in extract_archive
    archive = tarfile.open(archive_path)
  File "/home/pi/.pyenv/versions/3.4.3/lib/python3.4/tarfile.py", line 1553, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "kiwix-build.py", line 862, in <module>
    builder.run()
  File "kiwix-build.py", line 831, in run
    self.prepare_sources()
  File "kiwix-build.py", line 812, in prepare_sources
    source.prepare()
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 117, in prepare
    self.command('extract', self._extract)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 86, in command
    return self.target.command(*args, **kwargs)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 50, in command
    ret = function(*args, context=context)
  File "/home/pi/kiwix-dev/kiwix-build/dependency_utils.py", line 106, in _extract
    name=self.source_dir)
  File "/home/pi/kiwix-dev/kiwix-build/utils.py", line 115, in extract_archive
    if archive is not None:
UnboundLocalError: local variable 'archive' referenced before assignment

@kelson42 kelson42 changed the title Please provide a way to clean from a failed, partial run of kiwis-build.py Please provide a way to clean from a failed, partial run of kiwix-build.py Nov 9, 2017
@stale
Copy link

stale bot commented Dec 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant