repository #local_jdk which failed to fetch. no such package '#local_jdk//': java.io.IOException: Could not create symlink - scala

I'm trying to Hello World example scala file according to on my windows 10 desktop:
https://github.com/bazelbuild/rules_scala
My WORKSHOP file is as recommended in the rules_scala repo.
My BUILD file is as follows:
load("#io_bazel_rules_scala//scala:scala.bzl", "scala_test", "scala_binary")
scala_binary(
name = "helloworld",
srcs = ["HelloWorld.scala"],
main_class="HelloWorld",
)
I've set my environment variable JAVA_HOME to where my javac.exe file is located. But when I try to build it, I get the following:
EDIT: After enabling developer mode on windows, the first half of the error disappeared, but still get:
PS C:\Users\m80\Documents\GitHub\BotsForGames\HexAgony\src\hexagony> bazel build :helloworld
INFO: Repository local_jdk instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:40:22: in <toplevel>
Repository rule local_java_repository defined at:
C:/users/m80/_bazel_m80/4fgq25dr/external/bazel_tools/tools/jdk/local_java_repository.bzl:66:40: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_jdk':
Traceback (most recent call last):
File "C:/users/m80/_bazel_m80/4fgq25dr/external/bazel_tools/tools/jdk/local_java_repository.bzl", line 46, column 35, in _local_java_repository_impl
repository_ctx.symlink(file, file.basename)
Error in symlink: java.io.IOException: Could not create symlink from C:/Users/m80/_bazel_m80/4fgq25dr/external/remotejdk11_win/BUILD.bazel to C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel: C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel (File exists)
ERROR: Error fetching repository: Traceback (most recent call last):
File "C:/users/m80/_bazel_m80/4fgq25dr/external/bazel_tools/tools/jdk/local_java_repository.bzl", line 46, column 35, in _local_java_repository_impl
repository_ctx.symlink(file, file.basename)
Error in symlink: java.io.IOException: Could not create symlink from C:/Users/m80/_bazel_m80/4fgq25dr/external/remotejdk11_win/BUILD.bazel to C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel: C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel (File exists)
ERROR: C:/users/m80/_bazel_m80/4fgq25dr/external/bazel_tools/tools/jdk/BUILD:336:6: #bazel_tools//tools/jdk:jdk depends on #local_jdk//:jdk in repository #local_jdk which failed to fetch. no such package '#local_jdk//': java.io.IOException: Could not create symlink from C:/Users/m80/_bazel_m80/4fgq25dr/external/remotejdk11_win/BUILD.bazel to C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel: C:/users/m80/_bazel_m80/4fgq25dr/external/local_jdk/BUILD.bazel (File exists)
ERROR: Analysis of target '//hexagony/src/hexagony:helloworld' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.588s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (3 packages loaded, 39 targets configured)
What does this mean? How could I resolve it? I couldn't seem to find many similar problems wrt Scala + Bazel

Related

How Can I Solve "Failed To Source Bitbake" With Xilinx Petalinux SDK

I am running Ubuntu 16.04 with Xilinx Petalinux 2018.03 SDK. After a number of successful compilations I am now facing this error
$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to build project
How can I solved this issue?
Another reason to get the errors "ERROR: Failed to source bitbake" as well as "ERROR: Failed to build project" is a possible upgrade of Python on the build machine. The Petalinux SDK requires python v2 (>= 2.7.3) for the 2018.3 edition.
You can check under [YOUR_PROJECT]/build/build.log and you might see a log similar to this one below:
[INFO] building project
[INFO] sourcing bitbake
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3.
Please set up python v2 as your default 'python' interpreter.
ERROR: Failed to source bitbake
ERROR: Failed to build project
To remedy this issue remove the symbolic link under /usr/bin and make sure to create a new one that is pointing to Python 2.7:
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
First you need to investigate the error a little further, do this:
source /opt/pkg/petalinux/2018.3/settings.sh
It will return something similar to this below:
PetaLinux environment set to '/opt/pkg/petalinux/2018.3'
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services
Source the environment setup:
source /opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/environment-setup-aarch64-xilinx-linux
followed by:
devtool --help
In my case I can see more about the actual error:
NOTE: Starting bitbake server...
ERROR: Unable to start bitbake server
ERROR: Last 10 lines of server log for this session (/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/bitbake-cookerdaemon.log):
Traceback (most recent call last):
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/daemonize.py", line 77, in createDaemon
function()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/server/process.py", line 433, in _startServer
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/cooker.py", line 178, in __init__
self.configwatcher = pyinotify.WatchManager()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/pyinotify.py", line 1764, in __init__
raise OSError(err % self._inotify_wrapper.str_errno())
OSError: Cannot initialize new instance of inotify, Errno=Too many open files (EMFILE)
ERROR: Unable to start bitbake server
ERROR: Last 10 lines of server log for this session (/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/bitbake-cookerdaemon.log):
Traceback (most recent call last):
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/daemonize.py", line 77, in createDaemon
function()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/server/process.py", line 433, in _startServer
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/cooker.py", line 178, in __init__
self.configwatcher = pyinotify.WatchManager()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/pyinotify.py", line 1764, in __init__
raise OSError(err % self._inotify_wrapper.str_errno())
OSError: Cannot initialize new instance of inotify, **Errno=Too many open files (EMFILE)**
This is pointing to the /proc/sys/fs/inotify/max_user_instances that need to be increased. In my case I went from 128 to 256 by doing this:
sudo su
echo 256 > /proc/sys/fs/inotify/max_user_instances
You need to become root with "su" and change the mac_user_instances.

How to solve error on docker:layers_calculator to compute the Merkle tree on private tangle?

I want to setup a private tangle on my own virtual machine with Ubuntu 18.04, 4GB RAM and 20GB memory.
I have follow this instructions: https://docs.iota.org/docs/compass/0.1/how-to-guides/set-up-a-private-tangle. Every command works fine until reach this one: bazel run //docker:layers_calculator.
It shows an error as follows:
Starting local Bazel server and connecting to it...
ERROR: /home/istabraq/compass/third-party/maven_deps.bzl:3:5: Traceback (most recent call last):
File "/home/istabraq/compass/WORKSPACE", line 42
maven_jars()
File "/home/istabraq/compass/third-party/maven_deps.bzl", line 3, in maven_jars
native.maven_jar(<4 more arguments>)
type 'struct' has no method maven_jar()
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
INFO: Elapsed time: 4.743s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
How can I solve this problem? what I have missed?
read carefully the message given after running bazel installer:
Make sure you have "/home/yourusername/bin" in your path. You can also activate bash completion by adding the following line to your :
source /home/yourusername/.bazel/bin/bazel-complete.bash
You can check with: "bazel info" or "bazel version"
Unfortunately, there are further errors:
https://github.com/iotaledger/compass/issues/142
I have solve this issue by using this commands:
Step 3: Set up your environment
If you ran the Bazel installer with the --user flag as above, the Bazel executable is installed in your $HOME/bin directory. It’s a good idea to add this directory to your default paths, as follows:
export PATH="$PATH:$HOME/bin"
You can also add this command to your ~/.bashrc or ~/.zshrc file to make it permanent.
reference:
https://docs.bazel.build/versions/master/install-ubuntu.html

Docker-compose on Windows 10: Fatal Python error: Py_Initialize: unable to load the file system codec

When trying to run docker-compose,e.g.:
docker-compose --version
the following error message appears:
Fatal Python error: Py_Initialize: unable to load the file system codec ModuleNotFoundError: No module named ‘encodings’
Current thread 0x0000228c (most recent call first):
Any suggestions how to fix it?
Thanks in advance

bitbake fails at the simplest recipe

Just installed Yocto. On a morty branch. Executed the following commands:
cd poky
source oe-init-build-env build-qemuarm
In conf/local.conf changed the name of the machine to MACHINE ?= "qemuarm"
Then executed the following:
$ bitbake core-image-minimal
Loading cache: 100% |##########################################################################################################| Time: 0:00:00
Loaded 1320 entries from dependency cache.
ERROR: Execution of event handler 'sstate_eventhandler2' failed
Traceback (most recent call last):
File "/home/some-user/projects/melp/poky/meta/classes/sstate.bbclass", line 1015, in sstate_eventhandler2(e=<bb.event.ReachableStamps object at 0x7fbc17f2e0f0>):
for l in lines:
> (stamp, manifest, workdir) = l.split()
if stamp not in stamps:
ValueError: not enough values to unpack (expected 3, got 1)
ERROR: Command execution failed: Traceback (most recent call last):
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/command.py", line 101, in runAsyncCommand
self.cooker.updateCache()
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/cooker.py", line 1658, in updateCache
bb.event.fire(event, self.databuilder.mcdata[mc])
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 201, in fire
fire_class_handlers(event, d)
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 124, in fire_class_handlers
execute_handler(name, handler, event, d)
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 96, in execute_handler
ret = handler(event)
File "/home/some-user/projects/melp/poky/meta/classes/sstate.bbclass", line 1015, in sstate_eventhandler2
(stamp, manifest, workdir) = l.split()
ValueError: not enough values to unpack (expected 3, got 1)
It looks like it is a python error. Does anyone know what is the issue? Am I using the wrong version?
Here is the output of python --version
$ python --version
Python 2.7.12
What am I doing wrong?
You realise that Morty is 18 months old and in a few weeks will be longer supported right?
Anyway, looks like the sstate-cache/ somehow is corrupted. Delete your tmp/ and sstate-cache/ directories and try again.

Python :ImportError: DLL load failed: The specified module could not be found

I am working on Python plugins for QGIS. I set my variables as
PATH :=C:\OSGeo4W\apps\qgis;%PATH%
PYTHONPATH:=C:\OSGeo4W\apps\qgis\python
But when i try to run my .py file in IDLE i gets error saying:
Traceback (most recent call last):
File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 30, in
from qgis.core import *
ImportError: DLL load failed: The specified module could not be found.
what i should set for PATH variable??