Prefix and `:upper` version ranges match pre-releases of the next version (`=4rc1` satisfies `@3`, `[email protected]` resolves to `0.2.1-rc.1`)

Aperta
#53,371 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, databases

Direzione di ricerca

Start with lib/spack/spack/version/version_types.py, especially ClosedOpenRange.from_version_range and _next_version; the issue identifies the upper-bound behavior causing the mismatch. Read the version specifier documentation and the case near lib/spack/spack/test/versions.py:326, then run the five satisfies examples and spack spec [email protected]. Done when all five checks are false and that spec fails to concretize.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Steps to reproduce

Prefix version specs (@3, @1.2.0) and upper-bounded ranges (@:3, @:1.1, @:1.2.0) match alpha, beta, and rc pre-releases of the incremented version whenever the pre-release has the same number of release components as the upper bound.

$ spack python -c 'from spack.version import ver; print([(c, r, ver(c).satisfies(ver(r))) for c, r in [("=4rc1", "3"), ("=4alpha1", ":3"), ("=1.2alpha1", ":1.1"), ("=1.2.1alpha1", "1.2.0"), ("=1.2.1alpha1", ":1.2.0")]])'
$ spack spec [email protected]
Error message

No error is raised (including under spack --debug --stacktrace), and Spack returns the wrong match:

[('=4rc1', '3', True), ('=4alpha1', ':3', True), ('=1.2alpha1', ':1.1', True), ('=1.2.1alpha1', '1.2.0', True), ('=1.2.1alpha1', ':1.2.0', True)]
 -   [email protected] build_system=autotools platform=linux os=debian12 target=cascadelake %[email protected]
 -       ^[email protected] build_system=generic platform=linux os=debian12 target=cascadelake
[e]      ^[email protected]+binutils+bootstrap+futex~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=Release languages:='c,c++' platform=linux os=debian12 target=x86_64
 -       ^[email protected] build_system=generic platform=linux os=debian12 target=cascadelake
[e]      ^[email protected] build_system=autotools platform=linux os=debian12 target=x86_64
 -       ^[email protected]~guile build_system=generic platform=linux os=debian12 target=cascadelake %[email protected]
 -       ^[email protected]~classic-names+envmods~external-libfabric~generic-names~ilp64 build_system=generic platform=linux os=debian12 target=cascadelake %[email protected]
 -       ^[email protected] build_system=autotools platform=linux os=debian12 target=cascadelake %[email protected]
 -           ^[email protected] build_system=autotools platform=linux os=debian12 target=cascadelake
 -       ^[email protected] build_system=autotools platform=linux os=debian12 target=cascadelake %[email protected]

Expected behavior: all five satisfies checks should return False, and spack spec [email protected] should fail to concretize because libcircle only defines master, 0.3.0, and 0.2.1-rc.1. Per the version specifier documentation, @3 includes versions with major version 3, and lib/spack/spack/test/versions.py:326 notes that :1.1 should not include next-version pre-releases (which passed there only because 1.2.0alpha1 has three release segments while 1.1 has two).

In lib/spack/spack/version/version_types.py, ClosedOpenRange.from_version_range sets the exclusive upper bound via _next_version(hi), which increments the last release component while keeping prerelease = (FINAL,), so any pre-release with that incremented release tuple compares strictly less than hi.

Information on your system

Reproduced on both Spack 1.2.2 and develop:

* **Spack:** 1.2.2 (https://github.com/spack/spack/commit/3e19345b6e12f5ff1b874f4059622fc6a1fd804a)
* **Builtin repo:** https://github.com/spack/spack-packages/commit/6fe25eaebe46cee8386bd0b935b31d2ac5a3b348
* **Python:** 3.11.2
* **Platform:** linux-debian12-cascadelake
* **Spack:** 1.3.0.dev0 (https://github.com/spack/spack/commit/aea937f0ba030daebd645ff69bdfc55675d8e76c)
* **Builtin repo:** https://github.com/spack/spack-packages/commit/6fe25eaebe46cee8386bd0b935b31d2ac5a3b348
* **Python:** 3.11.2
* **Platform:** linux-debian12-cascadelake
General information
  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Credit: https://ucsbplse.github.io/

Lingua principale
Python
Stelle
5.2k
Fork
2.5k
Merge medio
2g 4h
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spack/spack

Tutte le issue di spack/spack

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.