Improve version, version range, and version list syntax and behavior#36273
Merged
tgamblin merged 83 commits intospack:developfrom May 6, 2023
Merged
Improve version, version range, and version list syntax and behavior#36273tgamblin merged 83 commits intospack:developfrom
tgamblin merged 83 commits intospack:developfrom
Conversation
alalazo
reviewed
Mar 22, 2023
Member
Author
looks like correct audit results to me, so |
2136efc to
35ee072
Compare
3e78901 to
a2ed04c
Compare
a2ed04c to
dea2645
Compare
Member
Author
|
Looking at |
d5a0d01 to
ffb87bb
Compare
4a7a945 to
9f0c66a
Compare
2 tasks
3 tasks
3 tasks
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 11, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 11, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 11, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 12, 2023
3 tasks
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 17, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 17, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 18, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
May 18, 2023
This was referenced Jun 6, 2023
brenthuisman
added a commit
to arbor-sim/arbor
that referenced
this pull request
Jul 10, 2023
- Upstream Spack changes forces any version that will be built to be explicitly listed in `package.py`. See spack/spack#36273 - This version is only provided if a local `VERSION` is found (implying presence of Arbor source). If not, building that version would fail. - Temporarily disabled recently added Python tests in the workflow file, because `dev-build`s don't install the package, and thus the tests and examples won't run. I'm looking into a solution, but don't want to hold merging this PR up.
3 tasks
4 tasks
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
Aug 22, 2023
greenc-FNAL
added a commit
to greenc-FNAL/spack
that referenced
this pull request
Aug 22, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
Aug 23, 2023
greenc-FNAL
added a commit
to FNALssi/spack
that referenced
this pull request
Aug 23, 2023
marcmengel
pushed a commit
to FNALssi/spack
that referenced
this pull request
Aug 23, 2023
* Test directive enhancement * [geant4] Accommodate spack#36273 * Fix style
This was referenced Dec 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version types, parsing and printing
The version classes have changed:
VersionBaseis removed, there is now aConcreteVersionbase class.StandardVersionandGitVersionboth inheritfrom this.
The public api (
Version,VersionRange,ver) has changed a bit:Versionproduces eitherStandardVersionorGitVersioninstances.VersionRangeproduces aClosedOpenRange, but this shouldn't affect the user.verproduces any ofVersionList,ClosedOpenRange,StandardVersionor
GitVersion.No unexpected type promotion, so that the following is no longer an identity:
Version(x) != VersionRange(x, x).VersionList.concretenow returns a version if it contains only a single elementsubtyping
ConcreteVersion(i.e.StandardVersion(...)orGitVersion(...))In version lists, the parser turns
@xintoVersionRange(x, x)insteadof
Version(x).The above also means that
ver("x")produces a range, whereasver("=x")produces aStandardVersion. The=is part of VersionListsyntax.
VersionList.__str__now outputs=x.y.zfor specific version entries,and
x.y.zas a short-hand for rangesx.y.z:x.y.z.Spec.formatno longer aliases{version}to{versions}, but pulls theconcrete version out of the list and prints that -- except when the list is
is not concrete, then is falls back to
{versions}to avoid a pedantic error.For projections of concrete specs,
{version}should be used to render1.2.3instead of=1.2.3(which you would get with{versions}).The default
Specformat string used inSpec.__str__now uses{versions}so thatstr(Spec(string)) == stringholds.Changes to
GitVersionGitVersionis a small wrapper aroundStandardVersionwhich enriches itwith a git ref. It no longer inherits from it.
GitVersionalways needs to be able to look up an associated Spack versionif it was not assigned (yet). It throws a
VersionLookupErrorwheneverref_versionis accessed but it has no means to look up the ref; in the past Spack would
not error and use the commit sha as a literal version, which was incorrect.
GitVersionis never equal toStandardVersion, nor is satisfied by it. Thisis such that we don't lose transitivity. This fixes the following bug on
developwhere
git_version_a == standard_version == git_version_bdoes not implygit_version_a == git_version_b. It also ensures equality always implies equalhash, which is also currently broken on develop; inclusion tests of a set of
versions + git versions would behave differently from inclusion tests of a
list of the same objects.
The above means
ver("ref=1.2.3) != ver("=1.2.3")could break packages that branchon specific versions, but that was brittle already, since the same happens with
externals:
[email protected]suffixes wouldn't be exactly equal either. Instead,those checks should be
x.satisfies("@1.2.3")which works both for git versions andcustom version suffixes.
GitVersionfrom commit will now print as<hash>=<version>once thegit ref is resolved to a spack version. This is for reliability -- version is frozen
when added to the database and queried later. It also improves performance
since there is no need to clone all repos of all git versions after
spack clean -mis run and something queries the database, triggering version comparison, such
as potentially reuse concretization.
The "empty VerstionStrComponent trick" for
GitVerisonis dropped since it wasn'trepresentable as a version string (by design). Instead, it's replaced by
git,so you get
1.2.3.git.4(which reads 4 commits after a tag 1.2.3). This meansthat there's an edge case for version schemes
1.1.1,1.1.1a, since thegenerated git version
1.1.1.git.1(1 commit after1.1.1) compares largerthan
1.1.1a, sincea < gitare compared as strings. This is currently awont-fix edge case, but if really required, could be fixed by special casing
the
gitstring.Saved, concrete specs (database, lock file, ...) that only had a git sha as their
version, but have no means to look the effective Spack version anymore, will
now see their version mapped to
hash=develop. Previously these specswould always have their sha literally interpreted as a version string (even when
it could be looked up). This only applies to databases, lock files and spec.json
files created before Spack 0.20; after this PR, we always have a Spack version
associated to the relevant GitVersion).
Fixes a bug where previously
to_dict/from_dict(de)serialization would notreattach the repo to the GitVersion, causing the git hash to be used as a literal
(bogus) version instead of the resolved version. This was in particularly breaking
version comparison in the build process on macOS/Windows.
Installing or matching specific versions
In the past,
spack install [email protected]would installpkg@=3.2if it was aknown specific version defined in the package, even when newer patch releases
3.2.1,3.2.2,...were available. This behavior was only there becausethere was no syntax to distinguish between
3.2and3.2.1. Since there issyntax for this now through
pkg@=3.2, the old exact matching behavior isremoved. This means that
spack install [email protected]constrains thepkgversionto the range
3.2, andspack install pkg@=3.2constrains it to the specificversion
3.2.Also in directives such as
depends_on("[email protected]")and their whenconditions
conflicts("...", when="@2.3")ranges are ranges, and specificversion matches require
@=2.3..No matching version: in the case
[email protected]matches nothing, concretizationerrors. However, if you run
spack install pkg@=3.2and this versiondoesn't exist, Spack will define it; this allows you to install non-registered
versions.
For consistency, you can now do
%gcc@10and let it match a configured10.x.ycompiler. It errors when there is no matching compiler.In the past it was interpreted like a specific
gcc@=10version, whichwould get bootstrapped.
When compiler bootstrapping is enabled,
%gcc@=10.2.0can be used tobootstrap a specific compiler version.
Other changes
Externals, compilers, and develop spec definitions are backwards compatible.
They are typically defined as
[email protected]even though they should besaying
pkg@=3.2.1. Spack now transformspkg@3intopkg@=3in those cases.Finally, fix strictness of
version(...)directive/declaration. It just does a simpletype check, and now requires strings/integers. Floats are not allowed because
they are ambiguous
str(3.10) == "3.1".Closes #36183