Skip to content

cmd/link: does not clean up host link inputs #24704

@ncw

Description

@ncw

What version of Go are you using (go version)?

go version go1.10.1 windows/amd64

Does this issue reproduce with the latest release?

Yes. Haven't tried tip.

What operating system and processor architecture are you using (go env)?

I'm running this on Windows 2016 Server, but I've see the same issue on Windows 7 too.

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GORACE=
set GOROOT=C:\tools\go
set GOTMPDIR=
set GOTOOLDIR=C:\tools\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\2\go-build231439986=/tmp/go-build -gno
-record-gcc-switches

What did you do?

Compile this very simple cgo program - a directory called go-link-XXXXX is left behind in %TEMP%.

image

Programs which do not use cgo leave nothing behind in %TEMP%.

What did you expect to see?

I expected go to clean up after itself.

What did you see instead?

A left over directory in %TEMP%. Inside it is a single file

image

I noticed this because I left my machine running go test in a loop overnight and it filled the disk up!

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions