devtool upgrade ERROR: recipe is already in your workspace - embedded-linux

I use "devtool" of Yocto, eSDK to create the recipe.
I'd like to upgrade it the source code to build newer version package.
So I did update SRCREV and PV = "0.1+git${SRCPV}" variable but no different source tree is fetched (where SRCREV is pointing to).
I do following
devtool upgrade myrecipe --srcrev 82a02d8585d262d6ab2d9dc335ed2231dc2d7f06
I am getting error
ERROR: recipe is already in your workspace
How to correctly upgrade recipe with devtool (eSDK)?
Thanks for help.
Prior to this:
installed the extensible SDK
created generic recipe by
devtool add myrecipe "specified URI to fetch from"
run build command
devtool build myrecipe
deploy it to target
devtool deploy-target -s myrecipe root#192.168.15.241
after that the package is on target and everything seems OK.
Now I would need to upgrade recipe to the new version of software. I use devtool upgrade for that as described above and I have run into issue.

In a workflow starting with devtool add, devtool upgrade is not intended to be used. If you want to change to build a different revision in this context you would instead simply check it out in the repository (which would be under workspace/sources/myrecipe) using git checkout. When you later come to do devtool finish, devtool should update your recipe to check this revision out when building the recipe normally.

Related

How can I install a specific version of golint for use globally?

I'm trying to create a docker image for use in a build pipeline that has various tools pre-installed for building and testing go projects. One tool we need is golint but I'm struggling to see how to install a specific version of it. The reason I want to lock down the version is to avoid accidental / unwanted / unintended breakages at a later date.
For a start, looking here the versions are not exactly in an easy-to-type format.
Also when I try to use the following command
go get -u golang.org/x/lint/golint#v0.0.0-20181217174547-8f45f776aaf1
I get an error
go: cannot use path#version syntax in GOPATH mode
Googling has so far yielded very few relevant results...
Is what I'm trying to do possible? Many thanks!
You need to be in go module mode to get code of a specific version, since in addition to downloading the code, the version is recorded in the go module file.
The easiest way to do this would be to create an empty directory, run go mod init, which will create a go.mod file.
Then, you can run go get golang.org/x/lint/golint#v0.0.0-20181217174547-8f45f776aaf1, which will add golint at that version to your go.mod file. You can then run go install golang.org/x/lint/golint from within that directory, which will install golint at the version specified into your $GOBIN directory (which defaults to $GOPATH/bin).

Setting up Go environment for creating custom Terraform providers

I am getting a stuck while trying to create a Terraform provider. I have been following the advice given on https://www.terraform.io/docs/extend/writing-custom-providers.html but when I go to build my binaries via Go go build -o terraform-provider-example I get several missing packages errors.
So I then work my way down the list of missing packages and use go get ... to get those packages installed in my Go libraries.
I get an error indicating that github.com/hashicorp/hcl/v2 cannot be found. I navigate to the location and sure enough it doesn't exist.
Package not available at install time screen shot
Package not available with go get
So I am getting stuck and unable to build these providers. I have looked for a while now trying to find something which describes how to setup the environment for creating providers but have been unsuccessful so far. Can anyone help get me going?
Terraform Core and Terraform provider development requires using the Go toolchain in the new "modules mode", which in current versions of Go is not the default.
The easiest way to ensure you're working in modules mode is to clone the repository you want to work on outside the $GOPATH/src directory. Development outside of GOPATH is only supported in Modules mode, and so the Go toolchain assumes that you intend to use modules mode if you are working in that way.
One reason why Terraform development requires modules mode (though not the only one) is that it has a dependency on github.com/hashicorp/hcl/v2, which is a module path type that is not supported in the old GOPATH mode because previously the Go toolchain was only able to install from the master branch of a particular remote dependency in a Git repository. The module path github.com/hashicorp/hcl/v2 is the Go Modules way to specify using the second major version of HCL, whereas github.com/hashicorp/hcl is the first major version.
In modules mode, it should be sufficient to just run go build -o terraform-provider-example (or, if you prefer, go install) and it will automatically fetch the dependencies to the local modules cache and use them from there. In modules mode, go get is for changing the dependencies recorded in go.mod rather than for installing existing dependencies.

In devtool command line tool is finish subcommand removed or replaced?

The only relevant and easy to understand example I found to use devtool in a Yocto Workflow was the Video from Tim Orling in Embedded Linux Conference
In his workflow:
He uses devtool add to add nano
devtool build to build it
devtool deploy-target to deploy it on qemu
devtool undeploy-target to remove nano
devtool finish nano ../meta-foo
I tried doing the same thing but there is no subcommand finish in devtool
when I try devtool finish --help
devtool finish --help
ERROR: argument <subcommand>: invalid choice: 'finish' (choose from 'create-workspace', 'add', 'modify', 'extract', 'sync', 'update-recipe', 'status', 'reset', 'build-image', 'deploy-target', 'undeploy-target', 'build', 'search', 'upgrade', 'edit-recipe', 'configure-help')
What is the equivalent subcommand for devtool finish. Is it devtool reset?
Build Host Environment
Ubuntu 16.04.4 LTS virtual machine
Bitbake version: 1.30.0
devtool information
usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
[--color COLOR] [-h]
<subcommand> ...
OpenEmbedded development tool
optional arguments:
--basepath BASEPATH Base directory of SDK / build directory
--bbpath BBPATH Explicitly specify the BBPATH, rather than getting it
from the metadata
-d, --debug Enable debug output
-q, --quiet Print only errors
--color COLOR Colorize output (where COLOR is auto, always, never)
-h, --help show this help message and exit
subcommands:
Beginning work on a recipe:
add Add a new recipe
modify Modify the source for an existing recipe
upgrade Upgrade an existing recipe
Getting information:
status Show workspace status
search Search available recipes
Working on a recipe in the workspace:
build Build a recipe
edit-recipe Edit a recipe file in your workspace
configure-help Get help on configure script options
update-recipe Apply changes from external source tree to recipe
reset Remove a recipe from your workspace
Testing changes on target:
deploy-target Deploy recipe output files to live target machine
undeploy-target Undeploy recipe output files in live target machine
build-image Build image including workspace recipe packages
Advanced:
create-workspace Set up workspace in an alternative location
extract Extract the source for an existing recipe
sync Synchronize the source tree for an existing recipe
Use devtool <subcommand> --help to get help on a specific command
Krogoth
for krogoth according to the Yocto 2.1.2 Development Manual devtool manual
The created recipes need to be manually placed into the custom meta-foo layer.
For other versions devtool finish recipe-name ../meta-foo should do it for you.

Terraform - Process to Update vendor aws-sdk-go dependencies to latest

Hi I am trying to understand as how to update the aws-sdk-go dependencies for terraform. To do this i have configured the
GOPATH as per instruction given below.
http://www.wadewegner.com/2014/12/easy-go-programming-setup-for-windows/
I have installed and configured "godep" in $path.
So now i am able to run "go" and "godep" from cmd.
as per development terraform section\guideline given at
https://github.com/hashicorp/terraform i have git cloned
it at $GOPATH/src/github.com/hashicorp/terraform
again as per guideline i just want to update aws-sdk-go deps. so i am running
godep update github.com\aws\aws-sdk-go
getting below message on cmd
godep: not in manifest: github.com\aws\aws-sdk-go
godep: Package (github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest) not found
I have also verified that path
D:\Ampush\Projects\GO\src\github.com\hashicorp\terraform\vendor\github.com\Azure\azure-sdk-for-go\Godeps\_workspace\src\github.com\Azure\go-autorest\autorest
exists on my machine.
I am running command from below path
D:\Ampush\Projects\GO\src\github.com\hashicorp\terraform>
Updating this further with more findings
if i run first godep restore -v then it has downloaded many stuffs.
then i figured out that my command was wrong now i updated it to
godep update github.com/aws/aws-sdk-go/aws //hint saw in Godep.json
Now i am getting
godep: no packages can be updated
i guess that somewhere i have to mention as to which version i should update default i was assuming it will take latest from the master.
Could you please let me know if i am missing something. Thanks
godep update will update the vendored version from your global gopath version. To get the latest version in your gopath run something like go get -u github.com/aws/aws-sdk-go then you can run your godep update

golang and godep : Build\install after a golang dependency update when using godep?

I have followed the instructions # https://github.com/tools/godep regarding updating a dependency but when I go to build\install using the altered version it has not been updated within Godeps/_workspace/pkg
So I have
go get github.com/golang/glog
godep save
godep go install
and I can see
The modification timestamp in Godeps/_workspace/pkg/linux_amd64/github.com/golang/glog.a
The rev commit value in Godeps/Godeps.json
but now when I want to update I follow the instructions
go get github.com/golang/glog
godep update github.com/golang/glog
godep go install
I observe the following
The Godeps/Godeps.json rev commit has been updated
Godeps/_workspace/src/github.com/golang/ source is updated
But the file timestamp for odeps/_workspace/pkg/linux_amd64/github.com/golang/glog.a is not updated hence we are using the previous version
I believe I should add a .gitignore entry for pkg and bin, which means we would do a clean build on a fresh git clone
I know I could do a rm -r on both the pkg and bin directories before the godep go install command
Is this expected behavior ?
Thanks in advance
Pat
FYI
Since golang v1.4 I can now use the -a flag for the go install command, since it now longer tries to rebuild the standard library, see the v1.4 release notes section on the change to the build -a flag
Obviously this does not apply in pre v1.4 as it will attempt to rebuild the standard library packages

Resources