Download Fuchsia source -- Jiri hooks are not run due to fatal errors when updating projects or packages - installation

Per Get Fuchsia source code:
~$ echo $PATH
/media/cwh/32GB/swdev/fuchsia/.jiri_root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
~$ cd /media/cwh/32GB/swdev/
/media/cwh/32GB/swdev$ curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
cipd bootstrapped to path:"/media/cwh/32GB/swdev/fuchsia/.jiri_root/bin/cipd"
Please add /media/cwh/32GB/swdev/fuchsia/.jiri_root/bin to your PATH
[22:15:04.404] Updating all projects
PROGRESS: Fetching CIPD packages
[22:38:10.385] Jiri hooks are not run due to fatal errors when updating projects or packages
[23:01:03.457] Jiri hooks are not run due to fatal errors when updating projects or packages
ERROR: context deadline exceeded
I do not see any "fatal errors" preceding the Jiri hooks message.
What is the 'Jiri hooks are not run due to fatal errors when updating projects or packages'?

jiri help update indicates there are two default timeouts:
-fetch-packages-timeout=30
-hook-timeout=5
Invoke jiri directly with increased timeouts then repeat original command.
cd fuchsia; jiri update -fetch-packages-timeout=90 -hook-timeout=60; cd ..
curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts bootstrap?format=TEXT" | base64 --decode | bash

In my case it was the cipd that failed to fetch some prebuilt artifacts. Just login by running
cipd auth-login
and then run the fuchsia bootstrap script again.

Related

Golang linter issues 'context loading failed: no go files to analyze'

We are using
golangci-lint version 1.40.1 together with
golang version 1.16.4
in our project for linting our Golang code.
Until now, what we did is running this bash script (from the root
directory of our repository):
if ! [ -x "$(command -v golangci-lint)" ]; then
echo "Fetching linter..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint
go mod tidy
fi
golangci-lint run --build-tags="unit contract container"
With some recent updates of Golang and golangci-lint, we suddenly face this error message:
ERRO Running error: context loading failed: no go files to analyze
There is a lengthy post on GitHub regarding this issue but the only useful suggestion there is to turn off the GO111MODULE env variable. When I run the linter with GO111MODULE turned off like
GO111MODULE=off golangci-lint run --build-tags="unit contract container"
the upper error message disappears but instead I am getting lots of false linting errors like:
api/router.go:152:5: undeclared name: `PermissionUpdatePackage` (typecheck)
PermissionUpdatePackage,
^
My go environment looks like this:
GO111MODULE=on
GOPATH=/Users/USER/workspace/go
GOROOT=/usr/local/opt/go/libexec
GOPRIVATE=*.CUSTOMER.com
GOSS_PATH=/usr/local/bin/goss
I tried to install the linter via go get... as well as go install ... and finally brew install golangci-lint which seems to be the recommended way following this documentation.
Running a go get ./... in the root of the project eventually solved the issues. In between we ran the following commands that probably cleared some (module?) caches that might have caused trouble as well:
golangci-lint cache clean && go clean -modcache -cache -i
golangci-lint run -v --timeout=5s
The error message
ERRO Running error: context loading failed: failed to load packages: timed out to load packages: context deadline exceeded
in the latter command pointed us to this GitHub post that made me try out go get ./...
For installing the linter (with a specified version), we ended up with this script:
linter_version='1.40.1'
if ! [ -x "$(command -v golangci-lint)" ]; then
echo "Fetching linter..."
# we cannot install linter in the project directory, otherwise we get dependency errors
# hence, temporarily jump into the /tmp directory
pushd /tmp > /dev/null
GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint#v"${linter_version}" 2>&1
popd >/dev/null
fi

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

Error while running make command using Fabric 1.0.6 after all the 15 steps

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command but after installing all the 15 steps, I am getting the following error
Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2 org.hyperledger.fabric.base.version=0.3.2
---> Running in ed05a67810db
Removing intermediate container ed05a67810db
---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jira Link: https://jira.hyperledger.org/browse/FAB-2218 which I have already done
It is a known issue in go 1.9.4:
https://github.com/golang/go/issues/23739
While go people are fixing it, you can manually whitelist the flags before starting make:
$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make
Alternatively you can just downgrade to go 1.9.3
as far as I know you don't need to build the fabric itself.
You just need to have sources in the gopath, as your chaincode will need this, when you are building your chaincode for the blockchain itself.
In addition you will probably also need to install the fabric-ca for your chaincode to build successfully, if you use the certificate-stuff.
This is sufficient to check if you installed fabric correctly:
cd $GOPATH/src/github.com/hyperledger/fabric
make unit-test
Keep going if this works.
I found this confusing at first as well ;)
I'd assume you switch to golang 1.9.4 or greater hence I belive this actually related to following issue, to solve it you need to update vendor dependencies:
govendor fetch github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
Next continue to build binaries and run tests.

Unable to change GO version in PhotonOS

I have deployed PhotonOS using directions from photon and VIC configuration, while running command docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.6 make all
an Error appears:
Please install go1.7 (found: go version go1.6.3 linux/amd64)
Makefile:152: recipe for target 'goversion' failed
make: *** [goversion] Error 1
`
to solve it I have tried to update
go1.6.3 to go1.7 using solution - changeing go version manually
after steps go version is showing go1.4.2, but the previous error still complains on go version 1.6.3.
Also, I have tried to install "gvm" using bash < <(curl -s -S -L https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) , whenever I try to call gvm install go1.7 it brings
-bash: gvm: command not found
whenever I retry running gvm-installer it says
ERROR: Already installed!
Any help is highly appreciated!!
use :
docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.7 make all
command instead, that will work on PhotonOS

Bad Exit Status from rpmbuild on Mac OSX

I'm working on packaging up some work into an rpm. I am doing this on Mac OSX after brew installing rpm. I have a basic .spec file, but I am getting an error and have been unable to diagnose it:
$ rpmbuild -ba myapp.spec
Executing(%prep): %{__spec_prep_cmd} /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.14478
error: Bad exit status from /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.14478 (%prep)
RPM build errors:
Bad exit status from /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.14478 (%prep)
The spec files is as follows:
Name: myapp
Version: 0.1.0
Release: 1
Summary: Web service to do stuff
URL: http://myapp.com
BuildRoot: %{_tmppath}/myapp-build-root
%description
My app
%prep
%build
%install
%pre
%preun
%postun
%clean
%files
%defattr(-,www-data,www-data,-)
%doc
This is my first time building an rpm, what am I doing wrong, and how can I fix this. Thanks in advance!
I ran into the same issue today. For no obvious reason the %prep macro fails, even without any content.
Running your spec on my Ubuntu box seems to work just fine after adding those two values:
License: yourLicense
Group: yourGroup
I have reason to believe, that rpm didn't get installed correctly on my box via homebrew. I think I aborted the process at some point, then forgot about it over lunch, but rpmbuild was available to use from within my script and I ran into the issue above.
I will try doing a clean install of the rpm formula in verbose mode to see whether my assumption is correct.
Update:
I've installed rpm successfully, but it took an awful long time:
/usr/local/Cellar/rpm/5.4.10: 187 files, 9.7M, built in 92.4 minutes
Nevertheless, it keeps on failing with the same error
rpmbuild -ba so.spec
Executing(%prep): %{__spec_prep_cmd} /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.69701
error: Bad exit status from /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.69701 (%prep)
With the content of /usr/local/Cellar/rpm/5.4.10/var/tmp/rpm-tmp.69701 saying:
%{__spec_prep_template}%{__spec_prep_post}

Resources