diff --git a/src/Operations.jl b/src/Operations.jl index da8c4027fa..20d2347a46 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -348,6 +348,9 @@ function collect_fixed!(ctx::Context, pkgs::Vector{PackageSpec}, names::Dict{UUI return fixed end +# drops build detail in version but keeps the main prerelease context +# i.e. dropbuild(v"2.0.1-rc1.21321") == v"2.0.1-rc1" +dropbuild(v::VersionNumber) = VersionNumber(v.major, v.minor, v.patch, isempty(v.prerelease) ? () : (v.prerelease[1],)) function project_compatibility(ctx::Context, name::String) return VersionSpec(Types.semver_spec(get(ctx.env.project.compat, name, ">= 0"))) @@ -357,11 +360,12 @@ end # looks at uuid, version, repo/path, # sets version to a VersionNumber # adds any other packages which may be in the dependency graph -# all versioned packges should have a `tree_hash` +# all versioned packages should have a `tree_hash` function resolve_versions!(ctx::Context, pkgs::Vector{PackageSpec}) # compatibility if ctx.julia_version !== nothing - ctx.env.manifest.julia_version = ctx.julia_version + # only set the manifest julia_version if ctx.julia_version is not nothing + env.manifest.julia_version = dropbuild(VERSION) v = intersect(ctx.julia_version, project_compatibility(ctx, "julia")) if isempty(v) @warn "julia version requirement for project not satisfied" _module=nothing _file=nothing diff --git a/test/manifest/formats/v2.0/Manifest.toml b/test/manifest/formats/v2.0/Manifest.toml index 267a3eb3d4..de317b9dfe 100644 --- a/test/manifest/formats/v2.0/Manifest.toml +++ b/test/manifest/formats/v2.0/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.7.0-DEV.1199" +julia_version = "1.7.0-DEV" manifest_format = "2.0" some_other_data = [1, 2, 3, 4] some_other_field = "other" diff --git a/test/manifest/formats/v3.0_unknown/Manifest.toml b/test/manifest/formats/v3.0_unknown/Manifest.toml index f7d11772fb..fe60b0a931 100644 --- a/test/manifest/formats/v3.0_unknown/Manifest.toml +++ b/test/manifest/formats/v3.0_unknown/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.7.0-DEV.1199" +julia_version = "1.7.0-DEV" manifest_format = "3.0" # NOT ACTUALLY v3.0 format. Just here to test a warning! [[deps.Logging]]