Use pkg_tar to flatten tar files
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- build-system
Línea de trabajo
Start by reproducing the issue with the two archives and the shown pkg_tar(name = "flatten", deps = ["file1.tar", "file2.tar"]) invocation, then compare tar listings and extracted trees. Investigate how pkg_tar combines archive entries, especially the symlink /bin and the later ./bin/ directory; done means the flattened archive extracts with /bin still pointing to ./usr/bin and the file available through that link.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I tried pkg_tar to flatten the tar files:
I created 2 test tar files:
gfrankliu@gfrankliu /tmp/test $ tar tvf file1.tar
lrwxrwxrwx gfrankliu/primarygroup 0 2024-06-21 17:30 bin -> ./usr/bin
drwxr-xr-x gfrankliu/primarygroup 0 2024-06-21 17:30 usr/
drwxr-xr-x gfrankliu/primarygroup 0 2024-06-21 17:30 usr/bin/
gfrankliu@gfrankliu /tmp/test $ tar tvf file2.tar
-rw-r--r-- gfrankliu/primarygroup 0 2024-06-21 17:11 ./bin/test
If I manually untar file1 and then file2, I get correct result:
gfrankliu@gfrankliu /tmp/test $ tar xf file1.tar
gfrankliu@gfrankliu /tmp/test $ tar xf file2.tar
gfrankliu@gfrankliu /tmp/test $ ls -l
total 28
lrwxrwxrwx 1 gfrankliu primarygroup 9 Jun 21 17:30 bin -> ./usr/bin
-rw-r--r-- 1 gfrankliu primarygroup 10240 Jun 21 17:30 file1.tar
-rw-r--r-- 1 gfrankliu primarygroup 10240 Jun 21 17:31 file2.tar
drwxr-xr-x 3 gfrankliu primarygroup 4096 Jun 21 17:30 usr
gfrankliu@gfrankliu /tmp/test $ ls -l bin/
total 0
-rw-r--r-- 1 gfrankliu primarygroup 0 Jun 21 17:11 test
gfrankliu@gfrankliu /tmp/test $
If I use pkg_tar:
load("@rules_pkg//:pkg.bzl", "pkg_tar")
pkg_tar(
name = "flatten",
deps = [
"file1.tar",
"file2.tar",
],
)
The resulting tar tvf flatten.tar looks like this:
lrwxrwxrwx 434078/89939 0 2024-06-21 17:30 bin -> ./usr/bin
drwxr-xr-x 434078/89939 0 2024-06-21 17:30 usr/
drwxr-xr-x 434078/89939 0 2024-06-21 17:30 usr/bin/
drwxr-xr-x 434078/89939 0 2024-06-21 17:11 ./bin/
-rw-r--r-- 434078/89939 0 2024-06-21 17:11 ./bin/test
If I extract the flatten.tar (tar -xvf ...), I get
gfrankliu@gfrankliu /tmp/flatten $ ls -lR
.:
total 8
drwxr-xr-x 2 gfrankliu primarygroup 4096 Jun 21 17:11 bin
drwxr-xr-x 3 gfrankliu primarygroup 4096 Jun 21 17:30 usr
./bin:
total 0
-rw-r--r-- 1 gfrankliu primarygroup 0 Jun 21 17:11 test
./usr:
total 4
drwxr-xr-x 2 gfrankliu primarygroup 4096 Jun 21 17:30 bin
./usr/bin:
total 0
As you can see, the symlink /bin got deleted, so pkg_tar doesn't seem to create the correct flatten tar file. The exploded directories from if I manually untar file1.tar, file2.tar, vs if I untar the flatten.tar look different.
- Lenguaje dominante
- Starlark
- Estrellas
- 254
- Forks
- 225
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bazelbuild/rules_pkg
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
bazelbuild/rules_pkg#1093 ·
Los mantenedores suelen responder en 1 día
-
Targets rely on implicit `__init__.py` creation, causing rules_python deprecation warningsPosiblemente ocupada @onnosteenbergen-samotics la tomó hace 32 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bazelbuild/rules_pkg#1081 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
design feature-request
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
bazelbuild/rules_pkg#1080 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bazelbuild/rules_pkg#1075 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bazelbuild/rules_pkg#1066 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de bazelbuild/rules_pkg
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
react/react-native#59693 ·
Los mantenedores suelen responder en 2 días
-
python3Packages.certifi: contents() fails decoding NSS bundle when NIX_SSL_CERT_FILE is unsetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
C-untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
swoole/swoole-cli#1092 ·