Skip to content

tests: Remove more abs_top_builddir#175

Open
oech3 wants to merge 1 commit intocoreutils:masterfrom
oech3:command-v
Open

tests: Remove more abs_top_builddir#175
oech3 wants to merge 1 commit intocoreutils:masterfrom
oech3:command-v

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Jan 19, 2026

tests/install/basic-1.sh is related with strip. So we should want to keep those abs_...

Comment thread tests/env/env-S-script.sh

# a shortcut to avoid long lines
dir="$abs_top_builddir/src"
gprintf="$abs_top_builddir/src/printf"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

did you not use command -v because printf is a builtin generally?
I suppose $gprintf is built as the tests start with print_ver_ printf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

did you not use command -v because printf is a builtin generally?

Yes. (I'm not familiar with test suite init)

Copy link
Copy Markdown
Contributor Author

@oech3 oech3 Jan 19, 2026

Choose a reason for hiding this comment

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

$(print_ver_ any_buitin_cmd)env printf?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes print_ver_() uses env(1) to avoid builtins

Comment thread tests/install/trap.sh

# Before 2004-04-21, install would infloop, in the 'while (wait...' loop:
exec ginstall -s "$abs_top_builddir/src/ginstall$EXEEXT" .
exec ginstall -s "$(command -v ginstall)" .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes I suppose it doesn't matter what we install here.
It will fail if ginstall is a shebang script, but we don't check that.
I.e. there is no need to change this one apart from minimizing use of $abs_top_builddir

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we could skip building GNU ginstall via GitHub cache provided getlimits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It will fail if ginstall is a shebang script,

uutils use actual binary now.

nproc=$abs_top_builddir/src/nproc$EXEEXT
nproc="$(command -v nproc)"
cp --parents $(ldd $nproc | grep -o '/[^ ]*') $ROOT ||
skip_ 'Failed to copy nproc libs to chroot'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we'd skip for shebang scripts

nproc="$(command -v nproc)"
cp --parents $(ldd $nproc | grep -o '/[^ ]*') $ROOT ||
skip_ 'Failed to copy nproc libs to chroot'
cp $nproc $ROOT || framework_failure_
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But should work for symlinks/hardlinks

Copy link
Copy Markdown
Member

@pixelb pixelb left a comment

Choose a reason for hiding this comment

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

I can't see any issues with this, though command resolution is subtle.
I might wait until after the impending 9.10 release to merge this one

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Feb 12, 2026

Can we simply swap all of abs_top_builddir with dirname $(command -v dirname)?

@pixelb
Copy link
Copy Markdown
Member

pixelb commented Feb 12, 2026

One caveat is that users might ./configure --enable-no-install-program=dirname

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Feb 12, 2026

Are ginstall and getmimits force-provided always?

@pixelb
Copy link
Copy Markdown
Member

pixelb commented Feb 12, 2026

getlimits should always be there yes. ginstall is not treated any differently so might not be present

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