can not get gorose 2.0 from github - go

My go version is 1.16, local OS is Windows.
I need to use gorose package. When I use the command
go get -u github.com/gohouse/gorose/v2at goland terminal, it shows
go get: github.com/gohouse/gorose/v2#none updating to
github.com/gohouse/gorose/v2#v2.1.10 requires
github.com/gohouse/golib#v0.0.0-20200727025018-43fec7d17e79 requires
github.com/gohouse/e#v0.0.3-rc.0.20200724104652-25ebf8c9c305: invalid pseudo-version: preceding tag (v0.0.3-rc) not found
Anyone can give me a method to solve this problem, thanks.

It appears that github.com/gohouse/e has removed the v0.0.3-rc tag from their repository, so the pseudo-version based on that tag is no longer valid. (Go modules have a strong expectation that maintainers do not delete tags that have already been published.)
One way to work around this problem is to exclude the invalid version, which will cause dependencies on it to be ignored within your module. To do that, add this line to your go.mod file:
exclude github.com/gohouse/e v0.0.3-rc.0.20200724104652-25ebf8c9c305
Then when you go get github.com/gohouse/gorose/v2 it will re-resolve any missing dependencies on package github.com/gohouse/e using the current latest version of that module.
Another way to work around this problem is to obtain a cached copy of v0.0.3-rc.0.20200724104652-25ebf8c9c305 from a Go module proxy. It appears that that version may be cached by proxy.golang.org, which you can use by setting GOPROXY to proxy.golang.org,direct (or unsetting it entirely, since that's the default for most distributions of the go command) in your environment.
If you have set GOPRIVATE and/or GONOPROXY, you may also need to adjust those variables to ensure that they are not bypassing the proxy for github.com/gohouse/e.
Finally, the ideal long-term solution is to fix these dependencies upstream, so that the module dependency graph includes only valid versions to begin with. You could:
file an issue against the github.com/gohouse/e module requesting that they restore the deleted tags, or
send a PR to github.com/gohouse/golib to update the requirement in their go.mod file to a version that is still valid, then send a PR to github.com/gohouse/gorose to update its dependency on golib to the version containing the fix.

Related

List or update outdated Go packages with major version update

With go get -u it's possible to update all packages in a Go application that uses go.mod. However, there's a convention in Go that the package name gets updated for a major version when there are breaking changes.
For example "github.com/ahmetb/go-linq" changes in "github.com/ahmetb/go-linq/v2" after an update with breaking changes.
How can I detect if any of the packages I use updated their major version?
This has an open proposal that is on hold.
From that thread you may want to use gomajor and see if it works for you.

Xamarin.Build.Download.targets - invalid Id

I cannot build the project after adding Xamarin.Firebase.Functions nuget (v120.0.0) . The error message is:
Xamarin.Build.Download.targets(3,3): Error XBD020: Invalid item ID firebaseappcheckinterop-16.0.0-beta01
What can it be? I already tried the usual things like deleting the bin/obj folders, rebuilding, restarting, installing different versions of Xamarin.Build.Download. No idea where to even start investigating this issue.
I believe this is happening due to the Xamarin.Build.Download package doing some aggressive package id format checking. It doesn't like that -beta01 postfix.
More details at the issue I opened on GitHub: https://github.com/xamarin/XamarinComponents/issues/1293
For an immediate solution, I suggest either:
Downgrade to a version of Xamarin.Firebase.Functions that does not include a preview package as a transitive dependency
Fork the XamarinComponents repo and remove or modify the id check (as detailed in the above linked github issue). Ideally this would be a band-aid fix until a newer version of Xamarin.Build.Download allows for this situation or newer a version of Xamarin.Firebase.Functions doesn't depend on a preview dependency.
I am facing same issue with the -beta01 suffix, so I downgraded Xamarin.Firebase.Functions to 119.2.0 in order to use the package, which works.
I wonder why Google puts experimental feature dependencies in stable package...

Issue with using a modified version of a Go dependency

So here is the situation:
I have a fork of go-ipfs. It depends on go-ipfs-config. I need to modify go-ipfs-config and make go-ipfs depend on my modified version.
I forked the go-ipfs-config made my changes and made sure to update the path to be that of my forked version as can be seen here. I confirmed that this still builds successfully by running go build
Then I updated go.mod in go-ipfs to use my modified version. I used the replace directive to signify this intention which can be seen here
This is where things gets absolutely bunkers and I am no longer sure what is going on.
When i do go mod tidy to fetch the dependency i get the following output:
go: finding module for package github.com/dadepo/go-ipfs-config
go: found github.com/dadepo/go-ipfs-config in github.com/dadepo/go-ipfs-config v0.5.3
The crazy thing is that v0.5.3 does not exist in github.com/dadepo/go-ipfs-config!
Also the following line get added to go.mod :
github.com/dadepo/go-ipfs-config v0.5.3 // indirect
Which can even be seen here
I have run commands like go clean -modcache and go clean -r etc but does not seem to fix things!
Does anybody know what I am doing wrong? And also how to achieve the goal of making my version of a project depend on another modified version of its dependency?
Ok, so this is as a result of me not being aware of couple of things going on in the Go lang toolchain.
Apparently https://proxy.golang.org is a thing! It is a service operated by google that caches modules. So If you made a release, deleted it, chances are that the version is already cached in https://proxy.golang.org. This was exactly what happened in my case. I had made a 0.5.3 release, deleted it, but it is not really gone as the Google cache already got a hold of it.
So in case you are seeing versions that should not exist. This should be the first place you check. This documentation link also sheds some more light on the proxy and how it can be tweaked.
I found this out based on the conversation I had on the issue I opened reporting this behaviour. If you are curious, you can check it out here.

Exclude a package from updating in composer

Whenever I try to add a new package using composer like
"composer require packagename/package" or use "composer.phar update", I am getting all the installed packages updated. Is there any option in composer to exclude some package that I don't need to get updated?
run this command and see what is your package version:
composer show -i
go to composer.json and edit which package you want never change by composer update and write version correctly for that :
"jacopo/laravel-authentication-acl": "1.3.*",
change to :
"jacopo/laravel-authentication-acl": "1.3.11",
Done! now if you run composer update this package not update.
From my experience, the best way to exclude 1 or some packages is to use --interactive in composer update.
$ composer update --interactive
When you do this you can select which package you want to update and skip the package that you don't want to update.
You can supply the name(s) of a one or more packages to update:
composer update vendor1/package1 vendor1/package2 vendor2/*
and this will only update those packages.
This isn't specifically excluding, it's including, but it certainly makes updating specific packages much faster.
To avoid the update on using the require command, you'd could hand-craft the composer.json, (which isn't so hard) then run the above targetted update on the package you just added.
Also use --no-dev to exclude development packages (if you are not developing the packages you are depending on e.g. in production). This also speeds up the dependency analysis.
If you feel the need to exclude some of your packages from being updated, I'd consider this the beginning of getting into a dependency mess. You should clean up your dependencies now before it gets worse.
From my experience, the topmost reason not wanting to update a dependency is when you used a branch of a package instead of a released version. You should try to fix this as thoroughly as possible:
If you are using your own packages, tag a release version for the commits you want to use. Then switch your software to either use that exact version, or use a wildcard version requirement like 1.0.*, ~1.2 or ^1.3.4.
If you are using external code that you cannot influence directly, try to contact the developers of that code and ask them to tag a version. Tagging versions is important to maintain a sane dependency tree.
If you cannot make the external developers tag a version, find a way to tag it yourself:
Clone their repository on Github, tag a version, and include your copy of the repository instead of going to packagist.org.
Create the necessary metadata in a "type=package" repository entry in your composer.json file.
Or at the very least, when depending on the branch, assign it a version alias to allow for a smoother transition later when the external project starts tagging their versions. Note that this will not fix your current problems at all, but it may make things better in the future.
If all else fails, you might point to a certain commit id in your composer.json. This will
In general, you should always be able to run composer update unconditionally. If not, this is a warning sign for dependencies not properly declared in your own composer.json file.
The second reason for not wanting to update is incompatible changes in a package that were tagged as a bug fix instead of a major version increase. The solution for this would be simple:
First you'd have to investigate the reason for such an error: Was it really an incompatible API change? If yes, raise an issue with the developers of that package. They should create a new bug fix version with that incompatible update rolled back or fixed, and if they want to keep their change, they should tag it with a minor or major version increment, depending on what they changed.
If however you incorrectly used their code, somehow not using the public API, a bug fix is unlikely. You should try fixing your code by not using stuff that is not supposed to be the public API. For example, in recent versions of Symfony, the public API is explicitly tagged in the code and documentation - using something else will break at some point, even when doing "compatible" version updates like from 2.6.x to 2.7.x.
Another way to fix it would be to exclude the newer version inside the composer.json file: Instead of "external/package":"~1.2" you'd put "external/package":"~1.2,!1.2.5" if you find that version 1.2.5 broke your software. Or maybe you are afraid of further updates also breaking your software, you'd put in "external/package":"~1.2,!>=1.2.5".
One more thing to add: If you run composer require, you won't get updates for packages that are already installed. They are fixed. The required package will be selected based on all the installed versions, and it will only be installed if there is a version available that is compatible with all the versions already installed. Note that this will not work correctly if there are dependencies on branches of packages in both your own composer.json and the new package. The reason is that the branch name will be the same, but you'll never know which commit was being used. Maybe the new package uses a very recent commit of dev-master of a third package, and your own software a very old one, and there have been incompatible changes in between - this will break things without Composer being able to detect it.
Using composer require packagename/package, you require a new package and you get a partial update for just packagename/package and its dependencies.
composer update packagename/package can be used to trigger the same partial update, but then in case you already have packagename/package in your composer.json.
One workaround is to use replace property, however there isn't dedicated command for that, so you can run composer require foo/bar as usual (which will create composer.json), then add a new replace section for the package to ignore.
Or create composer.json file on your own. Here is the example:
{
"require": {
"radic/tmp-underscore-php": "1.2.0"
},
"replace": {
"patchwork/utf8": "*"
}
}
Once you run composer install, the required package patchwork/utf8 won't be downloaded.

Why IntelliJ Idea cannot find location of GO SDK?

I downloaded go1.4.darwin-amd64-osx10.8.tar.gz and extract it on my local directory.
Based on what Installing to a custom location says I added GOROOT in env variable.
Based on what Test your installation says I created a go file.
I finally ran it and I got expected result as following screenshot.
I actually have IntelliJ v.14 however, based on this article I installed Go Language (golang.org) version 0.9.15.3 in my IntelliJ Idea.
I created a Go project and during creation it asked me to add GO SDK. I gave it ~/Desktop/go/sdk however it wasn't able to recognise it. I got this error in Event Log:
14:03:02 IllegalArgumentException: Argument for #NotNull parameter
'virtualFile' of
com/intellij/openapi/projectRoots/impl/ProjectRootContainerImpl.addRoot
must not be null
Any idea how IntelliJ Idea is able to recognize it would be appreciated. Thanks.
Please consider using one of the alpha releases for 0.9.16. I believe that alpha7 could be the more stable one rather than alpha9. You can get them from GitHub releases
The v1.0.0-alpha0 branch is, as the name implies, an alpha release and it's in the early stages of development, that's why there's no release done yet for it as well.
P.S. I'm one of the contributors to the plugin.
Does not allow to use SDK placed in /usr/local/go (perfectly valid and recent SDK) under Mac Yosemite.
Google App Engine does not recognise last valid GAE GO SDK either.
~Desktop/go/sdk doesn't seems a valid path (as it refers to the homedir of the 'Desktop' user): ~/Desktop/go/sdk should work better.
As long as you see in that ~/Desktop/go/sdk folders the subfolders 'api', 'bin', 'blog', ..., that should be the right one for the GO SDK expected by the "golang support plugin".
Some issues exist with that plugin and IntelliJ 14: issues 1169, PR 1172 (fixed for for 1.0.0-alpha).
The other approach is to recompile and install that plugin.
The end result of specifying the Go SDK path should look like:

Resources