How do I fix cargo's "failed to parse manifest at ..." "editions are unstable" error? - rust-cargo

I tried to augment my rust project with a dependency on jni="0.12.3" and my next cargo build failed with the following error:
error: unable to get packages from source
Caused by:
failed to parse manifest at `/home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.32/Cargo.toml`
Caused by:
editions are unstable
Caused by:
feature `edition` is required
consider adding `cargo-features = ["edition"]` to the manifest
I'm running cargo built from gentoo's dev-util/cargo-0.30.0 ebuild.

Since rust is a quickly-evolving language, the latest crates seem to use new features that my older version of cargo did not support. And since rust/cargo did not have something like portage's EAPI marker, the old cargo did not have a way to figure that out, so the error message was a bit indirect.
I have a theory that the Cargo.lock could be tweaked to use an older version of the backtrace crate, but I was not able to figure out a procedure to do this.
Upgrading to the rust-1.34.2 ebuild, and (don't forget this step:) then using eselect rust set 1 activated the new version of cargo, and it was able to build the package without malfunctioning.

Related

MediaPipe AAR File Generation

I am new to MediaPipe Framework. I went through their documentation setup and installation guide for opencv#3, bazel, homebrew. I did everything and I'm also able compile and execute their Hello World CPP file.
Now I want to generate AAR file of face_detection. Again I followed each and every step mentioned in their guide, but now I am stuck at a point where local repository of opencv#3 is not able to fetch.
I am working in MacOS Catalina -v 10.15.7
ERROR: /Users/rajeevkumar/Desktop/Android/mediapipe/third_party/BUILD:178:6: //third_party:opencv_binary depends on #macos_opencv//:opencv in repository #macos_opencv which failed to fetch. no such package '#macos_opencv//': The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: Analysis of target '//mediapipe/examples/android/src/java/com/google/mediapipe/apps/aar_example:mp_face_detection_aar' failed; build aborted: Analysis failed
It seems you don't have opencv installed.
did you try running
https://github.com/google/mediapipe/blob/master/setup_opencv.sh
if you didn't, open terminal,go to mediapipe directory and use
./setup_opencv.sh
to install opencv and add necessary path to your WORKSPACE file.

Problems when building Drake from source with cmake

I am trying to build and install Drake from source in order to get support for Mosek. I keep running into trouble, however. For the record, I am running macOS Catalina.
Right now my approach has been this:
Clone drake from github to a location on my computer (from https://github.com/RobotLocomotion/drake.git)
Install prereqs
with ./setup/mac/install_prereqs.sh
Run bazel build //... Make a
directory called build and cd build cmake .. and then make
and make install
And in my C++ project, which I build using cmake, I add this to CMakeLists.txt:
link_directories(drakelocation/build/install/lib)
include_directories(drakelocation/build/install/include)
However, when I try to build my project, I get an error that Drake is unable to locate Eigen: 'Eigen/Core' file not found. I was able to work around this by adding:
target_link_libraries(my_lib Eigen3::Eigen) to my CMakeLists.txt
I found this a bit strange, as I expect that Drake includes Eigen when it is built, but at least this made me able to get a bit further.
After this I get a bunch of messages of the type:
no member named 'signbit' in the global namespace
i.e. it seems like Drake suddenly is missing all the standard C++ libraries. I have not yet been able to fix this issue, so this is where I am currently stuck.
Do you have any suggestions, or have you encountered any similar problems before?
Other information:
Using find_package(drake) does not work with my current approach at all (cmake is not able to locate drake-config.cmake). Am I missing something here that is required to make this work? Where does cmake expect libraries to be installed, and how do I install them in that place?
I have also tried skipping the entire bazel build //... step, going directly to the cmake .. step, which did not seem to make any difference.
In between every different build approach I have run bazel clean --expunge to make sure that nothing sticks around from the previous run.
Thanks!
You need to tell CMake where your Drake installation is located:
list(APPEND CMAKE_PREFIX_PATH /absolute/path/to/drakelocation/build/install)
find_package(drake REQUIRED)
add_library(my_lib ...)
target_link_libraries(my_lib drake::drake)
This ensures you have all the necessary compiler and linker flags. Setting the include directory to simply /absolute/path/to/drakelocation/build/install/include is insufficient since it does not contain the include directories of the various dependencies of Drake.
Note that you do not need to call bazel yourself before calling cmake. When you run make install, it will call bazel internally.
Thanks #Jamie that solved the find_package() problem I had.
I still had some trouble with the build. Turns out that there was something wrong with my default SDK path, and that setting "CMAKE_OSX_SYSROOT" according to this: Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace after an update to XCode did the trick.
After this, I got a lot of strange error messages from Eigen, complaining that i.e. MatrixXd was not defined in the namespace 'Eigen'. For some reason, uninstalling it with brew uninstall eigen and then downloading and building eigen from source solved those problems.
It now works!

compileKotlinIos FAILED - Could not find stdlib

I am trying to compile kotlin multiplatform, which contains iOS target.
I tried different examples over github, but most of them are outdated and don't work, probably because of incompatibility with current tools. Thing, that seems most reasonable is creating Mobile Android/iOS | Gradle or Mobile Shared Library | Gradle project using IntelliJ Idea.
When I create brand new project, I am still getting same error:
> Task :app:compileKotlinIos FAILED
e: Could not find "stdlib" in [~/git/iosandroidtest, ~/.konan/klib, ~/.konan/kotlin-native-macos-1.3.61/klib/common, ~/.konan/kotlin-native-macos-1.3.61/klib/platform/ios_x64].
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileKotlinIos'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
I am using kotlin 1.3.61, xcode 11.3. Any ideas?
Edit:
I pushed empty project (without any changes from me) to github:
https://github.com/hovi/iostest
I think you just ran into a bug with partial archive download.
Per the author there, "I got a snapshot of the .konan directory. It's interesting as it looks like part of the runtime download is there, but some parts are missing. Specifically in this case the common folder in klib, but also the licenses folder.
I was able to repro this locally by killing the build process while the archive is being extracted. For reference, see NativeCompilerDownloader. It looks to see if the folder is there. If not, it'll download and extract. If yes, the build process assumes everything is OK. ... Their local build will certainly be broken from then on until they clean and rebuild ~.konan." I suggest you report your issue there as well. (btw - tried your project in IJ and AS (as well as creating new lib project in IJ), didn't have any issues. Somehow your bad luck with an interrupted download (:))
Link to GitHub issue

Error installing llvm and clang from source in Linux

I am trying to install clang from source following the instructions as given in http://clang.llvm.org/get_started.html ( Steps 1-4 and 7) in Ubuntu 14.04
Inside the build directory , I ran make which succeeded. I wasn't sure what to do after that , so I ran make install inside the build directory, following which I got this cmake error:
There is no executable named clang in /build/bin folder anyway, but I can find others like clang-check, clang-query, etc. What's going wrong?
PS: My main requirment is to experiment with alpha security checkers of clang analyzer and also write my own checker later.

Are there multiple branches of Glib?

I'm trying to build Firefox from source and I'm getting hung up on some of the requirements.
I'm trying to build libIDL, which requires glib. I got glib built and installed to /usr/local, but when I try and configure libIDL, I get a failure at:
checking for LIBIDL... configure: error: Package requirements (glib-2.0 >= 2.4.0) were not met:
No package 'glib-2.0' found
I used the very latest version of glib that I can find, ftp://ftp.gtk.org/pub/glib/2.20/glib-2.20.3.tar.gz
However, I've also been searching around and am seeing references to libglib-2.0 such as at http://packages.debian.org/search?keywords=libglib2.0-dev
Are there 2 divergent branches of Glib, like a v1 and v2?
You need to install glib-devel in order to have the glib headers exist on your system. Without the headers, autoconf will mark the library as missing.
You installed glib from source which should have worked. The actual problem was most likely with the paths you chose to install into. The autoconf script may not be looking for glib where you installed it, or it may be looking into another directory first and finding an old version.

Resources