Clear user's environment with SETENV and provide MODGO_ENV for adding variables
to environment and MODGO_GOPATH for altering GOPATH.
OK ajacoutot@, jasper@, kspillner@
https://groups.google.com/forum/#!topic/golang-announce/9eqIHqaWvck
"Go's crypto libraries passed certain parameters unchecked to the
underlying big integer library, possibly leading to extremely
long-running computations, which in turn makes Go programs vulnerable to
remote denial of service attacks. Programs using HTTPS client
certificates or the Go SSH server libraries are both exposed to this
vulnerability.
This is CVE-2016-3959 and was addressed by this change:
https://golang.org/cl/21533
Thanks to David Wong for identifying this issue."
without -a, -work and without running things through sed and piping to
shell:
- Install additional packages under /usr/local/go-pkg and include this in
GOPATH when building. Go considers anything under the GOROOT to be part
of the standard library, which introduces various problems. In particular
they do not get rebuilt without the -a flag.
- Using 'go build -a' is unnecessary (at least now that we're not
installing in GOROOT). Furthermore, the semantics of -a have changed
between go1.4 and go1.5. In go1.4 the standard library was excluded from
the -a flag whereas for go1.5 it does mean all dependencies including the
standard library (this was the same for go1.3). However, there is
already blanket 'do not rebuild standard library packages' in place when
the -a flag is NOT specified.
- Avoid -work since it leaves the work directory behind and nothing is
currently cleaning it up.
- Overall, avoid running 'go install -x' and piping the results through
sed and sh. Firstly, 'go install -x' is already running those commands,
then they're being run a second time around via sh. Secondly, there are
cases where replacing GOROOT is incorrect.
ok jasper@ sthen@ kspillner@ czarkoff@
From port-modules(5):
lang/go Adds Go toolchain support. Requires ALL_TARGET to be set
to canonical Go import path of port. (Module sets it
automatically for ports that use GH_ACCOUNT and GH_PROJECT
macros.)
During execution of post-patch target module moves source
code from ${MODGO_SUBDIR} to ${WRKSRC}, subdirectory of
${MODGO_WORKSPACE} - specially-crafted Go workspace located
at ${WRKDIR}/go. During do-build module calls ``go
install'' with GOPATH set to ${MODGO_WORKSPACE}, runs its
output through sed to prevent writes outside WRKDIR sandbox
and sends output to sh(1). During do-install it copies
executables from ${MODGO_WORKSPACE}/bin to ${PREFIX}/bin,
and/or directories ${MODGO_WORKSPACE}/pkg and
${MODGO_WORKSPACE}/src to ${PREFIX}/go, depending on
MODGO_TYPE contents.
Sets BUILD_DEPENDS, RUN_DEPENDS, ALL_TARGET, TEST_TARGET,
ONLY_FOR_ARCHS, SEPARATE_BUILD, and WRKSRC.
Defines:
MODGO_TYPE Type of port. May be any combination of:
bin ordinary binary, which should be
installed to ${PREFIX}/bin,
lib library, which should come with
source code.
Defaults to bin.
MODGO_WORKSPACE Path to Go workspace set up for port build
process. Defaults to ${WRKDIR}/go. See
Go documentation for details.
MODGO_SUBDIR Path to Go source code within port's
sources tarball. Defaults to ${WRKDIST}.
MODGO_SETUP_WORKSPACE
Commands setting up Go workspace for
building ports. By default, happens
during execution of post-patch target.
MODGO_BUILDDEP Controls whether contents of
MODGO_BUILD_DEPENDS are appended to port's
BUILD_DEPENDS. Defaults to Yes.
Additionally defines MODGO_PACKAGES, MODGO_SOURCES and
MODGO_TOOLS (paths for installed Go packages, sources and
tools respectively), MODGO_CMD and MODGO_FLAGS (source code
build command and flags passed as its arguments),
MODGO_BUILD_CMD and MODGO_TEST_CMD (commands for building
and testing go packages; normally called with canonical Go
package names as arguments),
MODGO_{BUILD,INSTALL,TEST}_TARGET and
MODGO_{BUILD,RUN}_DEPENDS.
OK sthen@
the various Sizeof*MsgHdr constants are now incorrect. This results in
various problems when attempting to parse the routing messages. Fix this
by respecting the header length returned from the kernel.
Makes regress pass again...
ok sthen@
Also preserve the timestamps of the source and compiled binaries so that
"go build" does not think installed libraries should be recompiled.
ok jasper@ sthen@
- Fix a bug in the regress tests that may result in the tests being built/run
with the installed binaries rather than the new binaries.
- Fix a bug related to 'go install' trying to rebuild non-writeable $GOROOT
packages, when used with a $GOPATH (issue 4106).
- Include the 'misc' part of the package, which contains editor
configuration files, etc.
ok jsg@, sthen@
I was going to add this to the global infrastructure/db/systrace.filter
(which was OK'd by phessler) but realised it makes more sense to
put it here. ok jsing@
Go is an open source programming environment that makes it easy to build
simple, reliable, and efficient software.
With assistance from sthen@
ok sthen@