【发布时间】:2020-05-25 23:37:44
【问题描述】:
我正在尝试在我的 Windows 机器上构建 wireguard-android 源,通过反复试验逐步解决问题。
我安装了 CMake 和 Make,我遇到的第一个问题是 uname (mingw64) 报告的“错误”值,与 Google 托管的 golang filenames 不匹配。
我已编辑(破解)make 文件以指向 Windows 版本 (amd64) 的真实文件名。问题是 Windows 版本的扩展名为 .zip 而不是 .tar.gz,并且 zip 的结果似乎与管道命令不兼容。
原始命令:
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf -
我尝试的更改: (使用 if-else 是因为它还需要在 mac 上运行)
ifeq "msys" "$(shell uname -o | tr '[:upper:]' '[:lower:]')"
# Note: when enclosed in the ifeq, the ARCH_MAP part no longer worked
# Note: using tar with the zip fails, because we cant untar a zip (signal 13)
# Note: using unzip with the zip fails with confusing paths
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).windows-amd64.zip" | unzip -C "$(dir $@)" --strip-components=1 -xzf -
else
curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf -
endif
如果使用解压缩会导致错误:
解压:找不到或打开 C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/, C:\wireguard -android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.zip 或 C:\wireguard-android\app\build\intermediates\cmake\调试\obj\armeabi-v7a/../generated-src/go-1.13.7/.ZIP.
% Total % Received % Xferd 平均速度 时间 时间 时间 当前 下载上传总花费的剩余速度
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 127M 0 5419 0 0 26694 0 1:23:47 --:--:-- 1:23:47 26694
curl: (23) 书写体失败 (34 != 1357)
make: *** [C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.prepared] 错误 9
使用 tar 会导致错误:
curl "https://dl.google.com/go/go1.13.7.windows-amd64.zip" | tar -C "C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/" --strip-components=1 -xzf -
% Total % Received % Xferd 平均速度 Time Time Time 当前 Dload Upload Total 花左速度
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0gzip: stdin 有多个条目--rest 被忽略 焦油:孩子死于信号 13 tar:错误不可恢复:现在退出
0 127M 0 108k 0 0 248k 0 0:08:47 --:--:-- 0:08:47 248k
curl: (23) 书写体失败 (738 != 1357)
make: *** [C:\wireguard-android\app\build\intermediates\cmake\debug\obj\armeabi-v7a/../generated-src/go-1.13.7/.prepared] 错误 2
- 我应该如何让这个命令工作? (使用 tar 或 zip/解压缩)
- 有人向我指出,也许我需要的是 Android 发行版,而不是 Windows 发行版。在那种情况下,我会假设我需要 armeabi-v7a,但我只能看到 ARMv6 和 ARMv8 包。我应该使用什么发行版?
【问题讨论】:
标签: android makefile cmake android-ndk wireguard