Fix #29888

Related: [sbt/sbt-native-packager#203](https://github.com/sbt/sbt-native-packager/issues/203)