Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects - docker

I am trying to build a django project to push it to an ECR instance but I am having trouble building the project through docker.
Running this command:
docker build -t stuffkeep-docker-app .
Results in this error and I have not found any way to resolve this yet.
Building wheels for collected packages: backports.zoneinfo, django-allauth, django-rest-framework, fcm-django, gcloud, http-ece, jws, py-vapid, pywebpush
Building wheel for backports.zoneinfo (pyproject.toml): started
Building wheel for backports.zoneinfo (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
/tmp/pip-build-env-9x4p5_f7/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/backports
copying src/backports/__init__.py -> build/lib.linux-x86_64-cpython-310/backports
creating build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/__init__.py -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
running egg_info
writing src/backports.zoneinfo.egg-info/PKG-INFO
writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
writing requirements to src/backports.zoneinfo.egg-info/requires.txt
writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.svg' under directory 'docs'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_output'
adding license file 'LICENSE'
adding license file 'licenses/LICENSE_APACHE'
writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
copying src/backports/zoneinfo/__init__.pyi -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-cpython-310/backports/zoneinfo
running build_ext
building 'backports.zoneinfo._czoneinfo' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/lib
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-cpython-310/lib/zoneinfo_module.o -std=c99
lib/zoneinfo_module.c: In function ‘zoneinfo_fromutc’:
lib/zoneinfo_module.c:600:19: error: ‘_PyLong_One’ undeclared (first use in this function); did you mean ‘_PyLong_New’?
600 | one = _PyLong_One;
| ^~~~~~~~~~~
| _PyLong_New
lib/zoneinfo_module.c:600:19: note: each undeclared identifier is reported only once for each function it appears in
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for backports.zoneinfo
and
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects
I am very aware of this question which has the same error but the poster of that is building for Heroku which I am not using and the solutions given are heroku focused.

Related

How to use the installed (pre-compiled) drake as external with bazel?

I am working on a C++ project with drake, using bazel as the build system. Previously, I use the drake source code as the external, following the drake_bazel_external example. Everything works fine.
Since I want to use the SNOPT solver in drake, I want to change to use the pre-compiled drake. I follow the drake_bazel_installed example. However, I got the following errors.
Compiling kuka/diffIK_controller.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 27 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/common/default_scalars.h:3,
from bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/systems/framework/leaf_system.h:14,
from ./kuka/diffIK_controller.h:3,
from kuka/diffIK_controller.cc:3:
bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/common/autodiff.h:12:10: fatal error: Eigen/Core: No such file or directory
12 | #include <Eigen/Core>
| ^~~~~~~~~~~~
compilation terminated.
I also find that the apps in the drake_bazel_external cannot be compiled successfully by drake_bazel_installed setting. The error message is
ERROR: error loading package 'app': Label '#drake//tools/skylark:py.bzl' is invalid because 'tools/skylark' is not a package; perhaps you meant to put the colon here: '#drake//:tools/skylark/py.bzl'?
Update
The bug can be produced by both the http_archive fetched drake and the apt installed drake (the latest stable drake I think, since I just installed it yesterday). I have isolated the relevant code to reproduce the bug in a github repo. Currently, I can get the original apps in drake_bazel_installed to work.
Update
By adding
# solve the eigen not found bug
build --cxxopt=-I/usr/include/eigen3
to the .bazelrc file, I can solve the above problem. However, when I try to build a program that uses iiwa_status_receiver.h, I encounter a new problem.
ERROR: /home/chenwang/repro_drake_bazel_external/drake_bazel_installed/apps/BUILD.bazel:102:10: Compiling apps/connection_test.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 32 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from apps/connection_test.cc:10:
bazel-out/k8-opt/bin/external/drake/_virtual_includes/.drake_headers/drake/manipulation/kuka_iiwa/iiwa_status_receiver.h:6:10: fatal error: drake/lcmt_iiwa_status.hpp: No such file or directory
6 | #include "drake/lcmt_iiwa_status.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
INFO: Elapsed time: 2.967s, Critical Path: 0.24s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
This problem is also a missing header file problem. I have update the github repo to reproduce this problem.
This is a bug in Drake (filed as https://github.com/RobotLocomotion/drake/issues/17965 now).
To work around it, pass --cxxopt=-I/usr/include/eigen3 on all of your bazel commands, e.g., by adding this line to your projects' .bazelrc file:
build --cxxopt=-I/usr/include/eigen3
Edit: The nightly builds of Apt packages as of 20220923 should have this fixed as well.

Drake source installation unsuccessful due to missing files

I'm following the instructions from here and here to install drake and I used this file to install all the dependencies. Now when I run cmake ../drake and then make -j, I see I very very long traceback that stackoverflow won't let me post here because I can't seem to get it into a format it likes. But this is where the first error starts:
ERROR: /home/prasanth/.cache/bazel/_bazel_prasanth/7a6ad5daa22f12899ee3dcd32eb0729d/external/gz_math_internal/BUILD.bazel:172:20: Compiling external/gz_math_internal/drake_src/src/Angle.cc failed: (Exit 1): cc failed: error executing command /usr/bin/cc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 25 arguments skipped)
Alternatively, when I use bazel build //... as mentioned here, I see:
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files: /home/prasanth/ros2/robotic_tray_processor/drake/tools/bazel.rc INFO: Build option --compilation_mode has changed, discarding analysis cache. INFO: Analyzed 9795 targets (143 packages loaded, 29016 targets configured). INFO: Found 9795 targets... ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13: Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: missing input file '//tools/install:installer.py' ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13: Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: 1 input file(s) do not exist ERROR: /home/prasanth/ros2/robotic_tray_processor/drake/examples/kuka_iiwa_arm/models/BUILD.bazel:8:13 Middleman _middlemen/examples_Skuka_Uiiwa_Uarm_Smodels_Sinstall_Udata-runfiles failed: 1 input file(s) do not exist INFO: Elapsed time: 7.483s, Critical Path: 0.01s INFO: 9 processes: 9 internal. FAILED: Build did NOT complete successfully
Please help! Thanks in advance.

Failed to archive iOS app with Xcode because of WireGuard Apple External Build System target

So I'm building a VPN app using this library: https://github.com/passepartoutvpn/tunnelkit
I installed Golang 1.18 on my macbook, and built app successfully from Xcode 13 to my device
But when i archive app, there is an error like this
Makefile:52: warning: overriding commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
Makefile:36: warning: ignoring old commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
Makefile:55: warning: overriding commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
Makefile:52: warning: ignoring old commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
Makefile:58: warning: overriding commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
Makefile:55: warning: ignoring old commands for target `/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN'
make: Circular /Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN <- /Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN dependency dropped.
make: Circular (iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/libwg-go-arm64.a <- /Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN dependency dropped.
[ -n "/opt/homebrew/Cellar/go/1.18.3/libexec" ]
mkdir -p "/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN (iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot"
rsync -a --delete --exclude=pkg/obj/go-build "/opt/homebrew/Cellar/go/1.18.3/libexec/" "/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN (iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot/"
cat goruntime-*.diff | patch -p1 -f -N -r- -d "/Users/nguyendinhthach/Library/Developer/Xcode/DerivedData/SysVPN-ciypnfrkmufusggubfzgnpbgxotc/Build/Intermediates.noindex/ArchiveIntermediates/SysVPN (iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot"
patching file src/runtime/sys_darwin.go
Hunk #1 succeeded at 513 (offset 73 lines).
patching file src/runtime/sys_darwin_amd64.s
Hunk #1 succeeded at 115 (offset 1 line).
patching file src/runtime/sys_darwin_arm64.s
touch "(iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot/.prepared"
touch: (iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot/.prepared: No such file or directory
make: *** [(iOS)/IntermediateBuildFilesPath/SysVPN.build/Release-iphoneos/wireguard-go-bridge/goroot/.prepared] Error 1
Command ExternalBuildToolExecution failed with a nonzero exit code

Make does not detect opencv_contrib even though I have it installed

I am trying to get this running https://github.com/Katou2/Optical_Flow_GPU_Opencv3 but am facing an issue where make does not detect my opencv_contrib module. Here are the steps that I have done up till cmake.
conda create -n opticalflow python=3.6 anaconda
conda activate opticalflow
git clone https://github.com/Katou2/Optical_Flow_GPU_Opencv3
cd Optical_Flow_GPU_Opencv3
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D BUILD_TIFF=ON ..
And this is the output that I get with no error.
-- version: 4.2.0
-- OPENCV include: /home/haziq/anaconda3/pkgs/libopencv-4.2.0-py36_3/include/opencv4
-- OPENCV libs dir:
-- OPENCV libs: opencv_calib3dopencv_coreopencv_dnnopencv_features2dopencv_flannopencv_gapiopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_stitchingopencv_videoopencv_videoioopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_cvvopencv_datasetsopencv_dnn_objdetectopencv_dnn_superresopencv_dpmopencv_faceopencv_freetypeopencv_fuzzyopencv_hdfopencv_hfsopencv_img_hashopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_qualityopencv_regopencv_rgbdopencv_saliencyopencv_shapeopencv_stereoopencv_structured_lightopencv_superresopencv_surface_matchingopencv_textopencv_trackingopencv_videostabopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto
-- Configuring done
-- Generating done
-- Build files have been written to: /home/haziq/Optical_Flow_GPU_Opencv3/build
The problem comes when I run make.
Scanning dependencies of target compute_flow_autogen
[ 25%] Automatic MOC for target compute_flow
[ 25%] Built target compute_flow_autogen
Scanning dependencies of target compute_flow
[ 50%] Building CXX object CMakeFiles/compute_flow.dir/compute_flow.o
/home/haziq/Optical_Flow_GPU_Opencv3/compute_flow.cpp:38:10: fatal error: opencv2/cudaoptflow.hpp: No such file or directory
#include "opencv2/cudaoptflow.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/compute_flow.dir/build.make:62: recipe for target 'CMakeFiles/compute_flow.dir/compute_flow.o' failed
make[2]: *** [CMakeFiles/compute_flow.dir/compute_flow.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/compute_flow.dir/all' failed
make[1]: *** [CMakeFiles/compute_flow.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
So the error mentions that the file opencv2/cudaoptflow.hpp is not found and I read through https://github.com/open-mmlab/mmaction/issues/39 says that the error is due to the opencv_contrib module not having been installed. However, I am certain that I already have opencv_contrib installed because I have this command executed.
pip install opencv-contrib-python
and have also verified it as I am able to call the cv2.xfeatures2d method which requires opencv_contrib to run.
import cv2
help(cv2.xfeatures2d) # cv2.xfeatures2d requires opencv_contrib

asm/socket.h: No such file or directory cross compiling Dart for Raspberry pi

I'm cross-compiling the Dart runtime using the instruction here.
I've installed all the dependencies as specified. I've also cloned the git repository with the necessary tool chain.
I'm running the runtime compilation with this command:
./tools/build.py -m release -a arm --toolchain=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf runtime
The compilation starts with no problem then it stops with this error:
LINK(target) out/ReleaseXARM/libdart_dependency_helper.target
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from runtime/vm/bootstrap.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from out/ReleaseXARM/obj/gen/async_gen.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
runtime/libdart_lib_withcore.host.mk:978: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o] Error 1
make: *** Waiting for unfinished jobs....
runtime/libdart_lib_withcore.host.mk:986: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o] Error 1
BUILD FAILED
Am I missing any dependency or package?
I hit the same problem. On my ubuntu 14.04 system /usr/include/asm didn't exist. It was called asm-generic instead. I sym-linked it and the build was able to continue.
cd /usr/include
sudo ln -s asm-generic/ asm
The build was able to continue after that.
This is probably because you're trying to build an application without some of the include paths correctly set, for example using a 32-bit gcc on a 64-bit platform.
To resolve:
sudo apt-get install gcc-multilib
I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was:
0 lrwxrwxrwx 1 root root 20 May 22 2013 /usr/include/asm -> x86_64-linux-gnu/asm
And the command to recreate it is:
$ cd /usr/include
$ sudo ln -s x86_64-linux-gnu/asm asm
The files in /usr/include/asm-generic are sometimes, but not always, equivalent to the files in the x86-64 specific directory; so it's difficult to recommend symlinking it as a workaround.

Resources