Skip to content

Conversation

@Keno
Copy link
Contributor

@Keno Keno commented Jun 26, 2025

This adds a from_current_manifest kwarg to collect_artifact_metas (and by extension collect_artifact_paths) that when set to true, uses the versions from the currently active environment's manifest instead of calling Pkg.add.

This allows reproducing environments from a simple Manifest.toml by activating that environment first, then using from_current_manifest=true to collect artifacts using the exact versions specified in the manifest.

Implementation details:

  • Moved pkg_io and stdlib_resolve! definitions outside the if/else block
  • Fixed indentation for code inside the do blocks
  • When from_current_manifest=true, uses current Pkg.Types.Context() to access manifest
  • Handles packages without tree_hash (like stdlib packages) by attempting module loading

Fixes #33

🤖 Generated with Claude Code

This adds a `from_current_manifest` kwarg to collect_artifact_metas (and by
extension collect_artifact_paths) that when set to true, uses the versions
from the currently active environment's manifest instead of calling Pkg.add.

This allows reproducing environments from a simple Manifest.toml by activating
that environment first, then using from_current_manifest=true to collect
artifacts using the exact versions specified in the manifest.

Implementation details:
- Moved pkg_io and stdlib_resolve\! definitions outside the if/else block
- Fixed indentation for code inside the do blocks
- When from_current_manifest=true, uses current Pkg.Types.Context() to access manifest
- Handles packages without tree_hash (like stdlib packages) by attempting module loading

Fixes JuliaPackaging#33

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@Keno Keno requested a review from staticfloat June 26, 2025 04:33
@Keno
Copy link
Contributor Author

Keno commented Jun 26, 2025

@staticfloat I don't fully understand this code, but claude helped and it looked reasonable. Let me know if you have comments.

@staticfloat
Copy link
Member

I'm pretty sure the feature you want already exists, if you just pass the manifest directory in as project_dir.

@Keno
Copy link
Contributor Author

Keno commented Jun 26, 2025

Kind of, but it still calls Pkg.add then, which messes with my Project.toml and Manifest.toml, which I don't want.

@staticfloat
Copy link
Member

Superceded by #35

@staticfloat staticfloat closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to install from/at versions in the current active manifest

2 participants