Term::Cap full revamp

2023-10-20 Thread Marc Espie
I guess i will probably leave it alone after this. This does quite a few things compared to my former patches. - totally get rid of eval, it doen't make sense anymore - declare variables before they get used, which tends to simplify things. - change quaint formatting to something more BSD like -

better fix for Term::Cap

2023-10-18 Thread Marc Espie
Instead of an archaic limit, just keep track of tc's. This is actually slightly faster, because the termcap links is a tree, not a list. Please test. Index: Cap.pm === RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v

Termp/Cap

2023-10-18 Thread Marc Espie
The max approach is bogus. It happens because the terminal uses tc, and then tc again. The proper approach, especially in perl, is to actually detect a loop, which should be fairly easy by saving the tc that have already been done in a hash.

Re: Don't lock package db if fw_update(8) is not installing firmware

2023-10-14 Thread Marc Espie
On Sat, Oct 14, 2023 at 11:24:08AM -0700, Andrew Hewus Fresh wrote: > While testing another patch, I noticed that fw_update will lock the > package database even if it's just downloading and not touching the > installed packages. > > Currently we do _read_ the existing firmware as part of

Re: Buffer overflow in /usr/bin/deroff

2023-09-19 Thread Marc Espie
On Tue, Sep 19, 2023 at 09:48:25AM -0300, Crystal Kolipe wrote: > deroff chokes when given lines > 2048 bytes, and produces non-deterministic > output on little endian archs. > > Reproducer: > > $ jot -s '' -b blah 513 > /tmp/blah > $ for i in 1 2 3 4 ; do deroff /tmp/blah | md5 ; done >

Re: path: speed-up pkg-config

2023-09-12 Thread Marc Espie
On Mon, Sep 11, 2023 at 09:55:53AM +0200, Marc Espie wrote: > Not to pkgconf levels, but still way faster than what we had > > Updated patch from what I've shown to people, turns out the second grep > wasn't quite working. > > This does cache the set_variables_from_env shennan

Re: ps.1/kvm documentation

2023-09-11 Thread Marc Espie
On Mon, Sep 11, 2023 at 12:10:17PM +0200, Claudio Jeker wrote: > On Mon, Sep 11, 2023 at 11:02:00AM +0200, Marc Espie wrote: > > I was reading through ps.1, which has two slightly different options > > -H Also display information about kernel visible threads. > &

Re: ps.1/kvm documentation

2023-09-11 Thread Marc Espie
t; > -- > Sent from a phone, apologies for poor formatting. > > On 11 September 2023 10:02:32 Marc Espie wrote: > > > I was reading through ps.1, which has two slightly different options > > -H Also display information about kernel visible threads. > >

ps.1/kvm documentation

2023-09-11 Thread Marc Espie
I was reading through ps.1, which has two slightly different options -H Also display information about kernel visible threads. -k Also display information about kernel threads. It's not at all obvious what the difference between these options might be. >From the log:

path: speed-up pkg-config

2023-09-11 Thread Marc Espie
Not to pkgconf levels, but still way faster than what we had Updated patch from what I've shown to people, turns out the second grep wasn't quite working. This does cache the set_variables_from_env shennanigans, speeding up large processing of recursive files by a large factor (since we keep a

Re: unifdef HAS_INLINES in make(1)

2023-09-05 Thread Marc Espie
On Tue, Sep 05, 2023 at 11:51:34AM +1000, Jonathan Gray wrote: > On Mon, Sep 04, 2023 at 11:51:33PM +0200, Marc Espie wrote: > > On Tue, Sep 05, 2023 at 12:04:24AM +1000, Jonathan Gray wrote: > > > inline is part of gnu89 and c99 > > &

Re: unifdef HAS_INLINES in make(1)

2023-09-04 Thread Marc Espie
On Tue, Sep 05, 2023 at 12:04:24AM +1000, Jonathan Gray wrote: > inline is part of gnu89 and c99 > > Index: defines.h > === > RCS file: /cvs/src/usr.bin/make/defines.h,v > retrieving revision 1.15 > diff -u -p -r1.15 defines.h > ---

Re: PATCH: remove "dead code" in make

2023-09-03 Thread Marc Espie
On Thu, Aug 31, 2023 at 08:59:53AM +0200, Marc Espie wrote: > A long time ago, I tried to host our fork of make, in the hope it would get > picked up by other systems. > > Accordingly, some features were added to mimic netbsd's extensions, hidden > behind FEATURES macros.

PATCH: remove "dead code" in make

2023-08-31 Thread Marc Espie
A long time ago, I tried to host our fork of make, in the hope it would get picked up by other systems. Accordingly, some features were added to mimic netbsd's extensions, hidden behind FEATURES macros. Turns out that, for better or for worse, FreeBSD decided to go with NetBSD's fork of bmake,

Re: PATCH: unify VAR!=cmd and other command execution

2023-08-29 Thread Marc Espie
On Mon, Aug 28, 2023 at 10:03:46PM +0200, Theo Buehler wrote: > On Mon, Aug 28, 2023 at 09:18:40PM +0200, Marc Espie wrote: > > On Mon, Aug 28, 2023 at 08:42:50PM +0200, Marc Espie wrote: > > > Turns out the exec in cmd_exec.c has absolutely zero reason to be > > > diff

Re: PATCH: unify VAR!=cmd and other command execution

2023-08-28 Thread Marc Espie
On Mon, Aug 28, 2023 at 08:42:50PM +0200, Marc Espie wrote: > Turns out the exec in cmd_exec.c has absolutely zero reason to be > different from what engine does. > > This small patch moves a bit of code around, so that all execv() consumers > benefit from the same optimisation (n

PATCH: unify VAR!=cmd and other command execution

2023-08-28 Thread Marc Espie
Turns out the exec in cmd_exec.c has absolutely zero reason to be different from what engine does. This small patch moves a bit of code around, so that all execv() consumers benefit from the same optimisation (namely, no extra shell when not needed). The only visible change should be that now,

Re: coping with large shell commands in make(1)

2023-08-26 Thread Marc Espie
On Sat, Aug 26, 2023 at 02:25:19PM -0600, Theo de Raadt wrote: > I did not point you in this direction, not at all. Oh you did. It was not intentional. But I was focused on make variables instead of trying to catch the error, and you redirected me towards execv proper. > I said make execve

coping with large shell commands in make(1)

2023-08-26 Thread Marc Espie
Theo pointed me in another direction Proof of concept that appears to work just fine (very minimal error checking so far) Of course, if we end up running a command on somethin too large, thi will fail as usual, but much to my surprise, make show=_FULL_FETCH_LIST in sysutils/telegraf worked with

POC: variable length in make

2023-08-22 Thread Marc Espie
We've run into a few errors due to very long variable expansion in bsd.port.mk that overflows execve(2) I would consider adding a modifier to give the length of a variable, so that significant tests can be done, along the lines of .if ${VARIABLE:len} > 20 ERRORS += "Fatal: variable may

Re: [diff] selectable curves in smtpd ?

2023-08-12 Thread Marc Espie
On Sat, Aug 12, 2023 at 03:21:00PM +, gil...@poolp.org wrote: > August 12, 2023 4:34 PM, "Theo Buehler" wrote: > > > On Sat, Aug 12, 2023 at 02:29:45PM +, gil...@poolp.org wrote: > > > >> Hello, > >> > >> Someone asked about selectable curves in the OpenSMTPD portable tracker, > >> and

Re: Diff for evaluation (WACOM tablet driver)

2023-08-12 Thread Marc Espie
On Sat, Aug 12, 2023 at 05:22:38PM +0200, Peter J. Philipp wrote: > On Sat, Aug 12, 2023 at 02:27:13PM +, Miod Vallat wrote: > > Third time's (hopefully) the charm. How about that diff? Too much things > > have been removed in uwacom. > > partial success! The wacom driver is recognized, no

Re: Diff for evaluation (WACOM tablet driver)

2023-08-12 Thread Marc Espie
On Sat, Aug 12, 2023 at 08:00:48AM +, Miod Vallat wrote: > I have had a look at your diff and I think it's decent enough to go in > after some polishing. > > Can Wacom tablet users try this cleaned up diff? Works on the target tablet here (Wacom Intuos S)

plans for DISTFILES/MASTER_SITES

2023-08-10 Thread Marc Espie
Now that we got .VARIABLES in make, this is going to be put to great use in bsd.port.mk. Namely, instead of the currently (very clunky) DISTFILES = sometarball:0 MASTER_SITES0 = where to get this I propose we do something like: DISTFILES.site = sometarball MASTER_SITES.site = where to get this

Re: distexpand for autogenerated upstream distfile resources (was: standardize and simplify GitHub submodule handling in ports?)

2023-08-09 Thread Marc Espie
On Wed, Aug 09, 2023 at 12:54:12AM -0400, Thomas Frohwein wrote: > - It includes logic that finds the first MASTER_SITESn that isn't > otherwise used, and throws an ERROR if it overruns past > MASTER_SITES9. That logic will hopefully be soon 100% obsolete. I need some okays on the .VARIABLES

Re: PATCH: a bit of introspection in make

2023-08-08 Thread Marc Espie
Actually, as far as bsd.port.mk, it doesn't need to move too much stuff around thanks to make's lazyness. Note that having a list of defined MASTER_SITES variables simplifies the check. I've also added a check for the right MASTER_SITES to be defined, since currently we do not error out until

Re: PATCH: a bit of introspection in make

2023-08-08 Thread Marc Espie
Here's a revised diff (reordered plus actual use of the boolean) plus concrete example use for bsd.port.mk (disregarding the fact _ALL_VARIABLES would have to move *after* all MASTER_SITES have been defined. Index: var.c === RCS

Re: PATCH: a bit of introspection in make

2023-08-07 Thread Marc Espie
On Mon, Aug 07, 2023 at 10:05:37PM -0400, Thomas Frohwein wrote: > I looked through the file and it seems that varname_list_changed is > never set to anything but true. Is there a bit missing, like down lower > in varname_list_retrieve()? Yep, I removed it at some point because it looked like

PATCH: a bit of introspection in make

2023-08-07 Thread Marc Espie
I think it could be occasionally useful to know which variables have been defined in make. Incidentally, this DOES exist in GNU make, so I've reused the same name for basically the same functionality. I haven't checked whether NetBSD/FreeBSD introduced something similar. This is a fairly

Re: standardize and simplify GitHub submodule handling in ports?

2023-08-06 Thread Marc Espie
On Sat, Aug 05, 2023 at 09:50:57PM -0400, Thomas Frohwein wrote: > On Sat, Aug 05, 2023 at 11:27:24PM +0200, Marc Espie wrote: > > Some comments already. I haven't looked very closely. > > > On Sat, Aug 05, 2023 at 03:12:18PM -0400, Thomas Frohwein wrote: > > > The

Re: standardize and simplify GitHub submodule handling in ports?

2023-08-05 Thread Marc Espie
Some comments already. I haven't looked very closely. On Sat, Aug 05, 2023 at 03:12:18PM -0400, Thomas Frohwein wrote: > The current draft hijacks post-extract target, but it would be easy to > add this to _post-extract-finalize in bsd.port.mk similar to how the > post-extract commands from

Re: Stop using direct syscall(2) from perl(1)

2023-07-19 Thread Marc Espie
On Sun, Jul 09, 2023 at 01:29:58PM -0700, Andrew Hewus Fresh wrote: > Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher > that will call the libc function instead. > > I have to do some work on style before this is ready to commit, but it > should be ready for some testing.

Re: OpenBSD::MkTemp vs Devel::Cover

2023-07-10 Thread Marc Espie
Tl;Dr: I'm not trying too hard to use Devel::Cover but so far it fails abysmally with BOTH pkg_add and dpb. I'll admit that both are playing "fun" games with identity but seriously, Devel::NYTProf didn't care at all ! I've spent a few hours trying to figure out options (loose_perms won't help)

pkg_*: the road forward

2023-07-10 Thread Marc Espie
I spent some time during the last hackathon, talking to various people over where we're going. I'm a bit afraid that people are going to see the ports/package framework as "not invited" (because some of the subsystems of OpenBSD are not exactly oustide friendly) Right now, I got one student

Re: Icky test patches for Devel::Cover and pkg_add

2023-07-08 Thread Marc Espie
real worlds problems :( On Sat, Jul 8, 2023 at 11:27 AM Marc Espie wrote: > > Contrary to the NYT profiler, which works like a charm > Devel::Cover is a tricky beast. > > Right now, I've isolated two issues: > - OpenBSD::MkTemp (subject to a separate mail) > - identity chan

Icky test patches for Devel::Cover and pkg_add

2023-07-08 Thread Marc Espie
Contrary to the NYT profiler, which works like a charm Devel::Cover is a tricky beast. Right now, I've isolated two issues: - OpenBSD::MkTemp (subject to a separate mail) - identity changes on the fly. Even with looseperms, Devel::Cover doesn't cope too well with multiple processes and multiple

OpenBSD::MkTemp vs Devel::Cover

2023-07-08 Thread Marc Espie
Hey, Philip, you wrote this a long time ago. Now, I'm trying to get some coverage out of Devel::Cover on pkg_add, and somehow, it gets in the way. # perl -MDevel::Cover=+select,OpenBSD/.* /usr/sbin/pkg_add random_run Selecting packages matching: OpenBSD/.* Ignoring packages matching:

Re: Diff for evaluation (WACOM tablet driver)

2023-07-05 Thread Marc Espie
On Tue, Jul 04, 2023 at 07:20:51PM -0400, Thomas Frohwein wrote: > Thanks, I built a kernel with this and no issues observed. I have a > Wacom Bamboo (CTH-470, product id 0x00de) that doesn't attach yet, but > this can be left for future work. I don't see anything glaring. hid.c > could probably

Re: Diff for evaluation (WACOM tablet driver)

2023-07-03 Thread Marc Espie
On Mon, Jul 03, 2023 at 03:20:33PM +0300, Matthieu Herrb wrote: > > Index: dev/usb/usbdevs.h > > === > > RCS file: /cvs/src/sys/dev/usb/usbdevs.h,v > > retrieving revision 1.769 > > diff -u -p -r1.769 usbdevs.h > > ---

Re: Diff for evaluation (WACOM tablet driver)

2023-07-03 Thread Marc Espie
I hope Vladimir will find the time to complete this answer. As far as Vlad's work goes, he did a presentation last week-end: https://www.lre.epita.fr/news_content/SS_summer_week_pres/Vladimir_Driver_OpenBSD.pptx (sorry for the medium, fortunately we have libreoffice) In the mean time, here is

Re: pkg_add optional behavior "like syspatch"

2023-07-02 Thread Marc Espie
On Sun, Jul 02, 2023 at 06:06:28PM +0100, Stuart Henderson wrote: > On 2023/07/02 16:49, Solène Rapenne wrote: > > On Sun, 2023-07-02 at 15:51 +0200, Marc Espie wrote: > > > Use-case: some people want to branch automated installs based on > > > whether > > >

Re: pkg_add optional behavior "like syspatch"

2023-07-02 Thread Marc Espie
On Sun, Jul 02, 2023 at 04:49:41PM +0200, Solène Rapenne wrote: > On Sun, 2023-07-02 at 15:51 +0200, Marc Espie wrote: > > Use-case: some people want to branch automated installs based on > > whether > > pkg_add -u (or some other variation) actually did something. > &

pkg_add optional behavior "like syspatch"

2023-07-02 Thread Marc Espie
Use-case: some people want to branch automated installs based on whether pkg_add -u (or some other variation) actually did something. As usual we ignore quirks. This adds a flag (-DSYSPATCH_LIKE) which governs the behavior. Code is fairly self-explanatory. I had no better idea for the flag name

Re: posix_spawn(3): explain that handling NULL envp is an extension

2023-06-26 Thread Marc Espie
On Sun, Jun 25, 2023 at 07:07:33PM -0300, Lucas de Sena wrote: > The manual already describes how posix_spawn(3) behaves when passing it > a NULL envp, but does not make it clear that it is an OpenBSD extension: > > > If envp is NULL, the environment is passed unchanged from the parent > >

Re: pkg-config tweaks

2023-06-05 Thread Marc Espie
A bit more pkg-config tweaks. - I missed two anonymous subs. - somehow I did mangle the flags with respect to --libs-only-other - so I added regress tests for those. - I found out that stuff like --libs-only-l will tend to prepend a space like -lalpha2 turns out the glib2 version of pkg-config

Re: make: slightly better diagnostic

2023-05-28 Thread Marc Espie
Here's a slightly more specific diff avoiding useless stat(2) Index: engine.c === RCS file: /cvs/src/usr.bin/make/engine.c,v retrieving revision 1.70 diff -u -p -r1.70 engine.c --- engine.c25 Oct 2021 19:54:29 - 1.70 +++

Re: make: slightly better diagnostic

2023-05-28 Thread Marc Espie
On Sun, May 28, 2023 at 04:44:37PM +0200, Omar Polo wrote: > On 2023/05/28 13:16:34 +0200, Marc Espie wrote: > > Turns out that, due to the search rules we use, make > > is mostly silent in case it couldn't read a Makefile > > > > The following patch lets it track th

make: slightly better diagnostic

2023-05-28 Thread Marc Espie
Turns out that, due to the search rules we use, make is mostly silent in case it couldn't read a Makefile The following patch lets it track the makefilenames that do exist, but that it wasn't able to open, so that a post-mortem can include these. Not sure if other use-cases could also use the

Re: pkg-config tweaks

2023-05-26 Thread Marc Espie
There was a small typo which broke xenocara, as noticed by tb@ (sidenote: I hate this shitty configure stuff that can't even give you the warning messages from tools that ran. *OF COURSE* it's because so much of that shit talks incessantly even when things are fine) Index: pkg-config

pkg-config tweaks

2023-05-22 Thread Marc Espie
- move to 5.36: signatures + prototypes mostly everywhere Not used for Getopt::Long, because the calling conventions are somewhat too verbose. - use constant for the mode{libs} and mode{cflags} values - remove two completely unneeded [] in regexps - fix indentation and parentheses in a few

Re: cwm: add fvwm and tvm as default wm entries

2023-05-16 Thread Marc Espie
As another rant: we old farts know which window manager we want to use. But for newer users, there might be a chance to find something cool before they get totally fossilized. And secondary rant: X is a failure, in that there is a *choice* of window managers, but so many of them haven't been

Re: cwm: add fvwm and tvm as default wm entries

2023-05-16 Thread Marc Espie
On Tue, May 16, 2023 at 02:33:34AM +, Klemens Nanni wrote: > On Mon, May 15, 2023 at 09:42:47AM -0400, Bryan Steele wrote: > > On Mon, May 15, 2023 at 09:17:00AM -0400, Okan Demirmen wrote: > > > On Mon 2023.05.15 at 10:41 +0200, Matthieu Herrb wrote: > > > > On Mon, May 15, 2023 at 06:26:41AM

Re: converting perl stuff to v5.36

2023-05-09 Thread Marc Espie
On Mon, May 08, 2023 at 01:23:25AM -0400, George Koehler wrote: > On Sun, 7 May 2023 19:21:11 -0700 > Philip Guenther wrote: > > > On Sun, May 7, 2023 at 6:13 AM Marc Espie > > wrote: > > > > > I'm actually wondering whether keeping the prototype is wor

Re: converting perl stuff to v5.36

2023-05-09 Thread Marc Espie
On Sun, May 07, 2023 at 07:21:11PM -0700, Philip Guenther wrote: > Yeah, the downside of signatures is that by default it makes adding > parameters a breaking change and can thus calcify the interface. Something > for authors of shared modules that have callbacks to carefully consider. :/ So

converting perl stuff to v5.36

2023-05-07 Thread Marc Espie
It is generally a good thing, I'm mostly talking about the "signatures" stuff that allows functions with stuff that looks like usual languages. Other benefits include somewhat "cheap" check for correct number of parameters and generally making code shorter. Basically this converts very perlish

Re: spurious error message from signify

2023-04-22 Thread Marc Espie
On Sat, Apr 22, 2023 at 11:02:23AM +0200, Marc Espie wrote: > Well, sdk stumbled upon it > (see docbooks-dsssl-1.79.tgz in snapshots right now) > > Turns out that, if the archive is *exactly* a multiple of 64KB, > we will error out at EOF. > > I believe keeping the

Re: pax: GNU tar base-256 size field support

2023-04-22 Thread Marc Espie
On Tue, Apr 18, 2023 at 08:10:06PM -0600, Todd C. Miller wrote: > I recently ran into a problem with busybox tar generating archives > where the size field is base-256 encoded for files larger than 8GB. > Apparently this is a GNU tar extension. > > Do we want to support this in pax? Below is an

spurious error message from signify

2023-04-22 Thread Marc Espie
Well, sdk stumbled upon it (see docbooks-dsssl-1.79.tgz in snapshots right now) Turns out that, if the archive is *exactly* a multiple of 64KB, we will error out at EOF. I believe keeping the check for short reads and exiting as well for files that do not match 64KB lengths is the right thing to

PKU ?

2023-01-31 Thread Marc Espie
I'm curious about the new enforcement strategies. Unfortunately I'm a bit lost in the 1000+ pages of the intel manual. Could someone point me to the document that describes PKU, specifically ?

Re: Preferred TERM for pkg_add

2023-01-29 Thread Marc Espie
Actual patches to pkg_add (if need be) welcome The switch to not using full term length was actually done at Theo's request. I don't remember the details, but Theo's rationale was quite reasonable and made lots of sense. (specifically, using the full line length would be cool, but there were

Re: OpenBSD perl 5.36.0 - Call for Testing

2023-01-29 Thread Marc Espie
One thing that's going to be very useful IMO is newer function bindings. Us perlers don't really care, matching $@ after the sub is cool. But having off-the-mill function "declarations" that look a lot like function declarations in other more common languages (e.g. sub f($a, $b) ) might help

Re: games: add dots and boxes game

2022-12-14 Thread Marc Espie
On Tue, Dec 13, 2022 at 02:29:22PM +, Stuart Henderson wrote: > On 2022/12/13 14:27, Stuart Henderson wrote: > > On 2022/12/13 14:13, Janne Johansson wrote: > > > Den tis 13 dec. 2022 kl 14:11 skrev Alireza Arzehgar > > > : > > > > I implemented an interesting game. I thought this game is cool

Re: run-regress-* targets in bsd.regress.mk

2022-12-02 Thread Marc Espie
On Fri, Dec 02, 2022 at 02:08:33PM +0100, Theo Buehler wrote: > On Fri, Dec 02, 2022 at 01:52:43PM +0100, Marc Espie wrote: > > On Fri, Dec 02, 2022 at 12:59:02PM +0100, Theo Buehler wrote: > > > I wanted to override some of the default run-regress-* targets by > > >

Re: run-regress-* targets in bsd.regress.mk

2022-12-02 Thread Marc Espie
On Fri, Dec 02, 2022 at 12:59:02PM +0100, Theo Buehler wrote: > I wanted to override some of the default run-regress-* targets by > declaring them in regress Makefiles. Many tests already do that and > it happens to work as expected. > > However, this relies on behavior in the BUGS section of

non regression tests for some packaging scripts

2022-11-14 Thread Marc Espie
I'd like to add some non-regression tests for some scripts, most notably register-plist, which is... let's say not perfect at the moment. I believe ${PORTSDIR}/regress is probably the simplest least disturbing way to do that. Since the manpages already exist under src, I could also (somehow) put

tweak to dependency checking

2022-11-03 Thread Marc Espie
I'd like to add a special construct to dependencies, "=" to mean the exact version of the package we're depending on. The patch is trivial: Index: OpenBSD/PackingElement.pm === RCS file:

Re: malloc: prep for immutable pages

2022-10-06 Thread Marc Espie
On Wed, Oct 05, 2022 at 07:54:41AM -0600, Theo de Raadt wrote: > Marc Espie wrote: > > > On Tue, Oct 04, 2022 at 10:15:51AM -0600, Theo de Raadt wrote: > > > A note on why this chance is coming. > > > > > > malloc.c (as it is today), does mprotect

Re: malloc: prep for immutable pages

2022-10-05 Thread Marc Espie
On Tue, Oct 04, 2022 at 10:15:51AM -0600, Theo de Raadt wrote: > A note on why this chance is coming. > > malloc.c (as it is today), does mprotects back and forth between RW and > R, to protect an internal object. This object is in bss, it is not > allocated with mmap. With the upcoming

Re: wc(1): add -L flag to write length of longest line

2022-10-01 Thread Marc Espie
On Fri, Sep 30, 2022 at 02:22:34AM +0200, Joerg Sonnenberger wrote: > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > > wc counts items in files. Finding the longest item indeed sounds > > like a task better suited to awk. > > Finding outliers, means and counting are all parts

ports tree FULLPATH convention

2022-07-05 Thread Marc Espie
This is something I added in 2011 (I think) to bsd.port.subdir.mk if FULLPATH=Yes, a FULLPKGPATH like SUBDIR=cat/location will give you the EMPTY flavor for that location instead of the DEFAULT flavor. I'm now questionning whether this actually makes senses considering the changes I was making

pkg_create tweak for PORTSDIR_PATH

2022-06-28 Thread Marc Espie
As noticed by landry, going to the ports tree for dependencies can fail hilariously in case of a PORTSDIR_PATH. Most specifically, assuming you are building something like firefox-102 in one of your ports directory, when building the debug package, dependency look-up in pkg_create is going to

Re: m4: gnu-m4 compat draft

2022-06-15 Thread Marc Espie
On Wed, Jun 08, 2022 at 09:44:19PM +0200, Marc Espie wrote: > Naddy told me about an app that wants a gnu-m4 extension that > requires >9 arguments to macros. > > I wrote a very quick patch that seems to do the work. There are probably > lots of kinks to work out, it's been v

m4: gnu-m4 compat draft

2022-06-08 Thread Marc Espie
Naddy told me about an app that wants a gnu-m4 extension that requires >9 arguments to macros. I wrote a very quick patch that seems to do the work. There are probably lots of kinks to work out, it's been very lightly tested. (in particular, I haven't looked at stuff like $* and friends yet,

@extraunexec usage in pkg_add

2022-06-07 Thread Marc Espie
I've conducted a quick audit of the 300 or so uses of @extraunexec in pkg_add. All but 5 are actually glorified versions of rm -rf I propose eventually replacing them with @extraglob pattern with several advantages: - we have file names that we know - perl itself can expand the glob and

some package oddities

2022-05-30 Thread Marc Espie
Due to some slowdown in updating texlive, I've looked up duplicate files inside packages. Most packages are okay, a few are not... The following list shows the maximum number of times a file appears in a given package (just looking at its checksum) Note sdcc, which stores a crazy number of

Re: Picky, but much more efficient arc4random_uniform!

2022-05-21 Thread Marc Espie
On Sat, May 21, 2022 at 07:47:40AM -0500, Luke Small wrote: > Perhaps it was rude sending off list stuff to the list. Your email sounded > "less than friendly" and more of a professional challenge that you were > definitely in the works to produce; much like Damien Miller’s challenge to > prove

Re: [PATCH] xenocara: change xterm ProcGetCWD to get cwd via sysctl instead of procfs

2022-05-16 Thread Marc Espie
On Sun, May 15, 2022 at 08:46:00PM -0600, Theo de Raadt wrote: > You'll turn into a smurf before you finish auditing xterm perfectly. Should be in fortune ;)

Re: Picky, but much more efficient arc4random_uniform!

2022-05-15 Thread Marc Espie
Random generators have been analyzed for years. Pick up "Concrete mathematics" by Don E. Knuth, read it, then come back with actual science.

pkg_add: better correspondence of file names

2022-05-05 Thread Marc Espie
In the old pkg_add model (prior to 7.1), we create tmp files anyway, so the code is fine. 7.1 and later, we try to avoid creating temp files, so a better name matching correspondence would be cool What this patch does: the old code creates a simple hash where we associate ONE packing-list

Re: clang-local.1: document support for source-based code coverage

2022-05-04 Thread Marc Espie
On Wed, May 04, 2022 at 07:43:35AM -0400, Bryan Steele wrote: > On Wed, May 04, 2022 at 01:20:10PM +0200, Frederic Cambus wrote: > > Hi tech@, > > > > The base system includes the compiler-rt profile library for > > source-based code coverage. > > > > So here is a diff to document support in

Re: kbd -l error message

2022-04-14 Thread Marc Espie
On Thu, Apr 14, 2022 at 04:28:37PM +0200, Alexander Bluhm wrote: > Hi, > > When kbd -l is executed as regular user, it fails silently. > > $ kbd -l > $ echo $? > 0 > > Error handling is a bit tricky. We want the first error if no > device is available. > > $ ./kbd -l > kbd: open

Re: PATCH: speed up pkg_add

2022-03-16 Thread Marc Espie
I got a new slightly different one. Specifically, the old one has a "fun" failure mode in case an old package got broken and is missing files. The heuristics correctly deduces that the files are not there, so it extracts in-place... then pkg_delete promptly deletes what it believes to be files

PATCH: speed up pkg_add

2022-03-15 Thread Marc Espie
I've changed pkg_add for updates and tied files a while back, which resulted in creating a lot of temp files. The logic was complicated, and I didn't want to make it more complex at the time until most of the issues were fixed. Then we got tags, so that most packing-lists are innocuous these

Re: atomic read write

2022-03-11 Thread Marc Espie
I've been reading the newer C standard (n2310.pdf to be specific). That thing is scary. I believe that, in the long haul, we will have to use the Atomic types stuff that's apparently part of the C standard now. Yeah, the switch to multi-threading made the standard way more complicated. Sequence

Re: A program compiled with '-pg' option always gets SEGV on its execution.

2022-02-21 Thread Marc Espie
On Mon, Feb 21, 2022 at 05:36:16PM +0900, Yuichiro NAITO wrote: > Of course, all programs compiled without '-pg' work fine for me. > I found this issue when I profile my application with gprof(1). > For example, following example C source code fails to execute on OpenBSD 7.0. Profile is partly

Re: fw_update perl glue tweaks

2022-02-14 Thread Marc Espie
On Mon, Feb 14, 2022 at 11:37:55AM +0100, Marc Espie wrote: > - you don't need to call unlock_db. When the process dies, the fd dies with > it, and the lock. > > - I've committed glue to PackageInfo.pm to make lock_db self-contained > (it will pull BaseState in on an "as neede

fw_update perl glue tweaks

2022-02-14 Thread Marc Espie
- you don't need to call unlock_db. When the process dies, the fd dies with it, and the lock. - I've committed glue to PackageInfo.pm to make lock_db self-contained (it will pull BaseState in on an "as needed" basis, which also comes in handy for other locks prior to having a state) Index:

Re: fw_update(8): lock pkg database while running

2022-02-09 Thread Marc Espie
On Wed, Feb 09, 2022 at 07:30:46PM -0800, Andrew Hewus Fresh wrote: > I was reminded that fw_update(8) updates the package database without > locking currently. That can cause issues when running it concurrently > with pkg_add, for example starting `pkg_add -u` in one terminal and > `sysupgrade`

Re: perl clang -Wcompound-token-split-by-macro

2022-02-08 Thread Marc Espie
On Tue, Feb 08, 2022 at 01:59:51PM +, Stuart Henderson wrote: > > > I think we should start updating Devel::PPPort in base. Then we > > > can regenerate other ppport.h in base and ports. Note that some ports > > > need newer Devel::PPPort than we have now. So updating seems > > >

Re: perl clang -Wcompound-token-split-by-macro

2022-01-21 Thread Marc Espie
Or we can automate this with something like this: Index: perl.port.mk === RCS file: /cvs/ports/infrastructure/mk/perl.port.mk,v retrieving revision 1.32 diff -u -p -r1.32 perl.port.mk --- perl.port.mk12 Dec 2021 19:25:39

Re: perl clang -Wcompound-token-split-by-macro

2022-01-21 Thread Marc Espie
On Fri, Jan 21, 2022 at 02:12:25PM +0100, Alexander Bluhm wrote: > Hi, > > Since clang 13 each Perl or Perl XS module compile spits out a lot > of -Wcompound-token-split-by-macro warnings. E.g. p5-Net-SSLeay > produces 3882 warnings generated. You cannot spot anything useful. > The problem is

Re: locale in expr(1)

2021-11-15 Thread Marc Espie
On Mon, Nov 15, 2021 at 05:58:38PM +0100, Ingo Schwarze wrote: > I don't know. A fairly reliable way to create security risks is > complexity. Apart from the erratic run time behaviour that is likely to > trip up sysadmins - LC_COLLATE can change the collation sequence even > among ASCII

Re: locale in expr(1)

2021-11-15 Thread Marc Espie
On Mon, Nov 15, 2021 at 03:43:47PM +0100, Jan Stary wrote: > Here's a try (see below); > one sentence one line while here. > > I would also replace 'results' with 'result' everywhere, > but I am not a native speaker. > > Jan > > > On Nov 10 18:46:08, h...@stare.cz wrote: > > On Nov 10

PATCH: make pkg_delete a bit more finicky

2021-10-30 Thread Marc Espie
We disabled the checksum check because it was rather expensive, but actually we also store timestamps in packing-lists This is a first draft at a better check. What this does: - compare the fs timestamp with the packing-list timestamp. This should be very cheap in most cases, since we're already

Re: Exit status of pkg_add

2021-10-21 Thread Marc Espie
On Tue, Oct 19, 2021 at 10:42:04AM +0900, Yuichiro NAITO wrote: > Following patch changes pkg_add to return a error code, > if a package name is wrong. > > diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm > b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm > index 7a968cbf05d..39bee874ff1 100644 > ---

Re: Thread Local Storage in clang

2021-05-28 Thread Marc Espie
On Fri, May 28, 2021 at 06:56:42PM +0200, Marc Espie wrote: > On Fri, May 28, 2021 at 07:55:39AM -0700, Chris Cappuccio wrote: > > I tried to compile librdkafka on OpenBSD 6.5 (clang 7.0.1) and clang > > compiled > > the __thread parts with some built-in mechanism.

Re: Thread Local Storage in clang

2021-05-28 Thread Marc Espie
On Fri, May 28, 2021 at 07:55:39AM -0700, Chris Cappuccio wrote: > I tried to compile librdkafka on OpenBSD 6.5 (clang 7.0.1) and clang compiled > the __thread parts with some built-in mechanism. I upgraded the system to > OpenBSD 6.9 and TLS is no longer supported by the in-tree clang. Was this >

Re: emutls and dlopen(3) problem - Re: patch: make ld.so aware of pthread_key_create destructor - Re: multimedia/mpv debug vo=gpu crash on exit

2021-05-09 Thread Marc Espie
So, is there a way to get a work-around ? or should we push for proper tls sooner than later ? It always made me queasy having all those programs segfaulting on exit. Not sure it's exploitable, but giving people the impression it's okay to segfault. I thought it might be bad code in the

Re: shell manpage tweaks wrt getopt

2021-04-30 Thread Marc Espie
On Fri, Apr 30, 2021 at 04:54:57PM +0200, Christian Weisgerber wrote: > Marc Espie: > > > Until a patch from naddy, I wasn't even aware of getopts in sh(1) > > Let's start the discussion with this instead. > > This puts the deprecation notice in getopt.1 in a pro

Re: shell manpage tweaks wrt getopt

2021-04-30 Thread Marc Espie
On Fri, Apr 30, 2021 at 03:28:42PM +0100, Jason McIntyre wrote: > my argument boils down to: sh(1) is small and has no examples. adding > them changes the (deliberate) nature of the page. ksh(1) is what you > read when you can;t get to sleep. > > why is it wrong to add your example to ksh(1)? why

  1   2   3   4   5   6   7   >