void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

xbps-src: explicitly disallow pattern on build deps

Open Chocimier opened this issue 3 years ago • 5 comments

It is not possible to use version other than currently in template.

Specifying pattern breaks build if dependency isn't in binary repo already. That it worked when in repo was a coincidence.

Testing the changes

  • I tested the changes in this PR: YES

Chocimier avatar Aug 08 '22 18:08 Chocimier

what about the exact version case? (foo-1.2_3)

classabbyamp avatar Aug 08 '22 18:08 classabbyamp

it isn't as easy to tell what is an exact version, and calling xbps-uhelper is costly

Chocimier avatar Aug 08 '22 20:08 Chocimier

Closes #37837

openocd seems to be the only package that currently uses a version restriction in build depends

paper42 avatar Aug 08 '22 23:08 paper42

Moved version restriction of openocd on jimtcl to depends.

Chocimier avatar Aug 10 '22 16:08 Chocimier

I think this check should go into setup_pkg in common/xbps-src/shutils/common.sh, this is where we do basic validation on input variables. I would also use pattern matching, either case statement or just [[ matching.

for x in "foo>=1" "bar<2" "fizz" "foo-bar-1.0_1" "font-adobe-100dpi-1.8_blah" "cross-x86_64-linux-musl-libc" "perl-PerlIO-utf8-strict-0.008_1" "perl-PerlIO-utf8-strict"; do
    if [[ $x = *[\>\<]* || $x =~ -[^-]+_[0-9]+$ ]]; then 
        echo $x
    fi
done

Duncaen avatar Aug 10 '22 16:08 Duncaen

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

github-actions[bot] avatar Nov 10 '22 02:11 github-actions[bot]

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

github-actions[bot] avatar Feb 08 '23 02:02 github-actions[bot]

@Duncaen: ok, modified regex to match xbps-uhelper getpkgname.

Chocimier avatar Feb 13 '23 22:02 Chocimier

This pattern is more restrictive than the xbps implementation, the only requirement is that revision is numeric not that the version starts with a digit.

Duncaen avatar Feb 13 '23 22:02 Duncaen

Version has to contain digit, see commit message.

Chocimier avatar Feb 13 '23 22:02 Chocimier

ah right, this is so stupid this shouldn't have been implemented and i hate it, but it is what it is...

Duncaen avatar Feb 13 '23 22:02 Duncaen

Maybe we can just add = as alternative pkgver separator in xbps and slowly migrate over to use that as a more sane choice instead of a character that is used in half the packages names already.

Duncaen avatar Feb 13 '23 22:02 Duncaen

+1, i think = makes a lot of sense as a version specifier

classabbyamp avatar Feb 14 '23 01:02 classabbyamp