Comments (8)
The problem is on line 54: #ifndef ZIP_CODEC_ENCODE
In Version 0.10.1-1.2 of libzip-dev (on Ubuntu), the file /usr/include/zip.h defines ZIP_CODEC_ENCODE, but in Version 1.1.2-1.1 (on Debian), this is not defined.
One way to fix the bug would be to replace line 54 with something like
#if !(defined(ZIP_CODEC_ENCODE) || LIBZIP_VERSION_MAJOR > 0 || LIBZIP_VERSION_MINOR >= 10)
It would be better to have a test based solely on the version number, but I don't know what the cutoff is.
from ideviceinstaller.
Hi, I got same error with libzip 1.1.2 on OSX 10.12 Beta (16A201w).
The follow patch will get success to build and run ideviceinstaller command.
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index f70ba25..e9c4a82 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -903,7 +903,7 @@ run_again:
dstpath = NULL;
zip_uint64_t zfsize = 0;
- while (zfsize < zs.size) {
+ while (zfsize < (zip_int64_t)zs.size) {
zip_int64_t amount = zip_fread(zfile, buf, sizeof(buf));
if (amount == 0) {
break;
@@ -921,7 +921,7 @@ run_again:
total += written;
}
if (total != amount) {
- fprintf(stderr, "Error: wrote only %d of %" PRIi64 "\n", total, amount);
+ fprintf(stderr, "Error: wrote only %d of %" PRIi64 "\n", total, (uint64_t)amount);
afc_file_close(afc, af);
zip_fclose(zfile);
free(dstpath);
from ideviceinstaller.
Also seeing this on Ubuntu 16.04 with libzip 1.0.1.
#38 was closed saying to use libzip >= 0.10, I assume the 1.0 libzip change is what broke this:
➜ ideviceinstaller git:(master) ✗ make
make all-recursive
make[1]: Entering directory '/home/andrew/git/ideviceinstaller'
Making all in src
make[2]: Entering directory '/home/andrew/git/ideviceinstaller/src'
CC ideviceinstaller-ideviceinstaller.o
ideviceinstaller.c: In function ‘main’:
ideviceinstaller.c:906:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
while (zfsize < zs.size) {
^
cc1: all warnings being treated as errors
➜ ideviceinstaller git:(master) ✗ dpkg -s libzip-dev
Package: libzip-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 419
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Multi-Arch: same
Source: libzip
Version: 1.0.1-0ubuntu1
The following patch will get it building but I then get the error Could not start com.apple.mobile.installation_proxy!
, and I'm not clear if that's because of my tinkering with the build flags:
diff --git a/configure.ac b/configure.ac
index 52d2a5d..3839896 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,7 @@ if test "x${have_lstat}" = "xyes" ; then
AC_DEFINE([HAVE_LSTAT], 1, [Define if lstat syscall is supported])
fi
-AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Werror -g")
+AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -g")
AC_SUBST(GLOBAL_CFLAGS)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
from ideviceinstaller.
#53 seems to fix this issue for me using xcode8 GM
from ideviceinstaller.
The problem is lines 56-58 of src/ideviceinstaller.c. As mentioned on line 55, they are for old versions of libzip -- versions prior to 0.10. The file uses the presence of ZIP_CODEC_ENCODE to distinguish libzip version 0.10 from earlier versions. The problem, though, is that ZIP_CODEC_ENCODE was moved to the (non-public) header file zipint.h sometime after version 0.11.2c. So, if a newer version of libzip is being used, lines 56-58 are used, and cause compilation errors.
In case you want to check on your own, here's the diff (in the libzip mercurial web access repository) where ZIP_CODEC_ENCODE was added: https://hg.nih.at/libzip/diff/2d8141cb2fa3/lib/zip.h (dated 14 Feb 2009), and here it was removed (actually moved to a non-public file): https://hg.nih.at/libzip/diff/1e4d47d717ef/lib/zip.h (dated 10 Oct 2014).
As was noted by pachoo in pull request #65, the configure script requires version 0.10 or higher of libzip, so lines 56-58 are moot at best, and cause compile errors at worst.
In an earlier comment I recommended replacing line 54, but I now believe that it's better to delete lines 54-60. See attached patch.
ideviceinstaller.c.pat.txt
from ideviceinstaller.
The problem is the #define zip_uint64_t off_t
at the beginning as @paulvojta already figured out.
I would like to add that would be sufficient to check the libzip version according to zip_stat.
It should do those defines if zlib version is less than 0.10 and the target value is not off_t
but int
.
from ideviceinstaller.
Yes, but line 20 of configure.ac already requires libzip version 0.10 or higher: PKG_CHECK_MODULES(libzip, libzip >= 0.10)
So ideviceinstaller won't build with a lower version.
Also, note: libzip != zlib.
from ideviceinstaller.
Fixed with #85
from ideviceinstaller.
Related Issues (20)
- configure: error: Package requirements (libimobiledevice-1.0 >= 1.3.0) were not met:
- "No device found" error starting with iOS 16.0 beta HOT 1
- Is there a way to access Apple Watch?
- No device found.
- The bundle ID isn't parsed correctly for some apps HOT 2
- The ideviceinstaller doesn't return proper exit code on install failure HOT 3
- ideviceinstaller --archive doesn't seem to work? HOT 2
- Master branch is broken HOT 1
- AFC write error:30 in MacOS Ventura HOT 2
- large files hang ideviceinstaller ; it never responds or attempts to install
- mingw build failure HOT 1
- `ideviceinstaller list` with `--xml` returns 1 after all info printed HOT 2
- AFC Write error : 30 , Xcode 14.3.1 , MACOS Ventura , IOS 16.6
- Is a Certificate Required to Install a signed ipa
- Please publish the latest code to Homebrew,thank you very much。 HOT 1
- Getting error zsh: parse error near `\n' when trying to install h3lix-RC6.ipa on iPad 4 HOT 1
- List installed apps with the Apple ID used to install it?
- Windows support HOT 1
- compile for Mac error _BZ2_bzCompress, referenced from: _process in libzip.a[114](zip_algorithm_bzip2.c.o) HOT 1
- Need to declare zbuf as unsigned char * for mingw build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ideviceinstaller.