Skip to content

Conversation

@IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Feb 21, 2022

Allows providing a custom manifest name via the JULIA_MANIFEST_NAME env var, which can have placeholder # chars that will be replaced by the VERSION fields.

% JULIA_MANIFEST_NAME=Manifest.#.#.toml julia -e "import Pkg; Pkg.status(mode=Pkg.PKGMODE_MANIFEST)"
Status `~/.julia/environments/v1.9/Manifest.1.9.toml` (empty manifest)

Requires JuliaLang/Pkg.jl#3000

Discussed in #43845 (comment)

Closes #43845

@DilumAluthge DilumAluthge added the packages Package management and loading label Feb 21, 2022
@DilumAluthge
Copy link
Member

I imagine that Pkg (and any other users of the Base.manifest_names tuple) will need to be patched to use the Base.manifest_names() function instead?

@IanButterworth
Copy link
Member Author

Yes. Just added a link to the Pkg branch

@DilumAluthge DilumAluthge added the feature Indicates new feature / enhancement requests label Feb 21, 2022
@DilumAluthge
Copy link
Member

Once JuliaLang/Pkg.jl#3000 is merged, we'll bump the Pkg version on master, and once that bump PR is merged, we'll rebase this PR. Then CI will be able to pass on this PR.

@DilumAluthge DilumAluthge requested a review from vtjnash February 21, 2022 07:54
@DilumAluthge
Copy link
Member

@vtjnash Since you originally requested this feature, what do you think about the new interface?

Copy link
Member

@DilumAluthge DilumAluthge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the length of the tuple we return is going to be variable, then we should go back to vectors instead, so that the manifest_names function will be type-stable.

@IanButterworth IanButterworth force-pushed the ib/custom_manifest_name branch from 2615d4b to 506aa53 Compare February 22, 2022 05:38
const manifest_names = ("JuliaManifest.toml", "Manifest.toml")
const preferences_names = ("JuliaLocalPreferences.toml", "LocalPreferences.toml")
const project_names = ["JuliaProject.toml", "Project.toml"]
const default_manifest_names = ["JuliaManifest.toml", "Manifest.toml"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be populated on startup instead, and still be a global constant called manifest_names. I would think that would help tooling which uses this too.

custom_def = strip(get(ENV, env_var_name, ""))
if !isempty(custom_def)
man_name = expand_version_placeholders(custom_def)
if endswith(custom_def, ":")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this split on : and replace empty parts with the default like load path?

I also don't think this functionality is that necessary, what is the problem with falling back to Manifest.toml if a versioned one doesn't exist?

@IanButterworth
Copy link
Member Author

Just checking, do we want to get this figured out for 1.9 given weak deps have landed, and 1.9 manifests with weakdeps will be quite different to prior julia versions?

Over time I've actually come to prefer the original idea of just ranking version-named manifests higher automatically rather than requiring the user to specify an env var.

so

const manifest_names = ("JuliaManifest$(VERSION.major).$(VERSION.minor).toml", 
                        "Manifest$(VERSION.major).$(VERSION.minor).toml",
                        "JuliaManifest.toml", 
                        "Manifest.toml")

@vchuravy
Copy link
Member

vchuravy commented Oct 6, 2023

Over time I've actually come to prefer the original idea of just ranking version-named manifests higher automatically rather than requiring the user to specify an env var.

Yeah agreed that seems to me to be sensible behavior.

@IanButterworth
Copy link
Member Author

Ok. Reviving #43845 in place of this

@IanButterworth IanButterworth deleted the ib/custom_manifest_name branch November 30, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Indicates new feature / enhancement requests packages Package management and loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants