英文:
Why do I get bad file descriptor while running rerun Go package in iTerm2?
问题
我在iTerm2终端中使用一个rerun Go包,并且遇到了一个错误:
> 在读取要监听的文件列表时出错!坏的文件描述符
这个错误来自于filepath.Walk函数。问题是在集成的VSCode终端中一切都正常工作,但在iTerm2中不行。我可以保证配置文件是100%正确的(rerun表示配置有问题,但我们团队已经使用这个配置几年了)。另外,我想提一下,在MacOS的隐私设置中,iTerm2具有完全磁盘访问权限。
非常感谢对我的问题提供任何信息或帮助。
我使用的是macOS Monterey 12.1,M1 Max。
完整错误信息:
rerun -c rerun.json
git/ivp/rer 21:40:28 ☹[PANI] ▶ 在读取要监听的文件列表时出错!坏的文件描述符
panic: 在读取要监听的文件列表时出错!%s
goroutine 1 [running]:
github.com/ivpusic/golog.(*Logger).Panicf(0xc000166100, {0x12024a8, 0x2f}, {0xc00015de98, 0x1e51ff8, 0x18})
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/golog@v0.0.0-20170608213328-28640bee649f/logger.go:315 +0x134
main.(*watcher).start(0xc0001261e0)
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/rerun@v0.0.0-20170331080801-adc8acf1481b/watcher.go:147 +0x2ef
main.main()
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/rerun@v0.0.0-20170331080801-adc8acf1481b/main.go:51 +0x2af
英文:
Im using a rerun Go package in a iTerm2 terminal and getting an error
> Error while reading list of files to listen! bad file descriptor
This error comes from filepath.Walk function. The thing is that everything works fine in integrated VSCode terminal but not in iTerm2. I could guarantee that config file is 100% correct (rerun says that config is incorrect in other way plus we use this config for couple years in a team). Also I would like to mention that iTerm2 has a Full Disk Access in the MacOS privacy settings.
Would be so thankful for any info or help regarding my problem.
Im on macOS Monterey 12.1, M1 Max.
Full error:
rerun -c rerun.json
git/ivp/rer 21:40:28 ☹[PANI] ▶ Error while reading list of files to listen! bad file descriptor
panic: Error while reading list of files to listen! %s
goroutine 1 [running]:
github.com/ivpusic/golog.(*Logger).Panicf(0xc000166100, {0x12024a8, 0x2f}, {0xc00015de98, 0x1e51ff8, 0x18})
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/golog@v0.0.0-20170608213328-28640bee649f/logger.go:315 +0x134
main.(*watcher).start(0xc0001261e0)
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/rerun@v0.0.0-20170331080801-adc8acf1481b/watcher.go:147 +0x2ef
main.main()
/Users/greenwookez/go/pkg/mod/github.com/ivpusic/rerun@v0.0.0-20170331080801-adc8acf1481b/main.go:51 +0x2af
答案1
得分: 0
同样的问题在默认的Mac OS终端中被复现,所以我决定从头重新安装Mac OS(而不是从旧的Mac迁移,因为它有很多不同的配置),并在.zprofile
中添加unlim -n <大于256>
。希望能对某人有所帮助。
英文:
The same issue was reproduced via default Mac OS terminal so I decided to reinstall Mac OS from scratch (instead of migrating from the old Mac with bunch of different configs) and add an unlim -n <more than 256>
to the .zprofile
. Hopefully it will help someone.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论