s2i haskell stack failed to build cardano-sl - stack

Im trying to build my cardano full node application
I am having some issue with the stack.yaml, I am using current stack-2.1.1 and I installed all the dependencies for cardano-sl:
https://github.com/input-output-hk/cardano-sl/blob/develop/docs/how-to/build-cardano-sl-and-daedalus-from-source-code.md
---> Building application from source...
Going to build: cardano-sl-networking cardano-sl-binary cardano-sl-util cardano-sl-crypto cardano-sl-core cardano-sl-db cardano-sl-chain cardano-sl-infra cardano-sl cardano-sl-node cardano-sl-client cardano-sl-generator cardano-sl-auxx cardano-sl-tools cardano-sl-explorer cardano-sl-wallet
Building cardano-sl-networking
stack build --ghc-options=" -Wwarn" --test --no-haddock-deps --bench --jobs=1 --no-run-tests --no-run-benchmarks --dependencies-only cardano-sl-networking
Could not parse '/opt/app-root/src/stack.yaml':
Aeson exception:
Error in $.packages[32]: failed to parse field 'packages': expected Text, encountered Object
See http://docs.haskellstack.org/en/stable/yaml_configuration/
Build failed
ERROR: An error occurred: non-zero (13) exit code from mycardano-s2i
My stack.yaml:
resolver: lts-12.17
flags:
ether:
disable-tup-instances: true
extra-package-dbs: []
packages:
util
util/test
networking
binary
binary/test
crypto
crypto/test
core
core/test
db
db/test
infra
infra/test
chain
chain/test
lib
generator
client
auxx
script-runner
explorer
node
tools
tools/post-mortem
utxo
wallet
node-ipc
faucet
acid-state-exts
x509
cluster
mnemonic
I have read some workaround where you have to update stack, but I am the moment I am using the last release 2.1.1.

Related

Issues with running remix Binary in Bazel sandbox

I've encountered an issue trying to use bazel as a build tool for remix. I've been able to run remix in dev mode but currently unable to get remix build to work.
I've encountered a few errors that led up to this point. I'll list the errors in the order which they occurred with my fixes (just incase any of the fixes introduces a new issue)
First error in the bazel sandbox is related to a transitive dependency of #remix-run/dev (#remix-run/dev->gunzip-maybe->browserify-zlib). Bazel failed to fetch the bazel repository #npm__browserify-zlib__0.1.4. I assumed this was a bazel issue and tried to override browserify-zlib#0.1.4 with browserify-zlib#0.2.0, which worked. Here is bazel error for reference:
ERROR: /Users/emmanuel/projects/bbbazel/WORKSPACE:89:17: fetching _npm_import rule //external:npm__browserify-zlib__0.1.4: Traceback (most recent call last):
File "/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/aspect_rules_js/npm/private/npm_import.bzl", line 471, column 27, in _impl
pkg_json = json.decode(rctx.read(pkg_json_path))
Error in decode: at offset 685, object has duplicate key: "main"
ERROR: /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/external/npm/BUILD.bazel:3012:6: #npm//:npm__browserify-zlib__0.1.4_source_directory depends on #npm__browserify-zlib__0.1.4//:source_directory in repository #npm__browserify-zlib__0.1.4 which failed to fetch. no such package '#npm__browserify-zlib__0.1.4//': at offset 685, object has duplicate key: "main"
Next error in the bazel sandbox is related to another transitive dependency of #remix-run/dev (#remix-run/dev->xdm->deasync). The install lifecycle hook for the deasync npm package makes a call to the node-gyp binary which doesn't exist in the sandbox and the bazel build command fails during setup. To fix this, I disabled the install lifecycle hook (I also disabled it with a pnpm install outside the sandbox and the remix build command executed perfectly) which led to the final error. Here's the error message for this error:
/Users/emmanuel/projects/bbbazel/BUILD.bazel:5:22: Running lifecycle hooks on npm package deasync#0.1.28 failed: (Exit 1): lifecycle-hooks.sh failed: error executing command (from target //:.aspect_rules_js/node_modules/deasync#0.1.28/lc) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/aspect_rules_js/npm/private/lifecycle/lifecycle-hooks.sh deasync ../../../external/npm__deasync__0.1.28/package ... (remaining 1 argument skipped)
/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/node-gyp-bin/node-gyp: line 5: 1211: command not found
node-gyp not found! Please upgrade your install of npm! You need at least 1.1.5 (I think) and preferably 1.1.30.
> deasync#0.1.28 install /private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/deasync#0.1.28/node_modules/deasync
> node ./build.js
===============================================================
Failure while running lifecycle hook for package 'deasync#0.1.28':
Script: 'install'
Command: `node ./build.js`
Stack trace:
spawn ENOENT
at ChildProcess.<anonymous> (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/external/aspect_rules_js/npm/private/lifecycle/min/index.min.js:1:91930)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
The final error suggests a bug with remix, but since it only occurs in the bazel sandbox I think it may be an issue that cuts across bazel and remix. The error returned is shown below:
The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new
Missing output for entry point
Error
at Object.onCompileFailure (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:180:13)
at Object.compile (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/remixCompiler.js:34:134)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/compiler/build.js:33:3)
at async Object.build (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/commands.js:175:3)
at async Object.run (/private/var/tmp/_bazel_emmanuel/f416ba8913b741927ac435783e3163e0/sandbox/darwin-sandbox/1566/execroot/fleet/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/#remix-run+dev#1.12.0_#remix-run+serve#1.12.0/node_modules/#remix-run/dev/dist/cli/run.js:449:7)
Building Remix app in production mode...
Target //examples/remix:build failed to build
I've tried to run it outside bazel and with pnpm (I added the override to the package.json for browserify-zlip#0.2.0, then I ran pnpm instal with --ignore-scripts flag) and it builds fine.
I'm not sure if this is a bug with remix or a bazel issue. Has anyone else experienced this? Or does anyone having a working version of remix with bazel as the build tool?
I've created a minified version of the repository in the state of the 3rd error https://github.com/noelenwenede/bbbazel. Start up instructions are in the readme file.

MEDIAPIPE failed run hello world from example

UBUNTU 20.04
bazel 3.0.0- (#non-git)
openjdk 11.0.8 2020-07-14
Actually, the error itself:
dmitry#dmitry-pc:~/mediapipe$ bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu
Starting local Bazel server and connecting to it...
INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip) = f358144776d3dfc5a928ef32a0e4fbe93c99b55772d70cca77a6478e34d96aa7
DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "f358144776d3dfc5a928ef32a0e4fbe93c99b55772d70cca77a6478e34d96aa7"
DEBUG: Call stack for the definition of repository 'rules_foreign_cc' which is a http_archive (rule definition at /home/dmitry/.cache/bazel/_bazel_dmitry/870728c32b519bd8ea9ab1059ef39614/external/bazel_tools/tools/build_defs/repo/http.bzl:296:16):
- <builtin>
- /home/dmitry/mediapipe/WORKSPACE:39:1
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = d1d266f0ee34a413af9e70b27354faddc2f300d873bcc388508901121e08aff4
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d1d266f0ee34a413af9e70b27354faddc2f300d873bcc388508901121e08aff4"
DEBUG: Call stack for the definition of repository 'rules_cc' which is a http_archive (rule definition at /home/dmitry/.cache/bazel/_bazel_dmitry/870728c32b519bd8ea9ab1059ef39614/external/bazel_tools/tools/build_defs/repo/http.bzl:296:16):
- <builtin>
- /home/dmitry/mediapipe/WORKSPACE:33:1
ERROR: /home/dmitry/.cache/bazel/_bazel_dmitry/870728c32b519bd8ea9ab1059ef39614/external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl:28:21: rule() got unexpected keyword argument 'incompatible_use_toolchain_transition'
ERROR: While resolving toolchains for target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '#bazel_tools//tools/cpp': in /home/dmitry/.cache/bazel/_bazel_dmitry/870728c32b519bd8ea9ab1059ef39614/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/cc_flags_supplier.bzl' has errors
ERROR: Analysis of target '//mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu' failed; build aborted: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '#bazel_tools//tools/cpp': in /home/dmitry/.cache/bazel/_bazel_dmitry/870728c32b519bd8ea9ab1059ef39614/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/cc_flags_supplier.bzl' has errors
INFO: Elapsed time: 12,845s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 0 targe\
ts configured)
I came across the same error and the option incompatible_use_toolchain_transition doesn't seem to be supported in bazel version 3.0.0.
Try updating your bazel following their manual.
On more thing, the latest 3.5 version of bazel seem to have another issue. So consider getting 3.4 version or apply the workaround in the Github issue.

Tensorflow Hub Build from Source Failing

I'm having a problem with Building TF Hub from Source. Can Anyone please help me out? I've been following the steps as given in https://github.com/tensorflow/hub/blob/master/tensorflow_hub/pip_package/PIP.md
I've installed bazel 0.24.1.
Error I'm Getting:
ERROR: /home/tf_hub/hub/WORKSPACE:17:1: name 'git_repository' is not defined
ERROR: /home/tf_hub/hub/WORKSPACE:40:1: name 'http_archive' is not defined
ERROR: /home/tf_hub/hub/WORKSPACE:47:1: name 'new_http_archive' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '#bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '#bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package
INFO: Elapsed time: 2.552s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Bazel Version: 0.24.1
Python Version: 3
Tensorflow Version: 2.0.0a
Commands to Reproduce:
(env)~/tf_hub$ git clone https://github.com/tensorflow/hub
(env)~/tf_hub$ cd hub && bazel build tensorflow_hub/pip_package:build_pip_package
Expected Output: No Error. Build Sucessful
Latest Versions of Bazel Doesn't support git_repository (which is still used by tensorflow_hub), so Uninstalling Bazel 0.24.1 and installing Bazel 0.18.1 worked.

Hadoop fails to load opencv native library

I am trying to run an image processing example in Hadoop.
Hadoop Version: Hadoop 2.0.0-cdh4.2.1
Hipi Version: hipi-2.1.0
OpenCV Version: opencv-2.4.11
opencv-2411.jar and hipi-2.1.0.jar are in hadoop-classpath
I have put “libopencv_java2411.so” in directory /etc/opencv/lib.
Set JAVA_LIBRARY_PATH in /usr/lib/hadoop/libexec/hadoop-config.sh file, to point to OpenCV native library as below:
JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:/etc/opencv/lib
When I submit the job, I get following error message.
attempt_201804241646_0001_m_000000_0: Native code library failed to load.
attempt_201804241646_0001_m_000000_0: java.lang.UnsatisfiedLinkError: no opencv_java2411 in java.library.pathopencv_java2411
18/04/24 17:05:05 INFO mapred.JobClient: Task Id : attempt_201804241646_0001_m_000000_1, Status : FAILED
java.lang.Throwable: Child Error
at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:250)
Caused by: java.io.IOException: Task process exit with nonzero status of 1.
at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:237)
Why it fails to load the native library? Please help.

Unable to clone the repository in git_repository in bazel with ubuntu 15.10

I am trying to compile the following heron branch
https://github.com/twitter/heron/tree/karthik/pexbuild
using bazel 0.3.1 in ubuntu 15.10. In the workspace, I refer to another repo containing the pex bazel rules at
https://github.com/streamlio/bazel_rules_pex
I am getting the following error (interestingly it does not occur in ubuntu14.04, ubuntu16.10, centos7 and mac). Any help will be appreciated?
bazel build --config=ubuntu --verbose_failures heron/...
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'pex/pex_rules.bzl': no such package '#io_bazel_rules_pex//pex': Error cloning repository: https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by https://github.com/streamlio/bazel_rules_pex.git: cannot open git-upload-pack caused by java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty caused by the trustAnchors parameter must be non-empty.
There were many fixes and improvements in remote repositories, I'd advice you to upgrade bazel before trying anything else.

Resources