Hacker News 中文摘要

RSS订阅

macOS 27 Golden Gate 中 hdiutil 已弃用 -- hdiutil is deprecated in macOS 27 Golden Gate

文章摘要

macOS 27 Golden Gate测试版中,命令行工具hdiutil已被弃用,所有磁盘映像操作需改用diskutil image,后者支持ASIF格式并保留大部分功能,但部分选项如-puppetstrings缺失。

文章总结

在macOS 27 Golden Gate版本中,命令行工具hdiutil已被标记为弃用,苹果建议用户改用diskutil image来处理所有磁盘映像操作。diskutil image支持附加、创建、调整大小、信息和更改密码等子命令,并支持苹果稀疏映像格式(ASIF),而hdiutil不支持该格式。hdiutil的大部分选项在diskutil中得以保留,但名称有所变化,不过部分选项缺失,例如-puppetstrings(用于提供易于解析的进度输出)以及hdiutil create -srcfolder的一些特定选项(如-crossdev-scrub-anyowners等)。

作者通过实际测试对比了两者的性能:使用hdiutil备份用户主文件夹平均耗时110至115秒,而diskutil仅需40至45秒,速度显著提升。此外,diskutil生成的磁盘映像文件更小(2.8 GB对比2.89 GB)。然而,diskutil存在一些问题:它不会像hdiutil那样触发身份验证提示以处理根用户拥有的文件,导致操作失败;其详细日志输出不足;并且默认行为类似于启用了hdiutil-scrub选项(跳过临时文件,如~/.Trash/文件夹)。作者建议苹果改进diskutil的详细日志记录、处理文件权限问题,并添加-[no]scrub选项。

最后,作者质疑为何要弃用hdiutil,因为其功能将在diskutil中延续,但苹果似乎有意打破长期的工作流程和脚本。此外,两个工具在Golden Gate版本中仍存在一个已知错误(涉及.bnnsir文件),苹果对此问题的处理方式令人失望。

评论总结

根据评论内容,主要观点和论据总结如下:

1. 对hdiutil废弃的普遍不满与质疑 - 评论者认为Apple废弃hdiutil会破坏长期工作流和脚本,且缺乏向后兼容性(评论3:Brother, it’s Apple. Any backwards compatibility is purely incidental.) - 有用户担心ram disk创建功能也随之废弃(评论9:So I guess ram disks are deprecated too? AFAIR hdiutil was the only way to create them)

2. 对Apple开发工具和反馈机制的批评 - 用户反馈Bug时遭遇敷衍,Apple要求提交iOS sysdiagnose处理macOS问题(评论7:No one looked at your repro steps... They're just looking to cull the bug list.) - 反馈系统Radar/Feedback令人疲惫,用户被反复要求提供诊断数据却得不到回应(评论8:Dealing with Apple's labyrinth maze that is Radar/Feedback is an exhausting nightmare... I gave up attempting to engage with it years ago.)

3. 对Apple废弃旧工具的历史模式观察 - 有评论指出Apple曾未警告就移除Telnet客户端等工具(评论4:Pepperidge Farm remembers when they removed the Telnet client... and didn't warn anyone.) - 部分用户认为这是正常的技术进步(评论6:Totally normal. March of progress. Old stuff goes away.)

4. 对hidutil命运的担忧 - 有用户误读标题为hidutil而紧张(评论5:I read this as hidutil and had a mini heart attack.) - 评论者认为hidutil不会消失,但Apple可能不再更新(评论2:I highly doubt hidutil will ever disappear from macOS. Apple just won't really update it anymore)

5. 对Xcode分发格式的关联讨论 - 指出xip已废弃多年却仍是Xcode分发格式,暗示Apple对旧工具的态度矛盾(评论2:Given xip has been deprecated for a long time now, yet still is the format Xcode is distributed in)