Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbake Server does not start on Windows Subsystem for Linux

I am following the Quick Start Guide for Yocto Project on Windows Subsystem for Linux.

I cloned all the necessary stuff:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
 xz-utils debianutils iputils-ping libsdl1.2-dev xterm

cloned the repository to a directory in the /mnt/c/Users/<myUser>/Yocto directory

created a branch as mentioned in the manual

 cd poky/ && git checkout tags/yocto_2.4.2 -b poky_2.4.2

and executed the file

 source oe-init-build-env

Once I execute bitbake core-image-sato I get the following Error:

Previous bitbake instance shutting down?, waiting to retry...
Previous bitbake instance shutting down?, waiting to retry...                                                 
NOTE: Retrying server connection... (Traceback (most recent call last):                                                                                                                                     
File "/mnt/c/Users/<user>/Yocto/poky/bitbake/lib/bb/main.py", 
line 441, in setup_bitbake                                          
server = bb.server.process.BitBakeServer(lock, sockname, configuration, featureset)
File "/mnt/c/Users/<user>/Yocto/poky/bitbake/lib/bb/server/process.py", 
line 385, in __init__                                                                                                      
self.sock.bind(os.path.basename(sockname)) 
PermissionError: [Errno 1] Operation not permitted 
                                                                                                                                               )                                                                                                                                                                                                         
WARNING: /mnt/c/Users/des/Development/Yocto/poky/bitbake/lib/bb/main.py:476:
 ResourceWarning: unclosed <socket.socket fd=14, 
family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>            
logger.info("Retrying server connection... (%s)" % traceback.format_exc())                                                                                                                                                                                                                                                                                                                                        
NOTE: Reconnecting to bitbake server...                                                                                                                                                                   
NOTE: Retrying server connection...                                                                                                                                                                       
ERROR: Unable to connect to bitbake server, or start one                                                                                                                                                  

I stumbled upon some GitHub Issue from the WSL Issue Tracker that this might have something to do with inotify.

I can't figure out what is wrong here and which socket is the error really about?

like image 465
Shan-Desai Avatar asked Sep 06 '25 03:09

Shan-Desai


2 Answers

I had this same issue, I am guessing you have the path of your bitbake not in the root linux filesystem. I edited the file main.py inside the bitbake lib directory line ~ 436 to change to sockpath = "/tmp/bitbake.sock" and got over this. The next thing you have to look forward to is the fact that bitbake does not like case insensitive filestystems.

like image 199
Paul Rolfe Avatar answered Sep 07 '25 20:09

Paul Rolfe


I have also tried this and had the same issue when building from within the /mnt/c/../poky/build location. As of Win ver. 1803 Build#17134.1 I can't seem to get pyinotify and the bitbake scripts to work from the widows directory.

However bitbake works from WSL when inside the WSL directory structure, when did this I simply

cp -a -r /mnt/c/linux/. ~/

But this was a mistake as I had already attempted to compile and had just copied my symbolic links to a new location.

I have added mc (Midnight Commander) to my WSL because I am too lazy to type everything every time and use mcedit as my default editor, because it has syntax highlighting, mouse, go to line, search support and more (but the point is get used to the terminal editor of your choice) . My first run completed with errors, because of the fore mentioned copy path error, but after double checking the log and resetting my links I will compile again (more to come).

 ### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'
~/poky/build $ (wsl-test-yocto-2.5) bitbake core-image-sato
Parsing recipes: 100% |##################################################################################################| Time: 0:00:26
Parsing of 814 .bb files complete (0 cached, 814 parsed). 1282 targets, 46 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.37.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-16.04"
TARGET_SYS           = "i586-poky-linux"
MACHINE              = "qemux86"
DISTRO               = "poky"
DISTRO_VERSION       = "2.5"
TUNE_FEATURES        = "m32 i586"
TARGET_FPU           = ""
meta
meta-poky
meta-yocto-bsp       = "wsl-test-yocto-2.5:da3625c52e1ab8985fba4fc3d133edf92142f182"

NOTE: Fetching uninative binary shim from http://downloads.yoctoproject.org/releases/uninative/1.9/x86_64-nativesdk-libc.tar.bz2;sha256sum=c26622a1f27dbf5b25de986b11584b5c5b2f322d9eb367f705a744f58a5561ec
WARNING: The Linux kernel on your build host was not configured to provide process I/O statistics. (CONFIG_TASK_IO_ACCOUNTING is not set)
Initialising tasks: 100% |###############################################################################################| Time: 0:00:05
Checking sstate mirror object availability: 100% |#######################################################################| Time: 0:01:00
NOTE: Executing SetScene Tasks
Currently  6 running tasks (1111 of 2266)  48% |##########################################                                             |
0: nettle-3.4-r0 do_populate_lic_setscene (pid 8617) 100% |####################################################################| 1012K/s
1: mpfr-native-3.1.5-r0 do_populate_lic_setscene (pid 8614) 100% |##############################################################| 970K/s
2: grep-3.1-r0 do_populate_lic_setscene (pid 8637) 100% |######################################################################| 1.54M/s
like image 36
Nathan Bryant Avatar answered Sep 07 '25 22:09

Nathan Bryant