Yocto Error : Could not inherit file classes/qt6-cmake.bbclass - yocto

I'm currently trying to 'boot 2 qt'
I add layers, at "bblayers.conf"
like this.
/yocto/kirkstone/meta-boot2qt/meta-boot2qt \
and also set machine at "local.conf"
when I try to bitbake, the error occurs like this
Input : bitbake b2qt-embedded-qt6-image
Output: ERROR: ParseError at /home/seame-fablab/yocto/kirkstone/meta-boot2qt/meta-boot2qt/recipes-qt/boot2qt-addons/qdb_git.bb:36: Could not inherit file classes/qt6-cmake.bbclass
ERROR: Parsing halted due to errors, see error messages above
how to solve the errors

I believe its likely you are simply missing the layer where qt6-cmake.bbclass belongs to.
Its hard to say if you missed cloning it, or just adding it to your bblayers.conf since you didnt really specify how you actually cloned the repos, but the README for meta-boot2qt suggests you use repo for such task, which should've taken care of that for you.
For example, using
mkdir ~/mybuilddir
cd ~/mybuilddir/
repo init -u git://code.qt.io/yocto/boot2qt-manifest -m 6.5.xml
repo sync
would get you a structure like this:
$ tree -L 2
.
├── setup-environment.sh -> sources/meta-boot2qt/scripts/setup-environment.sh
└── sources
├── meta-boot2qt
├── meta-freescale
├── meta-freescale-3rdparty
├── meta-intel
├── meta-mingw
├── meta-openembedded
├── meta-qt6
├── meta-raspberrypi
├── meta-tegra
├── meta-toradex-bsp-common
├── meta-toradex-nxp
├── poky
└── templates -> meta-boot2qt/meta-boot2qt-distro/conf/templates/default
And the class you are missing is located at:
./sources/meta-qt6/classes/qt6-cmake.bbclass
Now, if you for some reason dont want to use repo and would like to manually clone the required layers, you are also welcome to do that, you just need to clone meta-qt6:
git clone https://code.qt.io/cgit/yocto/meta-qt6.git/
and add it to your bblayers.conf
bitbake-layers add-layer <path-to-meta-qt6-layer-you-just-cloned>

Related

Adding (buried) features from Yocto layers that are present in your build

I'm a neophyte with Yocto, though I have been able to glean enough from tutorials to create an image that meets some of the requirements for my current project. I'm able to create my own layer and recipe so I can generate it with bitbake, e.g. bitbake mycustomimage.
I'm working with a beaglebone and the tutorials I've followed state you need the following layers:
meta-arm
meta-ti
poky (of course)
Just following the beagelbone tutorials will allow you to create a variety of prepackaged images from default recipes. However, tutorials and Yocto documentation do not explain how to access features and applications contained in the existing layers but are not utilized by the default recipes. I'm aware that you can use the IMAGE_FEATURE and EXTRA_IMAGE_FEATURE variables to add some (prepackaged) support.
I've come up with a way to add features from other layers by copying them into my custom layer directory structure and adding them to my customimage.bb file. This technique feels hacky and potentially error prone, also it duplicates files and directories found in other layers. My question is:
How are you supposed to add features from existing layers added to your project? For example I'll be needing PRU support for my beaglebone project, I know where those features are in the meta-ti layer (found in the recipes-bsp/ directory). How can I access that support and those features without a stupid hack? There must be a way.
Here's an example. I needed xorg-minimal-fonts installed, the recipe is contained in the poky/meta/recipes-graphics directory. I copied the contents into my custom layer which looks something like this:
mycustomimage
├── conf
│   └── layer.conf
└── recipes-core
├── images
│   └── core-image-mycustomimage.bb
└── xorg-font
├── encodings
│   └── nocompiler.patch
├── encodings_1.0.5.bb
├── font-alias-1.0.3
│   └── nocompiler.patch
├── font-alias_1.0.3.bb
├── font-util_1.3.2.bb
├── xorg-font-common.inc
├── xorg-minimal-fonts
│   └── misc
│   ├── 6x13B-ISO8859-10.pcf.gz
...(a bunch of zipped fonts)
│   ├── cursor.pcf.gz
│   └── fonts.dir
└── xorg-minimal-fonts.bb
My custom layer .bb file looks like this:
IMAGE_FEATURES_append = " x11-base ssh-server-dropbear hwcodecs"
IMAGE_FEATURES_remove = "allow-empty-password"
IMAGE_FEATURES_remove = "empty-root-password"
require recipes-core/xorg-font/xorg-minimal-fonts.bb
IMAGE_INSTALL = "\
packagegroup-core-boot \
packagegroup-core-full-cmdline \
${CORE_IMAGE_EXTRA_INSTALL} \
xorg-minimal-fonts \
"
inherit core-image extrausers
I know this is not how you're supposed do this, but it did work.
If you have a custom layer with a custom image, you can add any recipe that is in other layer.
If you copied xorg-font folder for that reason, it means that you need to copy all folders also of what you set in IMAGE_INSTALL.
You do not need to require the xorg-minimal-fonts recipe in the image recipe.
Also, IMAGE_INSTALL = .. will override the IMAGE_INSTALL of core-image class, so here is your custom image after some fixes:
# Inherit core-image because it already has:
#
# CORE_IMAGE_BASE_INSTALL = '\
# packagegroup-core-boot \
# packagegroup-base-extended \
# \
# ${CORE_IMAGE_EXTRA_INSTALL} \
# '
# ...
# IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
inherit core-image extrausers
# Activate features
#
# Activate x11-base only if x11 is in DISTRO_FEATURES
IMAGE_FEATURES_append = " ${#bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base', '', d)}"
IMAGE_FEATURES_append = " ssh-server-dropbear hwcodecs"
IMAGE_FEATURES_remove = "allow-empty-password"
IMAGE_FEATURES_remove = "empty-root-password"
# Add custom recipes
IMAGE_INSTALL_append = " xorg-minimal-fonts"

How do I properly use go modules in vscode?

I have used vscode 1.41.1 on my mac for a few months and it worked good until I started to use go modules for dependency management. At the moment I am rewriting a simple tool and introduce packages for separate functionalities.
My code structure looks like this:
├── bmr.go -> package main & main(), uses below packages
├── check
│   ├── check.go -> package check
│   └── check_test.go
├── go.mod
├── go.sum
├── push
│   ├── push.go -> package push
│   └── push_test.go
└── s3objects
├── s3objects.go -> package s3objects
└── s3objects_test.go
My go.mod file:
module github.com/some-org/business-metrics-restore
go 1.13
require (
github.com/aws/aws-sdk-go v1.28.1
github.com/go-redis/redis v6.15.6+incompatible
github.com/sirupsen/logrus v1.4.2
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.4.0
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1
)
All is fine when I invoke go test/run/build commands from the shell. But when I use 'Debug' -> 'Run Without Debugging' I get:
go: finding github.com/some-org/business-metrics-restore/push latest
go: finding github.com/some-org/business-metrics-restore latest
go: finding github.com/some-org/business-metrics-restore/check latest
go: finding github.com/some-org/business-metrics-restore/s3objects latest
build command-line-arguments: cannot load github.com/some-org/business-metrics-restore/check: module github.com/some-org/business-metrics-restore#latest found (v0.0.0-20191022092726-d1a52439dad8), but does not contain package github.com/some-org/business-metrics-restore/check
Process exiting with code: 1
My code currently is in a feature branch and d1a52439dad8 is the first (init) and only commit on master. No code for the tool (incl. 3 mentioned non main packages) is in the master branch.
The problem here is that for some reason as you see above vscode fetches state from master and I cannot override this behaviour.
Can anyone help me?
Thanks!
Best Regards,
Rafal.
I realized that if the go.mod is not at the root of your project VSCode does not work properly. I have an AWS SAM project with the following structure:
├── Makefile
├── README.md
├── nic-update
│   ├── go.mod
│   ├── go.sum
│   ├── main.go
│   ├── main_test.go
│   └── r53service
│   └── r53.go
├── samconfig.toml
└── template.yaml
and the only way it works if by starting VSCode from the nic-update directory.
My go.mod has the following content:
require (
github.com/aws/aws-lambda-go v1.13.3
github.com/aws/aws-sdk-go v1.32.12
)
module github.com/jschwindt/ddns-route53/nic-update
go 1.14
I realized that if the go.mod is not at the root of your project VSCode does not work properly
That might now (Oct. 2020) be supported, as a consequence of gopls v0.5.1 and its experimental feature Multi-module workspace support from the proposal 32394.
Even if you don't have multiple modules, a go.mod in a sub-folder (instead of the root folder of your project) will be better managed (if you activate the gopls.experimentalWorkspaceModule setting).
As noted by kayochin in the comments:
The setting should be "gopls": {"build.experimentalWorkspaceModule": true}
See the documentation "gopls / Settings / experimentalWorkspaceModule bool".
I have also had trouble with VS Code and modules. The current status of VS Code support for Go Modules is kept up to date here: https://github.com/golang/vscode-go#Set-up-your-environment
In that link they suggest ditching most of the existing extensions VS Code encourages you to install with Go and instead using the language server gopls with these directions:
Add the below in your settings to use it.
"go.useLanguageServer": true
Note: You will be prompted to install the latest stable version of gopls as and when the Go tools team tag a new version as stable.
You should also fix autoimporting:
Add the setting "go.formatTool": "goimports" and then use Go: Install/Update Tools to install/update goimports as it has recently added support for modules.
When you do these things, keep in mind that you'll also lose a couple of features:
Completion of unimported packages doesnt work
Find references and rename only work in a single package

Locally building and pushing VuePress site to Github Pages

Having trouble figuring out how the workflow for using Github as a VuePress site source control and deploying it to Github Pages.
When I ran deploy.sh the first time, it gave me a Github certificate error around the init command and did not initialize a new repo (I already have a repo setup so not sure if the init command in deploy.sh is required. Subsequent runs of deploy.sh resulted in no error.
**Problem:**Unfortunately, when I visit my Github Pages site, its not using VuePress templates.
I feel like I have either:
- The folder structure wrong
- The base set incorrectly in config.js
- The relative folders incorrect in deploy.sh
Can someone put eyes on this and give some feedback? Thank you.
For your reference
Local machine's folder structure:
user#system:~/powerDocs$ tree
.
├── deploy.sh
├── docs
│   └── README.md
├── node_modules
│   └── yarn
│   ├── bin
│   │   ├── yarn
│   │   ├── yarn.cmd
│   │   ├── yarn.js
│   │   ├── yarnpkg
│   │   └── yarnpkg.cmd
│   ├── lib
│   │   ├── cli.js
│   │   └── v8-compile-cache.js
│   ├── LICENSE
│   ├── package.json
│   └── README.md
├── package.json
├── package-lock.json
└── README.md
5 directories, 15 files
Content of deploy.sh:
#!/usr/bin/env sh
# abort on errors
set -e
# build
vuepress build
# navigate into the build output directory
cd docs/.vuepress/dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git#github.com:SeaDude/SeaDude.github.io.git master
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git#github.com:SeaDude/powerDocs.git master:gh-pages
cd -
I made deploy.sh executable with chmod +x deploy.sh. Running ./deploy.sh gives me the following output:
user#system:~/powerDocs$ ./deploy.sh
WAIT Extracting site metadata...
[12:05:53 PM] Compiling Client
[12:05:53 PM] Compiling Server
(node:15590) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[12:05:57 PM] Compiled Server in 3s
[12:05:59 PM] Compiled Client in 6s
WAIT Rendering static HTML...
DONE Success! Generated static files in .vuepress/dist.
Reinitialized existing Git repository in /home/powerDocs/docs/.vuepress/dist/.git/
On branch master
nothing to commit, working directory clean
Here is the contents of config.js:
module.exports = {
title: "PowerDocs",
description: "Where functions go to frolic.",
base: "/powerDocs/",
themeConfig: {
nav: [
{ text: "Home", link: "/" }
],
sidebar: [
'/'
]
}
};
Have you checked your dist folder to see what is actually being output? The error makes it seem like there are no files present to commit after the build.
I have the almost identical setup locally and haven't run into this problem with it, the only difference being the command I run to build is yarn docs:build

setuptools sdist ignore data_files

According to docs https://packaging.python.org/en/latest/distributing/#data-files
setuptools will honor data_files configed in setup.py. But i can't make it work. This is my setup.py:
setup(
name='booking_order',
version=version,
packages=find_packages(),
package_data={
'booking_order': ['fake_backends/static/*',
'scripts/*',
'*.sample'],
},
data_files=[
('/etc/booking', ['etc/booking.conf'])
],
This is the project's file tree:
.
├── booking_order
│   ├── __init__.py
│   ├── tests
│   │   ├── __init__.py
├── etc
│   ├── booking.conf
├── README.md
├── setup.py
The behavior is, if i run python setup.py install, file etc/booking.conf will got installed to /etc/booking. But if i first python setup.py sdist upload, then pip install booking_order, there will be an error "error: can't copy 'etc/booking.conf': doesn't exist or not a regular file".
I checked python setup.py sdist doesn't include files in etc at all.
EDIT:
it seems this is the answer: https://github.com/pypa/setuptools/issues/521
Answer it myself.
According to pypa, and non-package-data-files。"Setuptools doesn't support installing data files to some arbitrary location on a user’s machine; this is a feature, not a bug."
If one need to install files to locations like /etc, /usr/share, eg, then he/she may use data_files flag from distutils, which feature is not totally cleaned up from setuptools. "Not totally cleaned up" means you need to add those files to MANIFEST.in manually, which is different as in distutils.
Of course, it will be better if one can manage these configuration files with rpm or deb package system. For me it's just a temporary solution to use pip here.

CPACK embed text files

I want to distribute a gzipped tarball containing a program binary.
No problem making a package containing the binary plus additional script/man files because these are files I install with CMake INSTALL command during a source installation.
While the need for such a functionality seems quite obvious to me, I didn't find a way to include text files in CPack tarball packages.
Here is an example of the final tarball I'd like to get:
myprogram-1.0.0rc-Darwin-i386/
├── LICENSE <- not installed by CMake
├── INSTALL <- not installed by CMake
├── README <- not installed by CMake
├── bin
│   └── myprogram
└── share
└── myprogram
└── man
   └── man1
    └── myprogram.1
Any help would be very much appreciated.
Cheers
You can use install too with FILES or DIRECTORY option.
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt DESTINATION .)