Chisel dies on symlink when run for second time

未关闭
#5 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
cli

调研方向

首先使用版本 2b260842c9c,通过 slices/libkeyutils1.yaml 和所示的两个 chisel cut 命令重现该问题。跟踪 output/lib/x86_64-linux-gnu 中现有符号链接的 chisel cut 提取路径。在未更改的输出目录上重新运行该命令并成功,且不改变结果,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Chisel version: 2b260842c9c

Currently chisel cannot be run repeatedly on already populated output directory when there are symlinks. IOW chisel run is not idempotent.

Example slice (libc6_libs dependency omitted for brevity):

$ cat slices/libkeyutils1.yaml 
package: libkeyutils1

slices:
  libs:
    contents:
      /lib/x86_64-linux-gnu/libkeyutils.so.*:

First run is OK:

$ mkdir output
$ chisel cut --release . --root output/ libkeyutils1_libs
...
2022/06/03 12:16:25 Extracting files from package "libkeyutils1"...
$ tree --noreport -p output/
[drwxrwxr-x]  output/
└── [drwxr-xr-x]  lib
    └── [drwxr-xr-x]  x86_64-linux-gnu
        ├── [lrwxrwxrwx]  libkeyutils.so.1 -> libkeyutils.so.1.9
        └── [-rw-r--r--]  libkeyutils.so.1.9

Second run fails (no changes in output/):

$ chisel cut --release . --root output/ libkeyutils1_libs
...
2022/06/03 12:17:03 Extracting files from package "libkeyutils1"...
error: cannot extract from package "libkeyutils1": symlink libkeyutils.so.1.9 output/lib/x86_64-linux-gnu/libkeyutils.so.1: file exists
主要语言
Go
星标
434
派生
74
平均合并
1 天 30 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

canonical/chisel 的其他 Issue

查看 canonical/chisel 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。