Skip to content

Conversation

@oech3
Copy link
Contributor

@oech3 oech3 commented Sep 29, 2025

Do not install libstdbuf*and fail for all OS (not only for Windows).
Needed for #8767

@oech3 oech3 changed the title Do not fail if libstdbuf was not built Do not fail if libstdbuf was not built (not only for Windows) Sep 29, 2025
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
endif
# Do not fail if libstdbuf was not built (e.g. on Windows)
Copy link
Contributor

@Ecordonnier Ecordonnier Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you want to do it the same way I've done it above in the build step?

ifneq ($(findstring stdbuf,$(UTILS)),)
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think a call to make install should be added to

make UTILS="rm chmod chown chgrp mv du"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work on SELINUX_ENABLED=1 SKIP_UTILS=stdbuf?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question. what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you mean now. It should be possible to make it work. Can the value of "SKIP_UTILS" not be removed from "UTILS" before we evaluate it at line 226?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the value of "SKIP_UTILS" not be removed from "UTILS" before we evaluate it at line 226?

I agree with it.

Apart from, I met missing libstdbuf when I tried to fix #8767 and considered that stdbuf is not impremented yet for SELinux build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is existense of stdbuf binary also means libstdbuf* at all OS (except for WIndows)? If so, I use existense of stdbuf binary instead.

Also I don't see any reason to avoid installing libstdbuf.dll (not implemented yet?) for simplity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is existense of stdbuf binary also means libstdbuf* at all OS (except for WIndows)? If so, I use existense of stdbuf binary instead.

Also I don't see any reason to avoid installing libstdbuf.dll (not implemented yet?) for simplity.

  • Well, normally yes, because gnuMakefile enables feat_external_libstdbuf.

  • you can remove the "if windows " for simplicity, even though stdbuf will probably never be implemented on windows

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 29, 2025

CodSpeed Performance Report

Merging #8770 will not alter performance

Comparing oech3:nolibstdbuf (bc3d606) with main (5c15d79)

Summary

✅ 41 untouched
⏩ 64 skipped1

Footnotes

  1. 64 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@oech3
Copy link
Contributor Author

oech3 commented Sep 30, 2025

This looks incorrect solution for SELinux things.

@oech3 oech3 closed this Sep 30, 2025
@oech3 oech3 deleted the nolibstdbuf branch September 30, 2025 08:07
@Ecordonnier
Copy link
Contributor

@oech3 I am not sure why you closed this PR. Is it OK if I send one PR as follow-up to fix the libstdbuf installation issue when calling e.g. "make UTILS=ls"?

@oech3
Copy link
Contributor Author

oech3 commented Sep 30, 2025

Maybe, OK.

@Ecordonnier
Copy link
Contributor

Maybe, OK.

OK, I have opened #8782

@oech3
Copy link
Contributor Author

oech3 commented Oct 9, 2025

@Ecordonnier Is LD_PRELOAD really work? Cannot we just deprecate libstdbuf.so?

> ldd /usr/bin/uu-coreutils
	linux-vdso.so.1 (*)
	libonig.so.5 => /usr/lib/libonig.so.5 (*)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (*)
	libm.so.6 => /usr/lib/libm.so.6 (*)
	libc.so.6 => /usr/lib/libc.so.6 (*)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2

@Ecordonnier
Copy link
Contributor

@Ecordonnier Is LD_PRELOAD really work? Cannot we just deprecate libstdbuf.so?

> ldd /usr/bin/uu-coreutils
	linux-vdso.so.1 (*)
	libonig.so.5 => /usr/lib/libonig.so.5 (*)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (*)
	libm.so.6 => /usr/lib/libm.so.6 (*)
	libc.so.6 => /usr/lib/libc.so.6 (*)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2

LD_PRELOAD does work on Linux. Since the goal of the project is to be a full replacement for GNU coreutils, we can't deprecate stdbuf.

It is expected that ldd does not show libstdbuf, since it is loaded at runtime using LD_PRELOAD.

@oech3
Copy link
Contributor Author

oech3 commented Oct 9, 2025

It there any external project using libstdbuf? If not , can GNU coreutils drop it?

@oech3
Copy link
Contributor Author

oech3 commented Oct 9, 2025

I was misunderstaiding how is it used. Statically including it is impossible.

@Ecordonnier
Copy link
Contributor

It there any external project using libstdbuf? If not , can GNU coreutils drop it?

I don't think GNU would drop it without a very good reason. Dropping it would break shell scripts using stdbuf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants