perkeep/pkg/osutil
mpl 668ca69967 pkg/osutil: remove dependency on pkg/env
pkg/osutil started depending on pkg/env in
c55c8602d3 , when we added
DefaultLetsEncryptCache(), because it behaves differently whether we're
on GCE or not.

This in turn made pkg/osutil depend on
cloud.google.com/go/compute/metadata and a couple of others. This, in
itself, was not so bad since the main user of pkg/osutil,
server/camlistored already depends on all these same dependencies
anyway.

However, pkg/types/camtypes depends on pkg/osutil (although maybe it
shouldn't) because it calls osutil.UserClientConfigPath() for an error
message.

And finally, in app/publisher/js - which is some Go code meant as input
for gopherjs, so that it gets compiled into javascript that we include
in the publisher web page - we depend on pkg/types/camtypes for some
search query results.

So as of c55c8602d3, we "leaked" a couple
of additional and unnecessary dependencies into the gopherjs generated
code. That made the minified output unnoticeably grow, and apparently
had no other adverse effect, so we didn't notice.

That is, until we landed b0b6a0a89e, which
updated a ton of vendored dependencies, most of them in
cloud.google.com/go and google.golang.org/api. And interestingly, the
update made cloud.google.com/go/compute/metadata depend on a lot of
these other dependencies. This had two noticeable consequences:

1) The (unminified) generated js code grew from 6.1M to 8.2M, which in
itself is super bad already.

2) The js code actually stopped working. For some reason (that I can't
explain, and will probably leave to the GopherJS devs if they're
interested), the members/functions that we export to the javascript
namespace with gopherjs (typically with a
js.Global.Set("ExportedNameForFoo", FooFunc)), are not visible anymore,
which of course breaks everything.

Therefore, this CL fixes this issue by simply doing what we knew we
should have done from the start:

we now let pkg/osutil/gce (which already depends on pkg/env) itself
register a LetsEncryptCacheFunc into pkg/osutil, which removes the need
for pkg/osutil to depend on pkg/env.

Change-Id: Ie8f33e9cb873919dd1728068dd8a5d0170282f88
2017-01-18 01:23:34 +01:00
..
gce pkg/osutil: remove dependency on pkg/env 2017-01-18 01:23:34 +01:00
cpu.go osutil: add CPUUsage function 2013-11-30 11:59:36 -08:00
cpu_freebsd.go pkg/osutil: add FreeBSD CPU usage. 2014-07-04 20:00:00 -07:00
cpu_linux.go osutil: add CPUUsage function 2013-11-30 11:59:36 -08:00
findproc_appengine.go osutil: fix typo in build tag 2013-08-02 21:23:55 +02:00
findproc_normal.go integration tests: kill camlistored when all tests are done 2013-08-02 15:42:49 +02:00
mem.go osutil: add MemUsage func 2014-01-26 21:56:16 -08:00
mem_unix.go osutil: add MemUsage func 2014-01-26 21:56:16 -08:00
openurl.go
osutil.go add canonical import paths 2016-03-13 19:57:14 -07:00
paths.go pkg/osutil: remove dependency on pkg/env 2017-01-18 01:23:34 +01:00
paths_test.go pkg/jsonconfig: remove dependence on pkg/osutil 2015-12-01 00:43:39 +01:00
restart_freebsd.go Fix compilation on FreeBSD. Thanks to retzkek. Fixes Issue 168. 2013-07-02 22:12:53 -07:00
restart_stub.go osutil: fix Windows build 2016-05-16 14:31:55 +02:00
restart_unix.go pkg/osutil: add arguments to RestartProcess 2016-05-09 16:18:39 +02:00
restart_windows.go osutil: fix Windows build 2016-05-16 14:31:55 +02:00
syscall.go pkg/blobserver/localdisk: gate tmp file creations 2016-08-17 18:24:30 +02:00
syscall_appengine.go pkg/blobserver/localdisk: gate tmp file creations 2016-08-17 18:24:30 +02:00
syscall_posix.go pkg/blobserver/localdisk: gate tmp file creations 2016-08-17 18:24:30 +02:00
syscall_solaris.go pkg/blobserver/localdisk: gate tmp file creations 2016-08-17 18:24:30 +02:00
syscall_windows.go pkg/blobserver/localdisk: gate tmp file creations 2016-08-17 18:24:30 +02:00