Getting error: no matching version `^2.0.0` found for package `codec`? - substrate

Question
I'm new to Substrate and going through Add a Pallet to Your Runtime. At first, running the command cargo check -p node-template-runtime gave me error
error: failed to parse manifest at `/Users/bashar/work/substrate/start/substrate-node-template/pallets/template/Cargo.toml`
Caused by:
feature `rename-dependency` is required
consider adding `cargo-features = ["rename-dependency"]` to the manifest
I added it and then I started getting this error:
error: no matching version `^2.0.0` found for package `codec`
location searched: registry `https://github.com/rust-lang/crates.io-index`
versions found: 0.0.0
required by package `frame-benchmarking-cli v3.0.0`
... which is depended on by `node-template v3.0.0 (/Users/bashar/work/substrate/start/substrate-node-template/node)`
I tried modifying the codec version to 2.0.1 with no luck. My setup
rustup 1.23.1
rustc 1.50.0
cargo 1.30.0
Any idea what I'm doing wrong?
UPDATE
I went back to the Create Your First Substrate Chain, which this tutorial is built on, started from scratch, which the Pallet tutorial is based on. And this time, after cloning the repository for first tutorial, cargo build --release failed with the same error feature rename-dependency is required.
This built fine the first time before I moved to the second tutorial. Which makes me think maybe a recent Mac update ruined something? I even tried uninstalling Rust and re-installing it, then installing a new template. Same thing

Related

Getting error while running mediapipe on macOS; Building C++ command-line example apps

I am trying to use mediapipe for a university project and have installed it, even successfully ran the Hello World! in C++ example app but when I am trying to build the C++ command-line example, it is giving me errors.
I ran this:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu
and the result I got is this:
DEBUG: /private/var/tmp/_bazel_kanzashaikh/c191ae13e9137350b50f6a19ce94bf21/external/rules_foreign_cc/workspace_definitions.bzl:15:10: WARNING: This branch is deprecated and no longer recieving updates. Please update to main or choose a specific commit to pin in your workspace.
INFO: Build option --compilation_mode has changed, discarding analysis cache.
ERROR: Error fetching repository: java.io.IOException: The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: /Users/kanzashaikh/development/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/desktop/hand_tracking:hand_tracking_cpu' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.194s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 237 targets co
nfigured)
How do I solve it?
before building desktop examples, you should setup opencv. also for android examples you should setup android sdk and ndk.
there is a builtin script for setting up opencv and you can execute it.
for setting up opencv:
bash setup_opencv.sh
and for android sdk and ndk:
bash setup_android_sdk_and_ndk.sh
I am assuming you are running a M1 machine, as Homebrew is now installing Intel binaries under /usr/local and ARM ones under /opt/homebrew.
In your case, when building, bazel is looking for opencv#3 package at /usr/local/opt/opencv#3 and immediately throws an error as the package is located at /opt/homebrew/opt/opencv#3.
Thus, you have two choices:
Open WORKSPACE file from your bazel project and modify the path for each package accordingly
Make a symbolic link to /opt/homebrew/opt in /usr/local by running: sudo ln -s /opt/homebrew/opt opt

How to fix library dependence in a conan package

I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5

Error (object._d_arraysetlengthTImpl not found) while building D project on MacOS

I was trying to build existing Dlang project on my home Mac. But I am getting this error. I haven't find anything about it.
$ dub build
Running pre-generate commands for vibe-d:tls...
Performing "debug" build using dmd for x86_64.
tinyendian 0.2.0: target for configuration "library" is up to date.
dyaml 0.8.0: building configuration "library"...
/Library/D/dmd/src/phobos/std/uni.d(935,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(968,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(4064,18): Error: template instance std.uni.MultiArray!(BitPacked!(uint, 13LU), BitPacked!(bool, 1LU)).MultiArray.length!0LU error instantiating
/Library/D/dmd/src/phobos/std/uni.d(4312,37): instantiated from here: TrieBuilder!(bool, dchar, 1114112, sliceBits!(8LU, 21LU), sliceBits!(0LU, 8LU))
/Library/D/dmd/src/phobos/std/regex/internal/ir.d(26,14): instantiated from here: CodepointSetTrie!(13, 8)
/Library/D/dmd/src/phobos/std/uni.d(935,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(968,32): Error: object._d_arraysetlengthTImpl not found. The current runtime does not support resizing arrays, or the runtime is corrupt.
/Library/D/dmd/src/phobos/std/uni.d(4064,18): Error: template instance std.uni.MultiArray!(BitPacked!(uint, 13LU), BitPacked!(bool, 1LU)).MultiArray.length!1LU error instantiating
/Library/D/dmd/src/phobos/std/uni.d(4312,37): instantiated from here: TrieBuilder!(bool, dchar, 1114112, sliceBits!(8LU, 21LU), sliceBits!(0LU, 8LU))
/Library/D/dmd/src/phobos/std/regex/internal/ir.d(26,14): instantiated from here: CodepointSetTrie!(13, 8)
dmd failed with exit code 1.
Can somebody pls help?
I am using these:
MacOS 10.15.4
DMD64 v2.091.1
DUB 1.20.1
Thx to Adam D. Ruppe.
It looks like there was a problem with previously installed version of dmd.
Solved by:
brew uninstall dub
brew uninstall dmd
delete /Library/D directory
brew install dmd
brew install dub

How to deploy Elm and Phoenix Elixir to Heroku?

When trying to deploy a Phoenix/Elm project to Heroku I run into the following issue:
Running default compile
Elm compile: Main.elm, in web/elm, to ../static/vendor/main.js
/bin/sh: 1: elm: not found
17 Jul 15:58:21 - error: Compiling of web/elm/Main.elm failed. Command failed: elm make --yes --output ../static/vendor/main.js Main.elm
/bin/sh: 1: elm: not found
Check your digested files at "priv/static"
I'm using the buildpacks for Phoenix found in the guides and brunch/elm-brunch.
The error is caused by the elm binaries not being installed. One way to install elm is by using npm, which is already available as the Phoenix buildpack uses it.
Solution: Add elm as a dependency in package.json. This will cause the Phoenix buildpack to install elm before executing the brunch script.
Note that a local computer may have a separate installation of the elm binaries, potentially causing confusion. As long as versions match, this ought not be a problem. Note that to use the elm binaries installed by npm above, one has to include ./node_modules/.bin in ones PATH (which the phoenix buildpack does). E.g. if one has a separate elm installation which is included in PATH since before, this will be used when running commands from the prompt.

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

Resources