Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make checkstyle requires GNU parallel, but ./configure checks for any implementation #15832

Open
Fabian-Gruenbichler opened this issue Jan 29, 2024 · 3 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@Fabian-Gruenbichler
Copy link
Contributor

Fabian-Gruenbichler commented Jan 29, 2024

System information

Debian/Ubuntu, but also applies to other distros where parallel is not (always) the GNU variant.

Describe the problem you're observing

config/always-parallel.m4 only checks for some parallel in $PATH, but the usage later requires that it supports -X0.

also see openzfs/openzfs-docs#489

Describe how to reproduce the problem

On a Debian/Ubuntu system don't install GNU parallel but only the version from moreutils, or set the system up to prefer that variant using alternatives.

Now run make checkstyle.

Include any warning/errors/backtraces from the system logs

parallel: invalid option -- 'X'
parallel [OPTIONS] command -- arguments
        for each argument, run command with argument, in parallel
parallel [OPTIONS] -- commands
        run specified commands in parallel
make: *** [Makefile:14243: cstyle] Error 1

How to fix

something like echo -e 'echo a\0echo b' | parallel -X0 can probably be used as test to determine whether the found parallel is good enough, but I lack the autotools knowledge to encode this in config/always_parallel.m4.

@Fabian-Gruenbichler Fabian-Gruenbichler added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jan 29, 2024
@ole-tange
Copy link

ole-tange commented Jan 29, 2024

The officially supported way to check would be:

parallel --minversion 20220222 || echo parallel is older than 20220222

where 20220222 is the minimal version required.

Also have a look at --embed.

@Fabian-Gruenbichler
Copy link
Contributor Author

that might be needed as well to catch old versions of GNU parallel, but I am talking about a different parallel from a different package. Debian and Ubuntu have a way to let two packages ship implementations of a certain binary in $PATH, managing which version is used by admin preference.

e.g., there is a /usr/bin/parallel in package moreutils, and one in package parallel. they both do the same job, but they don't have 100% identical parameters. in particular, the moreutils variant doesn't have -X. it also doesn't have --minversion ;)

this is also used for things like which variant of vi provides vi ;)

@ole-tange
Copy link

I am aware that you are testing to see if it is a different parallel command.

But that is the clever part: If the installed version is GNU Parallel and too old, it will fail. If it is moreutils' parallel, it will also fail (but for different reasons).

So by using --minversion you are both testing that the installed parallel is GNU and has a usable version. This will work until moreutils' parallel adopts --minversion (which I would reckon is unlikely to happen).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

2 participants