Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-unix-compat for openSUSE:Factory checked in at 2025-04-04 17:30:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-unix-compat (Old) and /work/SRC/openSUSE:Factory/.ghc-unix-compat.new.1907 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unix-compat" Fri Apr 4 17:30:51 2025 rev:31 rq:1266979 version:0.7.4 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-unix-compat/ghc-unix-compat.changes 2025-01-28 16:41:24.283611376 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-unix-compat.new.1907/ghc-unix-compat.changes 2025-04-04 17:31:11.073187873 +0200 @@ -1,0 +2,10 @@ +Thu Mar 27 16:33:55 UTC 2025 - Peter Simons <psim...@suse.com> + +- Update unix-compat to version 0.7.4. + ## Version 0.7.4 (2025-03-27) + + - Add `wasm32-wasi` support + ([PR #16](https://github.com/haskell-pkg-janitors/unix-compat/pull/16)). + - Tested with GHC 8.0 - 9.12. + +------------------------------------------------------------------- Old: ---- unix-compat-0.7.3.tar.gz unix-compat.cabal New: ---- unix-compat-0.7.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-unix-compat.spec ++++++ --- /var/tmp/diff_new_pack.QrfID7/_old 2025-04-04 17:31:12.129231863 +0200 +++ /var/tmp/diff_new_pack.QrfID7/_new 2025-04-04 17:31:12.133232031 +0200 @@ -20,13 +20,12 @@ %global pkgver %{pkg_name}-%{version} %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.7.3 +Version: 0.7.4 Release: 0 Summary: Portable POSIX-compatibility layer License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-base-devel BuildRequires: ghc-base-prof @@ -82,7 +81,6 @@ %prep %autosetup -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ unix-compat-0.7.3.tar.gz -> unix-compat-0.7.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/CHANGELOG.md new/unix-compat-0.7.4/CHANGELOG.md --- old/unix-compat-0.7.3/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,9 @@ +## Version 0.7.4 (2025-03-27) + + - Add `wasm32-wasi` support + ([PR #16](https://github.com/haskell-pkg-janitors/unix-compat/pull/16)). +- Tested with GHC 8.0 - 9.12. + ## Version 0.7.3 (2024-10-11) - Fix `sysmacros.h` include for GNU/Hurd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/cbits/mktemp.c new/unix-compat-0.7.4/cbits/mktemp.c --- old/unix-compat-0.7.3/cbits/mktemp.c 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/cbits/mktemp.c 2001-09-09 03:46:40.000000000 +0200 @@ -41,13 +41,21 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> + +#if defined(__wasm__) +#include <sys/random.h> +#else #include <windows.h> #include <wincrypt.h> -static int random(uint32_t *); +#define open _open +#define stat _stat +#endif + +static int unixcompat_random(uint32_t *); static int _gettemp(char *, int *); -static const unsigned char padchar[] = +static const char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; int unixcompat_mkstemp(char *path) @@ -64,7 +72,7 @@ { char *start, *trv, *suffp, *carryp; char *pad; - struct _stat sbuf; + struct stat sbuf; int rval; uint32_t randidx, randval; char carrybuf[MAXPATHLEN]; @@ -84,7 +92,7 @@ /* Fill space with random characters */ while (trv >= path && *trv == 'X') { - if (!random(&randval)) { + if (!unixcompat_random(&randval)) { /* this should never happen */ errno = EIO; return 0; @@ -104,7 +112,7 @@ for (; trv > path; --trv) { if (*trv == '/') { *trv = '\0'; - rval = _stat(path, &sbuf); + rval = stat(path, &sbuf); *trv = '/'; if (rval != 0) return (0); @@ -120,11 +128,11 @@ for (;;) { if (doopen) { if ((*doopen = - _open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) + open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) return (1); if (errno != EEXIST) return (0); - } else if (_stat(path, &sbuf)) + } else if (stat(path, &sbuf)) return (errno == ENOENT); /* If we have a collision, cycle through the space of filenames */ @@ -154,7 +162,14 @@ /*NOTREACHED*/ } -static int random(uint32_t *value) +#if defined(__wasm__) +static int unixcompat_random(uint32_t *value) +{ + int r = getentropy(value, sizeof(uint32_t)); + return r == 0 ? 1 : 0; +} +#else +static int unixcompat_random(uint32_t *value) { /* This handle is never released. Windows will clean up when the process * exits. Python takes this approach when emulating /dev/urandom, and if @@ -171,3 +186,4 @@ return 1; } +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/include/HsUnixCompat.h new/unix-compat-0.7.4/include/HsUnixCompat.h --- old/unix-compat-0.7.3/include/HsUnixCompat.h 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/include/HsUnixCompat.h 2001-09-09 03:46:40.000000000 +0200 @@ -4,5 +4,3 @@ unsigned int unix_major(dev_t dev); unsigned int unix_minor(dev_t dev); dev_t unix_makedev(unsigned int maj, unsigned int min); - -#define NEED_setSymbolicLinkOwnerAndGroup !HAVE_LCHOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/src/System/PosixCompat/Extensions.hsc new/unix-compat-0.7.4/src/System/PosixCompat/Extensions.hsc --- old/unix-compat-0.7.3/src/System/PosixCompat/Extensions.hsc 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/src/System/PosixCompat/Extensions.hsc 2001-09-09 03:46:40.000000000 +0200 @@ -12,7 +12,7 @@ ) where -#ifndef mingw32_HOST_OS +#if !(defined(mingw32_HOST_OS) || defined(wasm32_HOST_ARCH)) #include "HsUnixCompat.h" #endif @@ -27,7 +27,7 @@ -- -- The portable implementation always returns @0@. deviceMajor :: DeviceID -> CMajor -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) || defined(wasm32_HOST_ARCH) deviceMajor _ = 0 #else deviceMajor dev = unix_major dev @@ -39,7 +39,7 @@ -- -- The portable implementation always returns @0@. deviceMinor :: DeviceID -> CMinor -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) || defined(wasm32_HOST_ARCH) deviceMinor _ = 0 #else deviceMinor dev = unix_minor dev @@ -49,7 +49,7 @@ -- | Creates a 'DeviceID' for a device file given a major and minor number. makeDeviceID :: CMajor -> CMinor -> DeviceID -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) || defined(wasm32_HOST_ARCH) makeDeviceID _ _ = 0 #else makeDeviceID ma mi = unix_makedev ma mi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/src/System/PosixCompat/Files.hsc new/unix-compat-0.7.4/src/System/PosixCompat/Files.hsc --- old/unix-compat-0.7.3/src/System/PosixCompat/Files.hsc 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/src/System/PosixCompat/Files.hsc 2001-09-09 03:46:40.000000000 +0200 @@ -106,11 +106,11 @@ #ifndef mingw32_HOST_OS -#include "HsUnixCompat.h" +#include "HsUnixConfig.h" import System.Posix.Files -#if NEED_setSymbolicLinkOwnerAndGroup +#if !HAVE_LCHOWN import System.PosixCompat.Types setSymbolicLinkOwnerAndGroup :: FilePath -> UserID -> GroupID -> IO () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/src/System/PosixCompat/Process.hs new/unix-compat-0.7.4/src/System/PosixCompat/Process.hs --- old/unix-compat-0.7.3/src/System/PosixCompat/Process.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/src/System/PosixCompat/Process.hs 2001-09-09 03:46:40.000000000 +0200 @@ -8,7 +8,7 @@ getProcessID ) where -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) import System.Posix.Types (ProcessID) import System.Win32.Process (getCurrentProcessId) @@ -16,6 +16,13 @@ getProcessID :: IO ProcessID getProcessID = fromIntegral <$> getCurrentProcessId +#elif defined(wasm32_HOST_ARCH) + +import System.Posix.Types (ProcessID) + +getProcessID :: IO ProcessID +getProcessID = pure 1 + #else import System.Posix.Process diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/src/System/PosixCompat/Temp.hs new/unix-compat-0.7.4/src/System/PosixCompat/Temp.hs --- old/unix-compat-0.7.3/src/System/PosixCompat/Temp.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/src/System/PosixCompat/Temp.hs 2001-09-09 03:46:40.000000000 +0200 @@ -11,13 +11,13 @@ mkstemp ) where -#ifndef mingw32_HOST_OS +#if !(defined(mingw32_HOST_OS) || defined(wasm32_HOST_ARCH)) -- Re-export unix package import System.Posix.Temp #elif defined(__GLASGOW_HASKELL__) --- Windows w/ GHC, we have fdToHandle so we +-- Window/WASM w/ GHC, we have fdToHandle so we -- can use our own implementation of mkstemp. import System.IO (Handle) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.7.3/unix-compat.cabal new/unix-compat-0.7.4/unix-compat.cabal --- old/unix-compat-0.7.3/unix-compat.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/unix-compat-0.7.4/unix-compat.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ -cabal-version: >= 1.10 +cabal-version: 1.18 name: unix-compat -version: 0.7.3 +version: 0.7.4 synopsis: Portable POSIX-compatibility layer. description: This package provides portable implementations of parts of the unix package. This package re-exports the unix @@ -16,9 +16,10 @@ build-type: Simple tested-with: + GHC == 9.12.2 GHC == 9.10.1 - GHC == 9.8.2 - GHC == 9.6.6 + GHC == 9.8.4 + GHC == 9.6.7 GHC == 9.4.8 GHC == 9.2.8 GHC == 9.0.2 @@ -29,7 +30,7 @@ GHC == 8.2.2 GHC == 8.0.2 -extra-source-files: +extra-doc-files: CHANGELOG.md source-repository head @@ -60,17 +61,20 @@ build-depends: Win32 >= 2.5.0.0 && < 3 build-depends: directory >= 1.3.1 && < 1.4 build-depends: filepath >= 1.4.1.0 && < 1.6 - build-depends: time >= 1.6.0.1 && < 1.13 + build-depends: time >= 1.6.0.1 && < 1.15 other-modules: System.PosixCompat.Internal.Time else build-depends: unix >= 2.7.2.0 && < 2.9 - include-dirs: include - includes: HsUnixCompat.h - install-includes: HsUnixCompat.h - c-sources: cbits/HsUnixCompat.c + if arch(wasm32) + c-sources: cbits/mktemp.c + else + include-dirs: include + includes: HsUnixCompat.h + install-includes: HsUnixCompat.h + c-sources: cbits/HsUnixCompat.c if os(solaris) cc-options: -DSOLARIS @@ -89,54 +93,17 @@ LinksSpec ProcessSpec - -- ghc-options: - -- -Wall - -- -fwarn-tabs - -- -funbox-strict-fields - -- -threaded - -- -fno-warn-unused-do-bind - -- -fno-warn-type-defaults - - -- extensions: - -- OverloadedStrings - -- ExtendedDefaultRules - - -- if flag(lifted) - -- cpp-options: -DLIFTED - build-depends: unix-compat , base , monad-parallel - , hspec + , hspec >= 2.5.5 , HUnit , directory >= 1.3.1.0 -- directory-1.3.1.0 adds createFileLink , extra , temporary - if os(windows) - -- c-sources: - -- cbits/HsUname.c - -- cbits/mktemp.c - - -- extra-libraries: msvcrt - -- build-depends: Win32 >= 2.5.0.0 - build-depends: time - build-depends: directory - - -- other-modules: - -- System.PosixCompat.Internal.Time - - else - -- build-depends: unix >= 2.4 && < 2.9 - -- include-dirs: include - -- includes: HsUnixCompat.h - -- install-includes: HsUnixCompat.h - -- c-sources: cbits/HsUnixCompat.c - if os(solaris) - cc-options: -DSOLARIS - default-language: Haskell2010 ghc-options: -Wall