public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin <cygwin@cygwin.com>
Subject: Re: Why is taskset still not in util-linux?
Date: Sun, 22 Mar 2020 00:10:03 -0400	[thread overview]
Message-ID: <eabf992e-37e0-ffc1-31fb-5a1a575c688e@cs.umass.edu> (raw)
In-Reply-To: <895c7fa2-62af-efce-97d7-9813c5f54e26@cs.umass.edu>

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

Well, I had _thought_ I had done 'cygport install' and run the installed
version, but I seem to have been wrong.  I seem to have manually over-written
the proper (stripped) binary with the wrapper!

Anyway, I've got the whole thing working and offer the attached patches for
"thoughtful consideration".  I have done away with the need to create an empty
or fake /usr/local/include/sys/syscall.h and changed the source of the
relevant programs to conditional #include <sys/syscall.h> on #indef
__CYGWIN__, which sruck me as more legitimate (the file in questions is
patched anyway).  And I improved configure.ac so that the programs controlled
by --enable-schedutils are more independent and can fail individually without
failing the build.  Part of that was subtituting, as a patch to configure.ac,
a check for the sched_getaffinity and sched_setaffinity calls in place of the
check for the corresponding syscall.  The whole builds and installs.  I can
provide the packaged up version (I assume that is the 'dist' hierarchy) if
that would be helpful.

Regards - Eliot

[-- Attachment #2: util-linux.cygport --]
[-- Type: text/plain, Size: 4179 bytes --]

NAME="util-linux"
VERSION=2.33.1
RELEASE=1
CATEGORY="Base"
SUMMARY="Collection of basic system utilities"
HOMEPAGE="https://github.com/karelzak/util-linux/"
SRC_URI="https://mirrors.edge.kernel.org/pub/linux/utils/${NAME}/v${PV_MAJ_MIN}/${NAME}-${VERSION}.tar.xz"
PATCH_URI="
	2.24.2-libintl.patch
	2.25.1-cygwin-include.patch
	2.24.2-agetty.patch
	2.24.2-libblkid-topology.patch
	2.32.1-testsuite.patch
	2.33.1-cygwin-cpuset.patch
	2.33.1-cygwin-cpuset.patch2
	2.33.1-cygwin-ionice.patch
	2.33.1-cygwin-taskset.patch
"

PKG_NAMES="${NAME} libblkid1 libblkid-devel libfdisk1 libfdisk-devel
	   libsmartcols1 libsmartcols-devel libuuid1 libuuid-devel uuidd"
util_linux_CONTENTS="
	--exclude=*.dll --exclude=uuidd*
	bin/*
	sbin/*
	usr/bin/*
	usr/share/bash-completion/
	usr/share/doc/${NAME}
	usr/share/locale/*/*/util-linux.mo
	usr/share/man/man[158]/*
"
libblkid1_CATEGORY="Libs"
libblkid1_SUMMARY="Block device ID library (runtime)"
libblkid1_CONTENTS="usr/bin/cygblkid-1.dll"
libblkid_devel_CATEGORY="Libs"
libblkid_devel_SUMMARY="Block device ID library (development)"
libblkid_devel_CONTENTS="
	usr/include/blkid/
	usr/lib/libblkid.*
	usr/lib/pkgconfig/blkid.pc
	usr/share/man/man3/*blkid*
"
libfdisk1_CATEGORY="Libs"
libfdisk1_SUMMARY="Disk partition table manipulation library (runtime)"
libfdisk1_CONTENTS="usr/bin/cygfdisk-1.dll"
libfdisk_devel_CATEGORY="Libs"
libfdisk_devel_SUMMARY="Disk partition table manipulation library (development)"
libfdisk_devel_CONTENTS="
	usr/include/libfdisk/
	usr/lib/libfdisk.*
	usr/lib/pkgconfig/fdisk.pc
"
libsmartcols1_CATEGORY="Libs"
libsmartcols1_SUMMARY="Tabular data formatting library (runtime)"
libsmartcols1_DESCRIPTION="The libsmartcols library is used for smart
adaptive formatting of tabular data."
libsmartcols1_CONTENTS="usr/bin/cygsmartcols-1.dll"
libsmartcols_devel_CATEGORY="Libs"
libsmartcols_devel_SUMMARY="Tabular data formatting library (development)"
libsmartcols_devel_DESCRIPTION=${libsmartcols1_DESCRIPTION}
libsmartcols_devel_CONTENTS="
	usr/include/libsmartcols/
	usr/lib/libsmartcols.*
	usr/lib/pkgconfig/smartcols.pc
"
libuuid1_CATEGORY="Libs"
libuuid1_SUMMARY="Universally Unique ID library (runtime)"
libuuid1_CONTENTS="usr/bin/cyguuid-1.dll"
libuuid_devel_CATEGORY="Libs"
libuuid_devel_SUMMARY="Universally Unique ID library (development)"
libuuid_devel_CONTENTS="
	usr/include/uuid/
	usr/lib/libuuid.*
	usr/lib/pkgconfig/uuid.pc
	usr/share/man/man3/*uuid*
"
uuidd_CATEGORY="System"
uuidd_SUMMARY="UUID daemon"
uuidd_CONTENTS="
	usr/sbin/uuidd.exe
	usr/share/bash-completion/completions/uuidd
	usr/share/man/man8/uuidd.8*
	var/lib/libuuid/
	var/run/uuidd/
"

BUILD_REQUIRES="
	bison
	gettext-devel
	libcrypt-devel
	libncurses-devel
	libreadline-devel
	zlib-devel
"

CPPFLAGS+=" -D__USE_LINUX_IOCTL_DEFS"

# fsck: e2fsprogs
# ipcrm, ipcs: ipc-utils
# kill, mount: cygwin
# login: login
# su: coreutils
# last, mesg, mountpoint, utmpdump, wall: sysvinit
# others are linux-specific or obsolete
CYGCONF_ARGS="
  --runstatedir=/var/run
  --enable-libuuid
  --enable-libuuid-force-uuidd
  --enable-libblkid
  --enable-libfdisk
  --disable-libmount
  --disable-mount
  --disable-losetup
  --disable-fsck
  --disable-partx
  --enable-uuidd
  --disable-mountpoint
  --disable-fallocate
  --disable-unshare
  --disable-nsenter
  --disable-setpriv
  --disable-eject
  --enable-agetty
  --enable-cramfs
  --enable-bfs
  --disable-fdformat
  --disable-hwclock
  --disable-wdctl
  --disable-switch_root
  --disable-pivot_root
  --disable-ipcrm
  --disable-ipcs
  --disable-tunelp
  --disable-kill
  --disable-last
  --disable-lslogins
  --disable-utmpdump
  --disable-line
  --disable-mesg
  --disable-raw
  --enable-rename
  --disable-vipw
  --disable-newgrp
  --disable-chfn-chsh
  --disable-login
  --enable-nologin
  --disable-sulogin
  --disable-su
  --disable-runuser
  --enable-ul
  --enable-more
  --enable-pg
  --disable-setterm
  --enable-schedutils
  --disable-wall
  --disable-write
  --disable-use-tty-group
  --disable-makeinstall-chown
  --disable-makeinstall-setuid
  SOLIB_LDFLAGS=-no-undefined
"

# prevents bogus .so symlinks
MAKEOPTS+=" libdir=/usr/lib"

KEEPDIRS="/var/lib/libuuid /var/run/uuidd"

[-- Attachment #3: 2.33.1-cygwin-cpuset.patch2 --]
[-- Type: text/plain, Size: 326 bytes --]

--- origsrc/util-linux-2.33.1/lib/cpuset.c	2020-03-21 20:48:54.978830500 -0400
+++ src/util-linux-2.33.1/lib/cpuset.c	2020-03-21 21:21:56.238472500 -0400
@@ -20,7 +20,9 @@
 #include <errno.h>
 #include <string.h>
 #include <ctype.h>
+#ifndef __CYGWIN__
 #include <sys/syscall.h>
+#endif
 
 #include "cpuset.h"
 #include "c.h"

[-- Attachment #4: 2.33.1-cygwin-ionice.patch --]
[-- Type: text/plain, Size: 581 bytes --]

--- origsrc/util-linux-2.33.1/configure.ac	2020-03-21 20:19:20.952384000 -0400
+++ src/util-linux-2.33.1/configure.ac	2020-03-21 20:42:40.640966200 -0400
@@ -2054,8 +2054,13 @@
 )
 
 
-UL_ENABLE_ALIAS([ionice], [schedutils])
-UL_BUILD_INIT([ionice])
+AC_ARG_ENABLE([ionice],
+  AS_HELP_STRING([--disable-ionice], [disable ionice even if schedutils is enabled]),
+  [], [UL_DEFAULT_ENABLE([ionice], [check])]
+)
+
+UL_BUILD_INIT([ionice], [check])
+UL_REQUIRES_BUILD([ionice], [schedutils])
 UL_REQUIRES_SYSCALL_CHECK([ionice],
 	[UL_CHECK_SYSCALL([ioprio_set],
 	  [alpha],	[442],

[-- Attachment #5: 2.33.1-cygwin-taskset.patch --]
[-- Type: text/plain, Size: 1036 bytes --]

--- origsrc/util-linux-2.33.1/configure.ac	2020-03-21 23:12:49.481503500 -0400
+++ src/util-linux-2.33.1/configure.ac	2020-03-21 23:17:20.565468100 -0400
@@ -2052,6 +2052,7 @@
   AS_HELP_STRING([--disable-schedutils], [do not build chrt, ionice, taskset]),
   [], [UL_DEFAULT_ENABLE([schedutils], [check])]
 )
+UL_BUILD_INIT([schedutils])
 
 
 UL_ENABLE_ALIAS([ionice], [schedutils])
@@ -2083,12 +2084,11 @@
 AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
 
 
-UL_ENABLE_ALIAS([taskset], [schedutils])
-UL_BUILD_INIT([taskset])
+UL_BUILD_INIT([taskset], [check])
+UL_REQUIRES_BUILD([taskset], [schedutils])
 UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
-UL_REQUIRES_SYSCALL_CHECK([taskset],
-	[UL_CHECK_SYSCALL([sched_getaffinity])],
-	[sched_getaffinity])
+AC_CHECK_FUNCS([sched_getaffinity sched_setaffinity], [have_schedaffinity=yes],[have_schedaffinity=no])
+UL_REQUIRES_HAVE([taskset], [schedaffinity], [sched affinity functions])
 AM_CONDITIONAL([BUILD_TASKSET], [test "x$build_taskset" = xyes])
 
 

  reply	other threads:[~2020-03-22  4:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 21:46 Eliot Moss
2020-03-04 13:32 ` Mark Geisert
2020-03-16 23:34   ` Mark Geisert
2020-03-19 10:14     ` Eliot Moss
2020-03-19 10:41       ` Marco Atzeri
2020-03-19 23:29       ` Mark Geisert
2020-03-20  5:54         ` Mark Geisert
2020-03-20 10:29           ` Eliot Moss
2020-03-20 21:42             ` Andrey Repin
2020-03-20 13:39           ` Yaakov Selkowitz
2020-03-21  1:46             ` Eliot Moss
2020-03-21  8:37               ` Mark Geisert
2020-03-21 10:24                 ` Eliot Moss
2020-03-21 11:07                   ` Eliot Moss
2020-03-21 13:29                     ` Marco Atzeri
2020-03-21 14:26                     ` Roumen Petrov
2020-03-21 23:13                       ` Eliot Moss
2020-03-22  4:10                         ` Eliot Moss [this message]
2020-03-22  5:20                           ` Eliot Moss
2020-03-24  8:09                           ` Mark Geisert
2020-03-24  8:16                             ` Eliot Moss
2020-03-22 20:09                 ` Yaakov Selkowitz
2020-03-21  4:59           ` Eliot Moss
2020-03-21  8:18             ` Mark Geisert
2020-03-21 16:41               ` Brian Inglis
2020-03-23  9:31                 ` Corinna Vinschen
2020-03-23  9:42                   ` Mark Geisert
2020-03-23 18:48                     ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eabf992e-37e0-ffc1-31fb-5a1a575c688e@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).