From b95a6d482c612a646f320b832a98e5e9fd53852e Mon Sep 17 00:00:00 2001 From: Simon Frankenberger Date: Wed, 13 Dec 2023 15:50:00 +0100 Subject: [PATCH] use regular stat() instead of non-standard __xstat64 abi This should fix sbt/sbt#7455 --- build.sbt | 5 +++++ io/src/main/scala/sbt/internal/io/Milli.scala | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 853ce936..e42981af 100644 --- a/build.sbt +++ b/build.sbt @@ -134,6 +134,11 @@ val io = (project in file("io")) exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64FileStat"), exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64Milli"), exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64Milli$"), + // Replaced non-standard __xstat64() with conformant stat() calls + exclude[DirectMissingMethodProblem]("sbt.internal.io.Linux32.*"), + exclude[ReversedMissingMethodProblem]("sbt.internal.io.Linux32.*"), + exclude[DirectMissingMethodProblem]("sbt.internal.io.Linux64.*"), + exclude[ReversedMissingMethodProblem]("sbt.internal.io.Linux64.*"), // protected[this] exclude[DirectMissingMethodProblem]("sbt.io.CopyOptions.copy*"), // private class diff --git a/io/src/main/scala/sbt/internal/io/Milli.scala b/io/src/main/scala/sbt/internal/io/Milli.scala index e9d8398e..178a561c 100644 --- a/io/src/main/scala/sbt/internal/io/Milli.scala +++ b/io/src/main/scala/sbt/internal/io/Milli.scala @@ -205,28 +205,28 @@ private abstract class PosixMilliIntUtim[Interface <: Utimensat[Int]: ClassTag] private class Linux64FileStat extends StatLong(144, 88, 96) private trait Linux64 extends Library with Utimensat[Long] { - def __xstat64(version: Int, filePath: String, buf: Linux64FileStat): Int + def stat(filePath: String, buf: Linux64FileStat): Int } private object Linux64Milli extends PosixMilliLongUtim[Linux64] { protected final val AT_FDCWD: Int = -100 protected final val UTIME_OMIT: Long = (1L << 30) - 2 protected def getModifiedTimeNative(filePath: String) = { val stat = new Linux64FileStat - checkedIO(filePath) { libc.__xstat64(1, filePath, stat) } + checkedIO(filePath) { libc.stat(filePath, stat) } stat.getModifiedTimeNative } } private class Linux32FileStat extends StatInt(88, 64, 68) private trait Linux32 extends Library with Utimensat[Int] { - def __xstat(version: Int, filePath: String, buf: Linux32FileStat): Int + def stat(filePath: String, buf: Linux32FileStat): Int } private object Linux32Milli extends PosixMilliIntUtim[Linux32] { protected final val AT_FDCWD: Int = -100 protected final val UTIME_OMIT: Int = ((1 << 30) - 2) protected def getModifiedTimeNative(filePath: String) = { val stat = new Linux32FileStat - checkedIO(filePath) { libc.__xstat(3, filePath, stat) } + checkedIO(filePath) { libc.stat(filePath, stat) } stat.getModifiedTimeNative } }