Skip to content

Commit 7b30fd0

Browse files
committed
archive/tar: vendor again
Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent cb702f6 commit 7b30fd0

11 files changed

Lines changed: 3024 additions & 0 deletions

File tree

vendor.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,9 @@ github.com/Nvveen/Gotty a8b993ba6abdb0e0c12b0125c603323a71c7790c https://github.
150150
github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18
151151

152152
github.com/opencontainers/selinux b29023b86e4a69d1b46b7e7b4e2b6fda03f0b9cd
153+
154+
155+
# archive/tar (for Go 1.10, see https://github.com/golang/go/issues/24787)
156+
# mkdir -p ./vendor/archive
157+
# git clone -b go-1.10 --depth=1 [email protected]:kolyshkin/go-tar.git ./vendor/archive/tar
158+
# vndr # to clean up test files

vendor/archive/tar/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2009 The Go Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following disclaimer
11+
in the documentation and/or other materials provided with the
12+
distribution.
13+
* Neither the name of Google Inc. nor the names of its
14+
contributors may be used to endorse or promote products derived from
15+
this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

vendor/archive/tar/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
This is a fork of Go 1.10 `archive/tar` package from the official
2+
[repo](https://github.com/golang/go/tree/release-branch.go1.10/src/archive/tar),
3+
with a partial [revert](https://github.com/kolyshkin/go-tar/commit/d651d6e45972363e9bb62b8e9d876df440b31628)
4+
of upstream [commit 0564e304a6ea](https://github.com/golang/go/commit/0564e304a6ea394a42929060c588469dbd6f32af).
5+
It is suggested as a replacement to the original package included with Go 1.10
6+
in case you want to build a static Linux/glibc binary that works, and
7+
can't afford to use `CGO_ENABLED=0`.
8+
9+
## Details
10+
11+
Using Go 1.10 [archive/tar](https://golang.org/pkg/archive/tar/) from a static binary
12+
compiled with glibc on Linux can result in a panic upon calling
13+
[`tar.FileInfoHeader()`](https://golang.org/pkg/archive/tar/#FileInfoHeader).
14+
This is a major regression in Go 1.10, filed as
15+
[Go issue #24787](https://github.com/golang/go/issues/24787).
16+
17+
The above issue is caused by an unfortunate combination of:
18+
1. glibc way of dynamic loading of nss libraries even for a static build;
19+
2. Go `os/user` package hard-coded reliance on libc to resolve user/group IDs to names (unless CGO is disabled).
20+
21+
While glibc can probably not be fixed and is not considered a bug per se,
22+
the `os/user` issue is documented (see [Go issue #23265](https://github.com/golang/go/issues/23265))
23+
and already fixed by [Go commit 62f0127d81](https://github.com/golang/go/commit/62f0127d8104d8266d9a3fb5a87e2f09ec8b6f5b).
24+
The fix is expected to make its way to Go 1.11, and requires `osusergo` build tag
25+
to be used for a static build.
26+
27+
This repository serves as a temporary workaround until the above fix is available.

0 commit comments

Comments
 (0)