Getting packages for GO language - go

The below command is taking ages with no output or anything, is there an alternative way to download packages for go language.? I am new to golang.
go get -u github.com/gogits/gogs/
PS: my net connection is not that slow, downloading through git takes around 1 min, but i can't individually do that for all dependencies.
Edit 1: Small packages like go get github.com/tools/godep downloads and install flawlessly, i have the problem only with github.com/gogits/gogs/ . Its stuck there for an hour. Even a download progress would have been helpful.

go get command is working but its terribly slow for packages that have lots of dependencies. the -v flag(not in doc) helped me to get a verbose output of what is happening.
Took almost an hour to finish. Culprit might possibly be github or my ISP.
Verbose output should had made default by the developers.
*sorry for my English.

You can use GoDep which is a powerful Go dependency manager: https://github.com/tools/godep
GoDep also helps you to have a predictable build since it freezes dependencies in your app
Very easy to get started, just follow instruction on its Github page.

Related

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.

if packagist says master build failing, If I install package with composer, will it work?

I'm kinda new to using composer (but I think it is awesome) so please pardon the noob question.
Folks are requesting exports fancier than csv so I thought I'd install phpOffice excel using composer. But, the master is 'build failing' and the develop is 'build error'. An I correct in assuming the master build failed means I should not install this with composer because it won't work?
In researching this I also found phpOffice spreadsheet, but that appears to be in development still.
Any other alternatives if I cannot use phpOffice excel due to the build status issue?
Regardless of what package you are talking about, if the builds for any of the branches are failing it just means that the builds for any of the branches are failing, that's it.
The master and develop branches may be well ahead of the latest tag, and chances are the maintainers are experimenting with it, and working towards a passing build again.
If you trust the maintainers not to release broken software, then it's safe to use one of the tagged versions, so for example, run
$ composer require phpoffice/phpexcel:^1.8.1
to install the latest stable version.
Note It appears that phpoffice/phpexcel:1.8.1 has been released on 2015-05-01; quite some time has passed since. Whether or not this package works for you, then, is something you have to find out for yourself.
For reference, see:
https://packagist.org/packages/phpoffice/phpexcel

How to improve Golang compilation speed?

I'm trying to find a way to make the compilation of a Go program faster. It is currently about 30 seconds, which makes it slow to work with the project.
When I run go build -v, I see that most of the time is spent compiling go-sqlite3 (which links to the C sqlite lib). However, since this lib never changes, I'm wondering if it's possible to prevent the build tool from recompiling this every time?
Try go install -a github.com/mattn/go-sqlite3 which will install the compiled-against-Go-1.3 package into your $GOPATH.
Right now, you likely have an older version installed under $GOPATH/pkg/ and therefore Go is recompiling it for every build.
This is likely due to you upgrading to go 1.3
I had to remove $GOPATH/pkg to get rid of old (incompatible) binaries
and then it was able to cache compilation results again
In Go 1.10 no need to run go install etc. Just use go build. The new version uses a build cache to determine which packages need to be re-compiled.
Check out: https://tip.golang.org/doc/go1.10

Sage cell installation not working, extreme frustration

I have spent all day trying to install the Sage Cell package and have been quite frustrated. I have been following the instructions at:https://github.com/sagemath/sagecell
Seems pretty reasonable, huh?
First problem occurred at step 4, in the "UPDATE:" that requires a git pull. After attempting the git-pull many times, and googling the error I was getting, which was: fatal: https://github.com/ipython/ipython/pull/4195/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
It seemed to be that either the pull had been deleted or I somehow didn't have permissions to get it. However, the instructions on the site: http://sage.math.washington.edu/home/jason/sagecell/README.html don't have the UPDATE so I figured I'd go ahead and attempt the install anyways. I ran ./sage -i http://sage.math.washington.edu/home/jason/sagecell-spkg/sagecell-2014-03-01.spkg and got a long, winded error which looks something like this:
Note: Bypassing https://pypi.python.org/simple/backports.ssl_match_hostname/ (disallowed host; see http://bit.ly/1dg9ijs for details).
Note: Bypassing https://pypi.python.org/simple/backports.ssl-match-hostname/ (disallowed host; see http://bit.ly/1dg9ijs for details).
Couldn't find index page for 'backports.ssl_match_hostname' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Note: Bypassing https://pypi.python.org/simple/ (disallowed host; see http://bit.ly/1dg9ijs for details).
No local packages or download links found for backports.ssl-match-hostname
error: Could not find suitable distribution for Requirement.parse('backports.ssl-match-hostname')
Error installing tornado-3.2.tar.gz.
real 0m8.891s
user 0m2.315s
sys 0m0.933s
************************************************************************
Error installing package sagecell-2014-03-01
Followed by contact info for sage, who I have also emailed but am hoping for a response here as well.
I can't answer all this, but I am pretty sure that Sage currently has Ipython 1.2 or so, and Sage 6.3 will have Ipython 2.1 or so. My suspicion is hence that those steps are more than unnecessary.
Edit: However, this doesn't seem to be the cause of the backport error message... See this sage-devel thread:
I had to do
./sage -sh -c "easy_install backports.ssl-match-hostname"
before installing the package - this way this thing is downloaded and
installed, while during installation of the package extra downloads
are prohibited.
The Sage Cell installation instructions are in a state of flux as we transfer maintainership over to Andrey Novoseltsev. Before that, the best way to understand how to install the cell server was to use/mimic the shell scripts I used to install the public server (in the contrib/vm directory) because these shell scripts changed sometimes daily, and my focus was on pushing the main server forward.
Andrey is working on the install process now, and said (in response to hearing about this stackexchange post): "This is definitely my project for this week. I can't promise a particular date time since I have some other things going on, but I'll make sure that install of sagecell.sagemath.org is documented in the way it can be repeated and all others are either removed or marked clearly as not tested/working. Thank you for keeping track of things!"

Heroku timeout with custom Buildpack

I have a custom Heroku Buildpack that compiles CMake and OpenCV. The problem is, OpenCV takes FOREVER to compile. I've tried precompiling OpenCV and pulling it in during my build; however, I have not yet been successful in doing so.
I recently came across the COMPILE_TIMEOUT=n env variable that can be set to override the 15 minute timeout, but it's not working. Does anyone know if this env is still supported? Or if there is another approach besides precompiling?
I would ideally like to have the flexibility of compiling on the fly if I update to the latest version of OpenCV (compilations are cached on Heroku so I'm not waiting around for a full build on every deploy).
I think your best shot would be to build your binaries beforehand. However, Heroku still doesn't have great support for this.
See these links for some suggestions:
https://discussion.heroku.com/t/compiling-a-custom-binary-for-buildpack/224
https://discussion.heroku.com/t/opencv-and-statically-compiled-python/105
Pre-compiling binaries is the way to go; however, it requires time and effort that I'd rather avoid. I reached out to Heroku and they were willing to increase our build time to 30 minutes. Unfortunately, 30 minutes was still not enough to compile OpenCV. The Heroku team was kind enough to Anvil which happens to be the same build service that runs on Heroku. Looks promising!
https://github.com/ddollar/heroku-anvil

Resources