Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyPatchPerlSafely(sourceDir, perlVersion string, verbose bool) error
- func AutoImportSystemPerl() error
- func CheckBinaryAvailability(version, platform string) (bool, error)
- func CheckBinaryAvailabilityWithMirrors(mirrors []string, version, platform string) (bool, error)
- func CheckBinaryAvailabilityWithRepo(repoURL, version, platformTriple string) (bool, error)
- func CheckBuildRequirements(version string) error
- func CheckGitAvailable() error
- func CheckPath() (bool, string, error)
- func CheckShellInit(shellType ShellType) (bool, string, error)
- func CompareBuilds(standard, enhanced *BuildResult) map[string]interface{}
- func CreateShellInitScripts() error
- func DeduplicateRegistry() (int, error)
- func FindBestMatch(constraint string, availableVersions []string) (string, error)
- func FindStrawberryRelease(perlVersion string) (string, error)
- func GenerateBinaryURL(version, platform string) (string, error)
- func GenerateBinaryURLWithRepo(repoURL, version, platformTriple string) (string, error)
- func GenerateShellScript(shellType ShellType, data ShellScriptData) (string, error)
- func GenerateShellUse(version string, library string) error
- func GenerateShims() error
- func GenerateSourceURL(mirror, version string) (string, error)
- func GetAvailableBinaryPlatforms(version string) ([]string, error)
- func GetAvailableBinaryPlatformsWithRepo(repoURL, version string) ([]string, error)
- func GetAvailableVersions() ([]string, error)
- func GetCurrentPerlPath() (string, error)
- func GetCurrentShellScript(shellType ShellType) (string, error)
- func GetPatchPerlInfo() (string, error)
- func GetPathConfigCommand() (string, error)
- func GetPerlbrewAliases() (map[string]string, error)
- func GetPlatformSpecificNotes() string
- func GetShellCompletionCommand(shellType ShellType) (string, error)
- func GetShellInitCommand(shellType ShellType) (string, error)
- func GetShellInitInstructions(shellType ShellType) string
- func GetShimCommand(shimName string, args []string) (*exec.Cmd, error)
- func GetSystemPerlVersion(perlPath string) (string, error)
- func GetSystemVersionString() (string, error)
- func ImportSystemPerl() error
- func InstallPatchPerl(verbose bool) error
- func IsPatchPerlAvailable() bool
- func IsShimDirectory(dir string) (bool, error)
- func PrintAutoImportResults(results *AutoImportResults)
- func RebuildRegistry() error
- func RegisterVersion(versionInfo VersionInfo) error
- func RegisterVersionAfterBuild(buildResult *BuildResult, source string) error
- func Rehash() error
- func RemoveAllShims() error
- func ResolveLatestDevVersion() (string, error)
- func ResolveLatestStableVersion() (string, error)
- func ResolveLatestVersion() (string, error)
- func ResolveVersionAlias(alias string, aliases map[string]string) (string, error)
- func SetGlobalVersion(version string) error
- func SetLocalVersion(version string) error
- func SetModuleInstaller(installer ModuleInstaller)
- func ShouldAutoImport() bool
- func ShouldUsePatchPerl(perlVersion string) bool
- func SwitchVersion(version string, scope string) error
- func UnsetGlobalVersion() error
- func UnsetLocalVersion() error
- func UseVersion(version string) error
- func ValidateBinaryInstallation(installPath string) (bool, []string, error)
- func ValidateDirectoryStructure(installPath string) (float64, []string)
- func ValidateExpectedVersion(installPath, expectedVersion string) error
- func ValidatePatchPerlEnvironment() error
- func VerifyMirror(mirror string) error
- type ArchiveExtractor
- type AutoImportResults
- type BinaryBenchmarkResults
- type BinaryCache
- func (bc *BinaryCache) Clean(maxAge time.Duration, maxSize int64) (int, int, error)
- func (bc *BinaryCache) CleanByAge(maxAge time.Duration) (int, error)
- func (bc *BinaryCache) CleanBySize(maxSize int64) (int, error)
- func (bc *BinaryCache) Get(version, platform string) (*BinaryCacheResult, error)
- func (bc *BinaryCache) List() ([]*BinaryCacheEntry, error)
- func (bc *BinaryCache) Put(sourcePath string, entry *BinaryCacheEntry) (string, error)
- func (bc *BinaryCache) Validate(binaryPath, expectedChecksum string) (bool, error)
- type BinaryCacheEntry
- type BinaryCacheResult
- type BinaryDownloadOptions
- type BinaryDownloadResult
- type BinaryInstallOptions
- type BinaryInstallResult
- type BinaryValidationResult
- type BuildArtifactCache
- type BuildCache
- func (bc *BuildCache) CleanOldEntries(maxAge time.Duration) error
- func (bc *BuildCache) GetCachedBuild(version string, options *BuildOptions) (*BuildResult, bool)
- func (bc *BuildCache) GetConfigCache(version string) (map[string]string, bool)
- func (bc *BuildCache) SaveBuild(version string, options *BuildOptions, result *BuildResult, ...) error
- type BuildContext
- type BuildManager
- type BuildOptions
- type BuildProgressCalculator
- func (calc *BuildProgressCalculator) GetOverallProgress() float64
- func (calc *BuildProgressCalculator) ParseMakeProgress(line string) bool
- func (calc *BuildProgressCalculator) SetStage(stage BuildProgressStage)
- func (calc *BuildProgressCalculator) UpdateLineBasedProgress()
- func (calc *BuildProgressCalculator) UpdateStageProgress(progress float64)
- func (calc *BuildProgressCalculator) UpdateTimeBasedProgress()
- type BuildProgressCallback
- type BuildProgressStage
- type BuildReport
- type BuildResult
- type CacheEntry
- type ChecksumDatabase
- type CloneCache
- type CommandRunner
- type Constraint
- type ConstraintSet
- type DefaultModuleInstaller
- type DependencyChecker
- type DependencyInfo
- type DiscoveredVersion
- type DownloadOptions
- type DownloadProgress
- type DownloadResult
- type EnhancedProgressCallback
- type FileHasher
- type ForkIdentifier
- type ForkManifest
- type ImportResult
- type InstallationMetrics
- type LegacyPerl
- type LegacyToolType
- type MetricsCollector
- type MetricsSummary
- type MirrorAuth
- type MirrorConfig
- type MirrorHealth
- type MirrorManager
- func (mm *MirrorManager) CheckMirrorHealth(mirror MirrorConfig) *MirrorHealth
- func (mm *MirrorManager) Close()
- func (mm *MirrorManager) DownloadWithMirrorFailover(version, platform string, options *BinaryDownloadOptions) (*BinaryDownloadResult, error)
- func (mm *MirrorManager) GenerateMirrorURL(mirror MirrorConfig, version, platform string) (string, error)
- func (mm *MirrorManager) GetBestMirror() (*MirrorConfig, error)
- func (mm *MirrorManager) GetMirrorChain() []MirrorConfig
- func (mm *MirrorManager) GetMirrorHealth() map[string]*MirrorHealth
- func (mm *MirrorManager) GetMirrors() []MirrorConfig
- func (mm *MirrorManager) SetMirrors(mirrors []MirrorConfig)
- func (mm *MirrorManager) UpdateMirrorHealth(name string, healthy bool, responseTime time.Duration, err error)
- type ModuleDependencyInfo
- type ModuleInstaller
- type ParallelExecutor
- type PatchPerlOptions
- type PatchPerlResult
- type PerformanceComparison
- type PerlDistribution
- type PerlVersion
- type PlenvVersion
- type Progress
- type ProgressCallback
- type ProgressPool
- type Remote
- type RemoteList
- type ResolutionOptions
- type ResolutionSource
- type ResolvedVersion
- type ShellScriptData
- type ShellType
- type ShimInfo
- type ShimTemplate
- type ShimType
- type SystemInfo
- type SystemPerl
- type SystemPerlManager
- func (m *SystemPerlManager) CheckForUpdates() (bool, error)
- func (m *SystemPerlManager) DetectOrInstallPerl() (*SystemPerl, error)
- func (m *SystemPerlManager) GetAvailableDistributions() []PerlDistribution
- func (m *SystemPerlManager) GetPreferredDistributions() []PerlDistribution
- func (m *SystemPerlManager) InstallSystemPerl() (*SystemPerl, error)
- func (m *SystemPerlManager) ValidateInstallation(perl *SystemPerl) error
- type Task
- type TestSummary
- type TimedDuration
- type VersionInfo
- type VersionRegistry
Constants ¶
const ( ErrInvalidBinaryVersion = "501" // Invalid version format for binary download ErrBinaryDownloadFailed = "502" // Failed to download binary archive ErrBinaryChecksumFailed = "503" // Binary checksum validation failed ErrBinaryCacheFailed = "504" // Failed to cache downloaded binary ErrBinaryNotAvailable = "505" // Binary not available for platform ErrBinaryPlatformUnsupported = "506" // Platform not supported for binaries )
Binary download error codes
const ( DefaultBinaryRepo = "https://github.com/perigrin/pvm/releases/download" BinaryMaxRetries = 3 BinaryRetryDelay = 2 * time.Second DefaultChunkSize = 8 * 1024 * 1024 // 8MB chunks for parallel downloads ParallelDownloadThreshold = 50 * 1024 * 1024 // 50MB minimum for parallel downloads DefaultMaxBandwidth = 0 // 0 means unlimited ProgressReportInterval = 100 * time.Millisecond ChecksumBufferSize = 64 * 1024 // 64KB buffer for streaming checksum )
Binary download constants
const ( ErrCacheInitFailed = "601" // Failed to initialize cache ErrCacheOperFailed = "602" // Cache operation failed ErrCacheCorrupted = "603" // Cache is corrupted ErrCacheEntryInvalid = "604" // Cache entry is invalid )
Cache error codes
const ( DefaultCacheMaxAge = 30 * 24 * time.Hour // 30 days DefaultCacheMaxSize = 5 * 1024 * 1024 * 1024 // 5GB MetadataFileName = "metadata.json" )
Default cache configuration
const ( ErrExtractionFailed = "501" // Failed to extract source archive ErrBuildDirFailed = "502" // Failed to create build directory ErrConfigureFailed = "503" // Configure script failed ErrCompilationFailed = "504" // Compilation failed ErrTestFailed = "505" // Tests failed ErrInstallFailed = "506" // Installation failed ErrCleanupFailed = "507" // Cleanup failed ErrInvalidBuildOptions = "508" // Invalid build options ErrBuildCancelled = "509" // Build process was cancelled )
Build error codes
const ( ErrInvalidDownloadVersion = "401" // Invalid version format for download ErrDownloadFailed = "402" // Failed to download source archive ErrChecksumMismatch = "403" // Checksum validation failed ErrCacheFailed = "404" // Failed to cache downloaded file ErrInvalidMirror = "405" // Invalid or unreachable mirror ErrInvalidDestination = "406" // Invalid destination path )
Download error codes
const ( DefaultMirror = "https://www.cpan.org/src/5.0" MaxRetries = 3 RetryDelay = 3 * time.Second )
Default mirrors and other constants
const ( ErrInvalidForkIdentifier = "201" // Invalid fork identifier format ErrReservedRemoteName = "202" // Reserved remote name (e.g., "origin") ErrReservedForkName = "203" // Reserved fork name (e.g., "perl") )
Fork error codes
const ( ErrBinaryInstallFailed = "701" // Binary installation failed ErrBinaryExtractFailed = "702" // Binary extraction failed ErrBinaryVerifyFailed = "703" // Binary verification failed ErrBinaryPermissionFailed = "704" // Failed to set permissions )
Binary installation error codes
const ( ErrLegacyToolNotFound = "201" // Legacy tool installation not found ErrLegacyVersionNotFound = "202" // Specific version not found in legacy tool ErrLegacyImportFailed = "203" // Failed to import from legacy tool )
Legacy tool error codes
const ( MethodBinary = "binary" MethodSource = "source" MethodUnknown = "unknown" )
Installation method constants
const ( ErrMetricsStorageFailed = "901" // Failed to store metrics data ErrMetricsRetrievalFailed = "902" // Failed to retrieve metrics data ErrMetricsCorrupted = "903" // Metrics data is corrupted ErrMetricsCleanupFailed = "904" // Failed to cleanup old metrics )
Metrics error codes
const ( DefaultMetricsRetentionDays = 30 MetricsFilePrefix = "metrics-" MetricsFileSuffix = ".json" MaxMetricsFileSize = 1024 * 1024 // 1MB per metrics file )
Metrics configuration constants
const ( ErrMirrorConfigInvalid = "601" // Invalid mirror configuration ErrAllMirrorsFailed = "602" // All mirrors failed to respond ErrMirrorHealthCheckFail = "603" // Mirror health check failed ErrMirrorNotAvailable = "604" // Mirror temporarily unavailable )
Mirror configuration error codes
const ( MirrorTypeGitHubReleases = "github-releases" MirrorTypeJSDelivr = "jsdelivr" MirrorTypeCloudflareR2 = "cloudflare-r2" MirrorTypeDirectURL = "direct" )
Mirror types
const ( ErrPlenvNotAvailable = "401" // plenv command not available ErrPlenvCommandFailed = "402" // plenv command execution failed ErrPlenvNoVersions = "403" // no plenv versions available )
plenv integration error codes
const ( ErrRegistryIOFailed = "601" // Failed to read/write registry file ErrVersionNotFound = "602" // Requested version not found in registry ErrVersionExists = "603" // Version already exists in registry ErrInvalidRegistry = "604" // Invalid registry data format ErrUninstallFailed = "605" // Failed to uninstall version ErrVersionInvalid = "606" // Invalid version name ErrRegistryLockFailed = "607" // Failed to acquire registry lock )
Registry error codes
const ( ErrInvalidRemote = "204" // Invalid remote configuration ErrRemoteExists = "205" // Remote already exists ErrRemoteNotFound = "206" // Remote not found ErrReservedRemote = "207" // Reserved remote name )
Remote error codes
const ( ErrResolutionFailed = "301" // Failed to resolve Perl version ErrUnsatisfiedVersion = "302" // No available version satisfies constraints ErrNoVersionsAvailable = "303" // No Perl versions available )
Version resolution error codes
const ( ErrShellDetectionFailed = "501" // Failed to detect user shell ErrShellInitFailed = "502" // Failed to create shell initialization scripts ErrVersionSwitchFailed = "503" // Failed to switch Perl version ErrPerlVersionFileFailed = "504" // Failed to create .perl-version file ErrGlobalVersionSetFailed = "505" // Failed to set global Perl version ErrLocalVersionSetFailed = "506" // Failed to set local Perl version ErrUseVersionFailed = "507" // Failed to use specified Perl version ErrShellScriptFailed = "508" // Failed to generate shell script )
Shell-related error codes
const ( ErrShimCreationFailed = "401" // Failed to create shim ErrShimTemplateFailed = "402" // Failed to process shim template ErrShimExecutableFailed = "403" // Failed to make shim executable ErrShimDirectoryFailed = "404" // Failed to create shim directory ErrShimGenerationFailed = "405" // Failed to generate shims )
Shim-related error codes
const ( ErrNoSystemPerl = "001" // No system Perl found ErrVersionParseFail = "002" // Failed to parse Perl version ErrPerlExecFail = "003" // Failed to execute Perl ErrSystemPerlRegistrationFailed = "004" // Failed to register system Perl )
System Perl detection error codes
const ( ErrInstallationFailed = "004" // Perl installation failed ErrUnsupportedPlatform = "005" // Platform not supported for installation ErrInstallationTimeout = "006" // Installation timeout ErrDependencyMissing = "007" // Required dependency missing )
System Perl installation error codes
const ( ErrBinaryValidationFailed = "801" // Binary validation failed ErrBinaryExecutionFailed = "802" // Binary execution test failed ErrBinaryVersionMismatch = "803" // Binary version doesn't match expected ErrBinaryIncompleteInstall = "804" // Binary installation is incomplete )
Binary validation error codes
const ( ErrInvalidVersion = "101" // Invalid version string format ErrInvalidConstraint = "102" // Invalid constraint string format ErrUnsatisfiable = "103" // Unsatisfiable constraint ErrInvalidVersionAlias = "104" // Invalid version alias )
Version error codes
const (
ErrInvalidManifest = "208" // Invalid or incomplete fork manifest
)
Fork manifest error codes
Variables ¶
var ( DefaultMirrors = []MirrorConfig{ { Name: "GitHub Releases (Primary)", Type: MirrorTypeGitHubReleases, BaseURL: "https://github.com/example/pvm/releases/download", Priority: 1, Enabled: true, Timeout: 30 * time.Second, MaxRetries: 3, HealthCheck: "/perl-5.38.0/perl-5.38.0-linux-amd64.tar.gz", }, { Name: "jsDelivr CDN", Type: MirrorTypeJSDelivr, BaseURL: "https://cdn.jsdelivr.net/gh/example/pvm@releases", Priority: 2, Enabled: true, Timeout: 15 * time.Second, MaxRetries: 2, HealthCheck: "/perl-5.38.0/perl-5.38.0-linux-amd64.tar.gz", }, { Name: "Cloudflare R2 CDN", Type: MirrorTypeCloudflareR2, BaseURL: "https://pvm-binaries.example.com", Priority: 3, Enabled: false, Timeout: 20 * time.Second, MaxRetries: 2, HealthCheck: "/perl-5.38.0/perl-5.38.0-linux-amd64.tar.gz", }, } )
Default mirror configurations
var DetectSystemPerl = detectSystemPerlFunc
DetectSystemPerl is a variable that points to detectSystemPerlFunc, allowing it to be replaced in tests
var DownloadPerlBinaryFunc = doDownloadPerlBinary
DownloadPerlBinaryFunc holds the current implementation of DownloadPerlBinary It can be replaced with a mock for testing
var DownloadPerlSourceFunc = doDownloadPerlSource
DownloadPerlSourceFunc holds the current implementation of DownloadPerlSource It can be replaced with a mock for testing
var EnableEnhancedBuild = false
EnableEnhancedBuild enables the enhanced build system globally
var FindByDisplayName = findByDisplayNameFunc
FindByDisplayName is a variable that points to findByDisplayNameFunc, allowing it to be replaced in tests
var FindDotPerlVersionFiles = findDotPerlVersionFilesFunc
FindDotPerlVersionFiles is a variable that points to findDotPerlVersionFilesFunc, allowing it to be replaced in tests
var GenerateShimsFunc = GenerateShims
GenerateShimsFunc is a variable pointing to GenerateShims for easier mocking in tests
var GetInstalledVersions = getInstalledVersionsFunc
GetInstalledVersions is a variable that points to getInstalledVersionsFunc, allowing it to be replaced in tests
var GetVersionInfo = getVersionInfoFunc
GetVersionInfo is a variable that points to getVersionInfoFunc, allowing it to be replaced in tests
var IsVersionAvailable = isVersionAvailableFunc
IsVersionAvailable is a variable that points to isVersionAvailableFunc, allowing it to be replaced in tests
var IsVersionInstalled = isVersionInstalledFunc
IsVersionInstalled is a variable that points to isVersionInstalledFunc, allowing it to be replaced in tests
var LoadRegistry = loadRegistryFunc
LoadRegistry is a variable that points to loadRegistryFunc, allowing it to be replaced in tests
var OnVersionResolved func(version *ResolvedVersion)
OnVersionResolved is a callback that will be called when a version is resolved This can be used for logging or other purposes
var ParseVersion = parseVersionFunc
ParseVersion is a variable that points to parseVersionFunc, allowing it to be replaced in tests
var ReadPerlVersionFile = readPerlVersionFileFunc
ReadPerlVersionFile is a variable that points to readPerlVersionFileFunc, allowing it to be replaced in tests
var SaveRegistry = saveRegistryFunc
SaveRegistry is a variable that points to saveRegistryFunc, allowing it to be replaced in tests
var UninstallVersion = uninstallVersionFunc
UninstallVersion is a variable that points to uninstallVersionFunc, allowing it to be replaced in tests
var UninstallVersionByDisplayName = uninstallVersionByDisplayNameFunc
UninstallVersionByDisplayName is a variable that points to uninstallVersionByDisplayNameFunc, allowing it to be replaced in tests
var ValidateLibraryEnvironment = validateLibraryEnvironmentImpl
ValidateLibraryEnvironment is a variable pointing to validateLibraryEnvironmentImpl for easier mocking in tests
var ValidateVersion = validateVersionImpl
ValidateVersion is a variable pointing to validateVersionImpl for easier mocking in tests
Functions ¶
func ApplyPatchPerlSafely ¶
ApplyPatchPerlSafely is a convenience function that applies PatchPerl with error recovery
func AutoImportSystemPerl ¶
func AutoImportSystemPerl() error
AutoImportSystemPerl automatically imports system Perl into the registry This is used during first-run scenarios when no Perl versions are available
func CheckBinaryAvailability ¶
CheckBinaryAvailability checks if a binary is available for the specified version and platform
func CheckBinaryAvailabilityWithMirrors ¶
CheckBinaryAvailabilityWithMirrors checks binary availability using configured mirrors with failover
func CheckBinaryAvailabilityWithRepo ¶
CheckBinaryAvailabilityWithRepo checks binary availability with custom repo
func CheckBuildRequirements ¶
CheckBuildRequirements performs pre-build checks
func CheckGitAvailable ¶
func CheckGitAvailable() error
CheckGitAvailable returns nil if git is present in PATH, or a descriptive error otherwise.
func CheckShellInit ¶
CheckShellInit checks if the shell is properly initialized with PVM
func CompareBuilds ¶
func CompareBuilds(standard, enhanced *BuildResult) map[string]interface{}
CompareBuilds compares two build results for debugging
func CreateShellInitScripts ¶
func CreateShellInitScripts() error
CreateShellInitScripts generates shell initialization scripts for all supported shells
func DeduplicateRegistry ¶
DeduplicateRegistry loads the registry, removes duplicate entries, and saves it if any were removed. Returns the number of duplicates removed. Used by `pvm self doctor` to clean up registries that accumulated duplicates before RegisterVersion became idempotent (#471).
func FindBestMatch ¶
FindBestMatch finds the best version that satisfies the constraints Returns the highest matching version from the available versions
func FindStrawberryRelease ¶
FindStrawberryRelease queries the GitHub releases API for the StrawberryPerl repository and returns the download URL of the 64-bit portable zip for the given 3-part Perl version (e.g. "5.38.2").
func GenerateBinaryURL ¶
GenerateBinaryURL generates the URL for a Perl binary archive
func GenerateBinaryURLWithRepo ¶
GenerateBinaryURLWithRepo generates the URL for a Perl binary archive with custom repo
func GenerateShellScript ¶
func GenerateShellScript(shellType ShellType, data ShellScriptData) (string, error)
GenerateShellScript creates initialization script for a specific shell
func GenerateShellUse ¶
GenerateShellUse outputs shell commands to set up the environment for a specific Perl version and optional library. When version is "system", PVM_PERL_VERSION (and PVM_PERL_LIBRARY when no library is given) are unset so the resolver falls back to the system Perl.
The output is eval'd by the shell integration templates. Callers are responsible for refreshing PATH afterward (the templates call _pvm_update_perl_path) — this function does not touch PATH.
func GenerateShims ¶
func GenerateShims() error
GenerateShims creates shims for all standard Perl commands This includes perl itself and standard utilities like cpan, prove, etc.
func GenerateSourceURL ¶
GenerateSourceURL generates the URL for a Perl source archive
func GetAvailableBinaryPlatforms ¶
GetAvailableBinaryPlatforms returns a list of available platforms for a given version
func GetAvailableBinaryPlatformsWithRepo ¶
GetAvailableBinaryPlatformsWithRepo returns available platforms with custom repo
func GetAvailableVersions ¶
GetAvailableVersions returns a list of all available versions This includes installed versions and potentially downloadable versions
func GetCurrentPerlPath ¶
GetCurrentPerlPath returns the path to the current Perl executable
func GetCurrentShellScript ¶
GetCurrentShellScript generates shell script to be evaluated for the command: eval "$(pvm shell)"
func GetPatchPerlInfo ¶
GetPatchPerlInfo returns information about the available PatchPerl installation
func GetPathConfigCommand ¶
GetPathConfigCommand returns a shell command to add the shim directory to PATH
func GetPerlbrewAliases ¶
GetPerlbrewAliases returns a map of perlbrew aliases
func GetPlatformSpecificNotes ¶
func GetPlatformSpecificNotes() string
GetPlatformSpecificNotes returns platform-specific build notes
func GetShellCompletionCommand ¶
GetShellCompletionCommand returns a command to enable shell completion for PVM
func GetShellInitCommand ¶
GetShellInitCommand returns a command to initialize PVM in the current shell
func GetShellInitInstructions ¶
GetShellInitInstructions returns instructions for initializing PVM in the given shell
func GetShimCommand ¶
GetShimCommand returns the actual command that should be executed This is used by the shim itself to execute the correct Perl version
func GetSystemPerlVersion ¶
GetSystemPerlVersion executes a Perl command and returns its version
func GetSystemVersionString ¶
GetSystemVersionString returns the version of the system Perl as a string
func ImportSystemPerl ¶
func ImportSystemPerl() error
ImportSystemPerl imports the system Perl into the registry
func InstallPatchPerl ¶
InstallPatchPerl installs Devel::PatchPerl using the configured module installer
func IsPatchPerlAvailable ¶
func IsPatchPerlAvailable() bool
IsPatchPerlAvailable checks if Devel::PatchPerl is available via system perl
func IsShimDirectory ¶
IsShimDirectory checks if a given directory is the PVM shim directory
func PrintAutoImportResults ¶
func PrintAutoImportResults(results *AutoImportResults)
PrintAutoImportResults prints the results of auto-import to stderr This ensures the output doesn't interfere with shell eval
func RebuildRegistry ¶
func RebuildRegistry() error
RebuildRegistry scans the versions directory and rebuilds the registry from existing installations
func RegisterVersion ¶
func RegisterVersion(versionInfo VersionInfo) error
RegisterVersion adds a new Perl version to the registry
func RegisterVersionAfterBuild ¶
func RegisterVersionAfterBuild(buildResult *BuildResult, source string) error
RegisterVersionAfterBuild registers a version after successful build
func Rehash ¶
func Rehash() error
Rehash rebuilds all shim executables This should be called after installing or uninstalling Perl versions
func RemoveAllShims ¶
func RemoveAllShims() error
RemoveAllShims removes all shim files from the shim directory
func ResolveLatestDevVersion ¶
ResolveLatestDevVersion returns the latest development Perl version
func ResolveLatestStableVersion ¶
ResolveLatestStableVersion returns the latest stable Perl version Fetches from MetaCPAN API dynamically
func ResolveLatestVersion ¶
ResolveLatestVersion returns the latest Perl version (stable or dev)
func ResolveVersionAlias ¶
ResolveVersionAlias resolves a version alias to an actual version Uses the provided map of aliases (from configuration) Accepts aliases with or without the "@" prefix (e.g. "latest" or "@latest")
func SetGlobalVersion ¶
SetGlobalVersion sets the global default Perl version
func SetLocalVersion ¶
SetLocalVersion sets the local Perl version for a project
func SetModuleInstaller ¶
func SetModuleInstaller(installer ModuleInstaller)
SetModuleInstaller allows other packages to provide module installation functionality
func ShouldAutoImport ¶
func ShouldAutoImport() bool
ShouldAutoImport checks if auto-import should be performed Returns true if this is the first time pvm init is being run
func ShouldUsePatchPerl ¶
ShouldUsePatchPerl determines if PatchPerl should be used for a given Perl version
func SwitchVersion ¶
SwitchVersion sets the Perl version for the given scope
func UnsetGlobalVersion ¶
func UnsetGlobalVersion() error
UnsetGlobalVersion sets the global version to "system" to fall back to system Perl
func UnsetLocalVersion ¶
func UnsetLocalVersion() error
UnsetLocalVersion removes the local Perl version for the current directory
func UseVersion ¶
UseVersion sets the Perl version for the current shell session
func ValidateBinaryInstallation ¶
ValidateBinaryInstallation validates a binary Perl installation
func ValidateDirectoryStructure ¶
ValidateDirectoryStructure checks if the installation has the expected directory structure
func ValidateExpectedVersion ¶
ValidateExpectedVersion checks if the installed version matches the expected version
func ValidatePatchPerlEnvironment ¶
func ValidatePatchPerlEnvironment() error
ValidatePatchPerlEnvironment checks if the environment is suitable for PatchPerl
func VerifyMirror ¶
VerifyMirror checks if a mirror is accessible
Types ¶
type ArchiveExtractor ¶
type ArchiveExtractor struct {
// contains filtered or unexported fields
}
ArchiveExtractor handles archive extraction with progress
func NewArchiveExtractor ¶
func NewArchiveExtractor(logger *log.Logger) *ArchiveExtractor
NewArchiveExtractor creates a new archive extractor
func (*ArchiveExtractor) ExtractWithProgress ¶
func (ae *ArchiveExtractor) ExtractWithProgress( archivePath string, destDir string, ctx context.Context, progressCb func(current, total int64), ) (string, error)
ExtractWithProgress extracts an archive with progress reporting
type AutoImportResults ¶
type AutoImportResults struct {
// Plenv imports
PlenvImports []ImportResult
// Perlbrew imports
PerlbrewImports []ImportResult
// Total number of versions imported
TotalImported int
// Default version that was set (if any)
DefaultVersion string
}
AutoImportResults represents the results of automatic import during init
func AutoImportLegacyVersions ¶
func AutoImportLegacyVersions() (*AutoImportResults, error)
AutoImportLegacyVersions automatically detects and imports legacy tool installations This is designed to be called during `pvm init` to provide seamless migration
type BinaryBenchmarkResults ¶
type BinaryBenchmarkResults struct {
// Time to start Perl and print version
StartupTime time.Duration
// Time to execute a simple script
SimpleScriptTime time.Duration
// Time to load a common module
ModuleLoadTime time.Duration
}
BinaryBenchmarkResults contains performance benchmark data
type BinaryCache ¶
type BinaryCache struct {
// contains filtered or unexported fields
}
BinaryCache manages local caching of Perl binaries
func NewBinaryCache ¶
func NewBinaryCache() (*BinaryCache, error)
NewBinaryCache creates a new binary cache instance
func (*BinaryCache) CleanByAge ¶
func (bc *BinaryCache) CleanByAge(maxAge time.Duration) (int, error)
CleanByAge removes cache entries older than the specified duration
func (*BinaryCache) CleanBySize ¶
func (bc *BinaryCache) CleanBySize(maxSize int64) (int, error)
CleanBySize removes oldest entries to keep total cache size under the limit
func (*BinaryCache) Get ¶
func (bc *BinaryCache) Get(version, platform string) (*BinaryCacheResult, error)
Get retrieves a binary from the cache if it exists
func (*BinaryCache) List ¶
func (bc *BinaryCache) List() ([]*BinaryCacheEntry, error)
List returns all cached binary entries
func (*BinaryCache) Put ¶
func (bc *BinaryCache) Put(sourcePath string, entry *BinaryCacheEntry) (string, error)
Put stores a binary in the cache
type BinaryCacheEntry ¶
type BinaryCacheEntry struct {
// Version of the Perl binary
Version string `json:"version"`
// Platform triple (e.g., "linux-amd64")
Platform string `json:"platform"`
// SHA-256 checksum of the binary file
Checksum string `json:"checksum"`
// Size of the binary file in bytes
Size int64 `json:"size"`
// Original download URL
DownloadURL string `json:"download_url"`
// When the binary was cached
CachedAt time.Time `json:"cached_at"`
// Last access time (for LRU cleanup)
LastAccessed time.Time `json:"last_accessed"`
}
BinaryCacheEntry represents metadata for a cached binary
type BinaryCacheResult ¶
type BinaryCacheResult struct {
// Path to the cached binary file
Path string
// Cache entry metadata
Entry *BinaryCacheEntry
}
BinaryCacheResult represents a cache hit result
type BinaryDownloadOptions ¶
type BinaryDownloadOptions struct {
// Version to download
Version string
// Platform triple (e.g., "linux-amd64", "darwin-arm64")
Platform string
// Progress callback function (legacy)
ProgressCallback ProgressCallback
// Enhanced progress callback function
EnhancedProgressCallback EnhancedProgressCallback
// Maximum number of retries for failed downloads
MaxRetries int
// Skip checksum validation
SkipChecksum bool
// Skip using cache
SkipCache bool
// Context for cancellation
Context context.Context
// Custom repository URL (defaults to GitHub Releases)
RepoURL string
// Enable resumable downloads
EnableResume bool
// Enable parallel chunk downloads for large files
EnableParallel bool
// Chunk size for parallel downloads (bytes)
ChunkSize int64
// Maximum download bandwidth (bytes per second, 0 = unlimited)
MaxBandwidth int64
// Verify checksum during transfer (streaming validation)
StreamingChecksum bool
// DirectURL overrides URL generation and downloads from this exact URL.
// When set, RepoURL and Platform are not used for URL construction.
DirectURL string
}
BinaryDownloadOptions contains options for downloading Perl binaries
type BinaryDownloadResult ¶
type BinaryDownloadResult struct {
// Path to the downloaded binary archive
Path string
// Version of the downloaded Perl binary
Version string
// Platform triple
Platform string
// Size of the downloaded file in bytes
Size int64
// Checksum of the downloaded file
Checksum string
// Whether the file was loaded from cache
FromCache bool
// Time taken to download
Duration time.Duration
// Whether download was resumed
Resumed bool
// Number of bytes already downloaded when resuming
ResumedBytes int64
// Whether parallel downloading was used
ParallelDownload bool
// Number of chunks used for parallel download
ChunkCount int
// Average download speed in bytes per second
AverageSpeed int64
// Whether streaming checksum validation was used
StreamingChecksumUsed bool
}
BinaryDownloadResult contains information about the downloaded binary
func DownloadPerlBinary ¶
func DownloadPerlBinary(options *BinaryDownloadOptions) (*BinaryDownloadResult, error)
DownloadPerlBinary downloads a Perl binary archive for the specified version and platform
type BinaryInstallOptions ¶
type BinaryInstallOptions struct {
// Version to install
Version string
// Platform triple (e.g., "linux-amd64", "darwin-arm64")
Platform string
// Installation directory (if empty, uses default)
InstallDir string
// Progress callback function
ProgressCallback ProgressCallback
// Context for cancellation
Context context.Context
// Skip checksum validation
SkipChecksum bool
// Custom repository URL
RepoURL string
// Metrics collector for tracking installation performance (optional)
MetricsCollector *MetricsCollector
// StrawberryURL is the download URL for Strawberry Perl portable zip.
// When set, download from this URL instead of the PVM binary mirror.
// Only used on Windows.
StrawberryURL string
}
BinaryInstallOptions contains options for binary installation
type BinaryInstallResult ¶
type BinaryInstallResult struct {
// Version that was installed
Version string
// Platform that was installed
Platform string
// Installation path
InstallPath string
// Size of the installed files in bytes
Size int64
// Time taken to install
Duration time.Duration
// Whether installation was from cache
FromCache bool
}
BinaryInstallResult contains information about the binary installation
func InstallFromBinary ¶
func InstallFromBinary(options *BinaryInstallOptions) (*BinaryInstallResult, error)
InstallFromBinary installs Perl from a pre-compiled binary
type BinaryValidationResult ¶
type BinaryValidationResult struct {
// Whether the installation is valid
Valid bool
// List of validation warnings (non-fatal issues)
Warnings []string
// Detected Perl version
DetectedVersion string
// Path to the Perl executable
PerlExecutable string
// Installation completeness score (0.0 to 1.0)
CompletenessScore float64
// Performance benchmark results (if requested)
BenchmarkResults *BinaryBenchmarkResults
}
BinaryValidationResult contains the results of binary installation validation
func ValidateBinaryInstallationDetailed ¶
func ValidateBinaryInstallationDetailed(installPath string, includeBenchmarks bool) (*BinaryValidationResult, error)
ValidateBinaryInstallationDetailed performs comprehensive validation of a binary installation
type BuildArtifactCache ¶
type BuildArtifactCache struct {
// contains filtered or unexported fields
}
BuildArtifactCache manages compiled object files for incremental builds
func NewBuildArtifactCache ¶
func NewBuildArtifactCache(baseDir string) (*BuildArtifactCache, error)
NewBuildArtifactCache creates a new artifact cache
func (*BuildArtifactCache) GetArtifact ¶
func (bac *BuildArtifactCache) GetArtifact(relPath string) ([]byte, error)
GetArtifact retrieves a build artifact
func (*BuildArtifactCache) HasArtifact ¶
func (bac *BuildArtifactCache) HasArtifact(relPath string) bool
HasArtifact checks if an artifact exists
func (*BuildArtifactCache) SaveArtifact ¶
func (bac *BuildArtifactCache) SaveArtifact(relPath string, data []byte) error
SaveArtifact saves a build artifact
type BuildCache ¶
type BuildCache struct {
// contains filtered or unexported fields
}
BuildCache manages cached build information
func NewBuildCache ¶
func NewBuildCache() (*BuildCache, error)
NewBuildCache creates a new build cache
func (*BuildCache) CleanOldEntries ¶
func (bc *BuildCache) CleanOldEntries(maxAge time.Duration) error
CleanOldEntries removes cache entries older than specified duration
func (*BuildCache) GetCachedBuild ¶
func (bc *BuildCache) GetCachedBuild(version string, options *BuildOptions) (*BuildResult, bool)
GetCachedBuild retrieves a cached build if available
func (*BuildCache) GetConfigCache ¶
func (bc *BuildCache) GetConfigCache(version string) (map[string]string, bool)
GetConfigCache retrieves cached configure results
func (*BuildCache) SaveBuild ¶
func (bc *BuildCache) SaveBuild(version string, options *BuildOptions, result *BuildResult, configCache map[string]string) error
SaveBuild saves a build to the cache
type BuildContext ¶
type BuildContext struct {
Options *BuildOptions
StartTime time.Time
SourceFile string
BuildDir string
SourceDir string
InstallDir string
SystemDeps *DependencyInfo
ConfigCache map[string]string
BuildArtifacts []string
Logger *log.Logger
}
BuildContext holds the context for a build operation
func (*BuildContext) Cleanup ¶
func (ctx *BuildContext) Cleanup()
Cleanup cleans up the build context
func (*BuildContext) ToBuildResult ¶
func (ctx *BuildContext) ToBuildResult() *BuildResult
ToBuildResult converts context to build result
type BuildManager ¶
type BuildManager struct {
// contains filtered or unexported fields
}
BuildManager manages the enhanced build process
func NewBuildManager ¶
func NewBuildManager(logger *log.Logger) (*BuildManager, error)
NewBuildManager creates a new enhanced build manager
func (*BuildManager) BuildEnhanced ¶
func (bm *BuildManager) BuildEnhanced(options *BuildOptions) (*BuildResult, error)
BuildEnhanced performs an enhanced build with all improvements
type BuildOptions ¶
type BuildOptions struct {
// Version to build (used to identify source archive)
Version string
// SourceFile is the path to the source archive
// If empty, the archive will be located or downloaded
SourceFile string
// InstallDir is the directory where Perl will be installed
// If empty, a default location will be used
InstallDir string
// BuildJobs is the number of parallel jobs to use during compilation
// If 0, a default value based on CPU count will be used
BuildJobs int
// RunTests indicates whether to run the test suite
RunTests bool
// BuildDir is the directory for temporary build files
// If empty, a default location will be used
BuildDir string
// ConfigureOptions contains additional options to pass to the Configure script
ConfigureOptions []string
// CleanupBuildDir indicates whether to clean up the build directory after installation
CleanupBuildDir bool
// BuildOnly indicates whether to build without installing (creates relocatable build)
BuildOnly bool
// ReleaseBuild indicates this is a release/--upload build where any
// failure to make binaries relocatable is fatal. Local builds where
// build prefix equals install prefix work fine with the baked-in
// RPATH; release tarballs ship to other machines and must not.
ReleaseBuild bool
// ProgressCallback is called to report progress
ProgressCallback BuildProgressCallback `json:"-"`
// Context for cancellation
Context context.Context `json:"-"`
// TestTimeout is the timeout for running tests
TestTimeout time.Duration
// AllowTestFailures allows build to continue even if tests fail
AllowTestFailures bool
// ForceRebuild forces a rebuild even if cached
ForceRebuild bool
// MaxRetries is the maximum number of retries for build steps
MaxRetries int
// SkipChecksum indicates whether to skip checksum validation during download
SkipChecksum bool
// Mirror is the mirror URL to use for downloading (optional)
Mirror string
// SkipCache indicates whether to skip using cached downloads
SkipCache bool
// Verbose enables verbose output
Verbose bool
// NoPatchPerl disables automatic Devel::PatchPerl patching
NoPatchPerl bool
// SourceDir is a local directory containing perl source (from git clone); skips download when set
SourceDir string
}
BuildOptions contains options for building Perl
func MigrateToEnhancedBuild ¶
func MigrateToEnhancedBuild(options *BuildOptions) *BuildOptions
MigrateToEnhancedBuild migrates existing build configurations to enhanced format
func OptimizeBuildOptions ¶
func OptimizeBuildOptions(options *BuildOptions) *BuildOptions
OptimizeBuildOptions optimizes build options based on system capabilities
type BuildProgressCalculator ¶
type BuildProgressCalculator struct {
// contains filtered or unexported fields
}
BuildProgressCalculator handles progress calculation across build stages
func NewBuildProgressCalculator ¶
func NewBuildProgressCalculator() *BuildProgressCalculator
NewBuildProgressCalculator creates a new progress calculator
func (*BuildProgressCalculator) GetOverallProgress ¶
func (calc *BuildProgressCalculator) GetOverallProgress() float64
GetOverallProgress calculates the overall progress across all stages
func (*BuildProgressCalculator) ParseMakeProgress ¶
func (calc *BuildProgressCalculator) ParseMakeProgress(line string) bool
ParseMakeProgress attempts to parse progress from make output
func (*BuildProgressCalculator) SetStage ¶
func (calc *BuildProgressCalculator) SetStage(stage BuildProgressStage)
SetStage sets the current stage and resets stage progress
func (*BuildProgressCalculator) UpdateLineBasedProgress ¶
func (calc *BuildProgressCalculator) UpdateLineBasedProgress()
UpdateLineBasedProgress updates progress based on line count
func (*BuildProgressCalculator) UpdateStageProgress ¶
func (calc *BuildProgressCalculator) UpdateStageProgress(progress float64)
UpdateStageProgress updates progress within the current stage
func (*BuildProgressCalculator) UpdateTimeBasedProgress ¶
func (calc *BuildProgressCalculator) UpdateTimeBasedProgress()
UpdateTimeBasedProgress updates progress based on elapsed time
type BuildProgressCallback ¶
type BuildProgressCallback func(stage BuildProgressStage, details string, progress float64)
BuildProgressCallback is called to report progress during the build process
type BuildProgressStage ¶
type BuildProgressStage int
BuildProgressStage represents a stage in the build process
const ( // Build stages StageExtract BuildProgressStage = iota StageConfigure StageCompile StageTest StageInstall StageCleanup StageDone )
const (
StageDownload BuildProgressStage = iota - 1 // Before extract
)
Additional build stages
func (BuildProgressStage) String ¶
func (s BuildProgressStage) String() string
String returns a string representation of the build stage
type BuildReport ¶
type BuildReport struct {
Result *BuildResult
SystemInfo SystemInfo
Dependencies *DependencyInfo
ConfigureOutput string
TestResults TestSummary
Warnings []string
Errors []error
}
BuildReport generates a detailed build report
func GenerateBuildReport ¶
func GenerateBuildReport(ctx *BuildContext, result *BuildResult) *BuildReport
GenerateBuildReport creates a detailed report of the build process
type BuildResult ¶
type BuildResult struct {
// Version that was built
Version string
// InstallPath is the path where Perl was installed
InstallPath string
// BuildPath is the path where Perl was built
BuildPath string
// Duration is the total time taken to build
Duration time.Duration
// Stages contains timing information for each stage
Stages map[BuildProgressStage]time.Duration
// Timestamp is when the build started
Timestamp time.Time
}
BuildResult contains information about the build
func BuildPerl ¶
func BuildPerl(options *BuildOptions) (*BuildResult, error)
BuildPerl builds and installs Perl from source
func BuildPerlEnhanced ¶
func BuildPerlEnhanced(options *BuildOptions) (*BuildResult, error)
BuildPerlEnhanced is the main entry point for the enhanced build system It provides a compatible interface with the existing BuildPerl function
func BuildPerlWithFallback ¶
func BuildPerlWithFallback(options *BuildOptions) (*BuildResult, error)
BuildPerlWithFallback attempts enhanced build with fallback to original
type CacheEntry ¶
type CacheEntry struct {
Version string `json:"version"`
BuildHash string `json:"build_hash"`
ConfigureFlags []string `json:"configure_flags"`
SystemInfo SystemInfo `json:"system_info"`
BuildResult *BuildResult `json:"build_result"`
Timestamp time.Time `json:"timestamp"`
ConfigCache map[string]string `json:"config_cache"`
}
CacheEntry represents a cached build
type ChecksumDatabase ¶
type ChecksumDatabase struct {
// contains filtered or unexported fields
}
ChecksumDatabase stores known checksums for Perl releases
func NewChecksumDatabase ¶
func NewChecksumDatabase() (*ChecksumDatabase, error)
NewChecksumDatabase creates a new checksum database
func (*ChecksumDatabase) AddChecksum ¶
func (db *ChecksumDatabase) AddChecksum(version, checksum string)
AddChecksum adds a checksum for a version
func (*ChecksumDatabase) GetChecksum ¶
func (db *ChecksumDatabase) GetChecksum(version string) (string, error)
GetChecksum returns the checksum for a version First checks embedded checksums, then falls back to CPAN lookup
func (*ChecksumDatabase) UpdateChecksums ¶
func (db *ChecksumDatabase) UpdateChecksums() error
UpdateChecksums updates the checksum database from CPAN
type CloneCache ¶
type CloneCache struct {
// contains filtered or unexported fields
}
CloneCache manages cached bare git clones for fork remote repositories. Each remote gets its own bare clone under <cacheDir>/remotes/<remote_name>/.
func NewCloneCache ¶
func NewCloneCache(cacheDir string) *CloneCache
NewCloneCache creates a CloneCache rooted at cacheDir. The caller is responsible for ensuring cacheDir is the PVM cache directory (e.g. $XDG_CACHE_HOME/pvm).
func (*CloneCache) CheckoutTag ¶
func (cc *CloneCache) CheckoutTag(remoteName, tag, destDir string) error
CheckoutTag checks out a specific tag from the cached bare clone into destDir. destDir must already exist (or will be created). The result is a working tree containing the files from that tag's commit.
func (*CloneCache) EnsureClone ¶
func (cc *CloneCache) EnsureClone(remote Remote) (string, error)
EnsureClone guarantees a cached bare clone exists for the remote. On the first call it runs "git clone --bare --no-single-branch <url> <dir>". On subsequent calls (cache already present) it runs "git fetch --tags". Returns the path to the bare clone directory.
func (*CloneCache) ListTags ¶
func (cc *CloneCache) ListTags(remoteName string) ([]string, error)
ListTags returns all tag names from the cached bare clone for the named remote. The cache must already exist (call EnsureClone first).
func (*CloneCache) RemoveCache ¶
func (cc *CloneCache) RemoveCache(remoteName string) error
RemoveCache deletes the cached bare clone for the named remote. Returns an error if the cache directory does not exist.
type CommandRunner ¶
type CommandRunner struct {
// contains filtered or unexported fields
}
CommandRunner runs commands with enhanced error handling and output capture
func NewCommandRunner ¶
func NewCommandRunner(logger *log.Logger) *CommandRunner
NewCommandRunner creates a new command runner
type Constraint ¶
type Constraint struct {
Operator string // >, <, >=, <=, ==, =, ~>
Version PerlVersion
}
Constraint represents a version constraint with an operator and version
func ParseConstraint ¶
func ParseConstraint(constraint string) (Constraint, error)
ParseConstraint parses a constraint string (e.g., ">=5.32.0")
func (Constraint) Satisfies ¶
func (c Constraint) Satisfies(version PerlVersion) bool
Satisfies checks if a version satisfies a constraint
func (Constraint) String ¶
func (c Constraint) String() string
String returns the string representation of the constraint
type ConstraintSet ¶
type ConstraintSet []Constraint
ConstraintSet is a collection of constraints that must all be satisfied
func ParseConstraintSet ¶
func ParseConstraintSet(constraints string) (ConstraintSet, error)
ParseConstraintSet parses a comma-separated set of constraints
func (ConstraintSet) Satisfies ¶
func (cs ConstraintSet) Satisfies(version PerlVersion) bool
Satisfies checks if a version satisfies all constraints in the set
func (ConstraintSet) String ¶
func (cs ConstraintSet) String() string
String returns the string representation of the constraint set
type DefaultModuleInstaller ¶
type DefaultModuleInstaller struct{}
Default module installer that provides user guidance
func (*DefaultModuleInstaller) InstallModule ¶
func (d *DefaultModuleInstaller) InstallModule(moduleName string, verbose bool) error
type DependencyChecker ¶
type DependencyChecker struct {
// contains filtered or unexported fields
}
DependencyChecker checks for system dependencies
func NewDependencyChecker ¶
func NewDependencyChecker() (*DependencyChecker, error)
NewDependencyChecker creates a new dependency checker
func (*DependencyChecker) CheckBuildDependencies ¶
func (dc *DependencyChecker) CheckBuildDependencies() (*DependencyInfo, error)
CheckBuildDependencies checks for required build dependencies
func (*DependencyChecker) CheckModuleDependencies ¶
func (dc *DependencyChecker) CheckModuleDependencies(modules []string) (*ModuleDependencyInfo, error)
CheckModuleDependencies checks for Perl module dependencies
type DependencyInfo ¶
type DependencyInfo struct {
Required []string // Required dependencies that are present
Missing []string // Required dependencies that are missing
Optional []string // Optional dependencies that are missing
InstallHint map[string]string // Platform-specific install hints
}
DependencyInfo contains information about system dependencies
type DiscoveredVersion ¶
type DiscoveredVersion struct {
// Tag is the raw git tag string.
Tag string
// Version is the parsed PerlVersion extracted from the tag.
Version PerlVersion
// ForkName is the fork name prefix found in the tag (e.g. "myfork" from "myfork-5.40.2").
// Empty for standard tags like "v5.40.2".
ForkName string
}
DiscoveredVersion represents a perl version found by scanning git tags on a remote.
func ListRemoteVersions ¶
func ListRemoteVersions(remote Remote, cacheDir string) ([]DiscoveredVersion, error)
ListRemoteVersions fetches (or refreshes) the cached bare clone for remote and returns all tags that match a Perl version pattern. Non-version tags are silently ignored.
type DownloadOptions ¶
type DownloadOptions struct {
// Mirror URL to use
Mirror string
// Version to download
Version string
// Progress callback function
ProgressCallback ProgressCallback
// Maximum number of retries for failed downloads
MaxRetries int
// Skip checksum validation
SkipChecksum bool
// Skip using cache
SkipCache bool
// Context for cancellation
Context context.Context
}
DownloadOptions contains options for downloading Perl source
type DownloadProgress ¶
type DownloadProgress struct {
// Total size in bytes
Total int64
// Bytes transferred so far
Transferred int64
// Current download speed in bytes per second
Speed int64
// Estimated time to completion
ETA time.Duration
// Whether download is complete
Done bool
// Number of active chunks (for parallel downloads)
ActiveChunks int
// Current chunk being downloaded (for parallel downloads)
CurrentChunk int
}
DownloadProgress contains detailed progress information
type DownloadResult ¶
type DownloadResult struct {
// Path to the downloaded file
Path string
// Version of the downloaded Perl source
Version string
// Size of the downloaded file in bytes
Size int64
// Checksum of the downloaded file
Checksum string
// Whether the file was loaded from cache
FromCache bool
// Time taken to download
Duration time.Duration
}
DownloadResult contains information about the downloaded source
func DownloadPerlSource ¶
func DownloadPerlSource(options *DownloadOptions) (*DownloadResult, error)
DownloadPerlSource downloads a Perl source archive for the specified version
type EnhancedProgressCallback ¶
type EnhancedProgressCallback func(progress DownloadProgress)
EnhancedProgressCallback is a function that reports enhanced download progress
type FileHasher ¶
type FileHasher struct {
// contains filtered or unexported fields
}
FileHasher computes file hashes for verification
func (*FileHasher) HashDirectory ¶
func (fh *FileHasher) HashDirectory(dir string) (string, error)
HashDirectory computes hash of directory contents
type ForkIdentifier ¶
type ForkIdentifier struct {
Remote string // Remote name (e.g., "mycompany"), defaults to "origin"
ForkName string // Fork name (e.g., "myfork"), may be empty
BaseVersion string // Base Perl version (e.g., "5.40.2")
}
ForkIdentifier represents a parsed fork identifier with remote, fork name, and version
func ParseForkIdentifier ¶
func ParseForkIdentifier(input string) (*ForkIdentifier, error)
ParseForkIdentifier parses a fork identifier string into its components. Supported forms:
- "remote/fork@version" -> Remote=remote, ForkName=fork, BaseVersion=version
- "remote/version" -> Remote=remote, ForkName="", BaseVersion=version
- "version" -> Remote="origin", ForkName="", BaseVersion=version
func (*ForkIdentifier) DisplayName ¶
func (f *ForkIdentifier) DisplayName() string
DisplayName returns the human-readable display name for this fork identifier. Uses "-" as separator between fork name and version (input uses "@").
func (*ForkIdentifier) InstallPath ¶
func (f *ForkIdentifier) InstallPath() string
InstallPath returns the path segment used for installing this fork.
func (*ForkIdentifier) IsFork ¶
func (f *ForkIdentifier) IsFork() bool
IsFork returns true if this identifier refers to a non-origin fork.
type ForkManifest ¶
type ForkManifest struct {
Name string // Fork product name (required, cannot be "perl")
Description string // Human-readable description
BaseVersion string // Upstream perl version this derives from (required)
License string // License identifier
ConfigureFlags []string // Additional Configure flags for building
}
ForkManifest holds metadata parsed from a .pvm-fork.toml file in a fork repo
func ParseForkManifest ¶
func ParseForkManifest(dir string) (*ForkManifest, error)
ParseForkManifest reads and validates a .pvm-fork.toml file from the given directory. Returns nil without error if the manifest file does not exist.
type ImportResult ¶
type ImportResult struct {
// Version that was imported
Version string
// Source tool (plenv or perlbrew)
Source LegacyToolType
// Path to the original installation
OriginalPath string
// Path to the symlink created by PVM
SymlinkPath string
// Whether this was set as default
WasDefault bool
}
ImportResult represents the result of an import operation
type InstallationMetrics ¶
type InstallationMetrics struct {
// Timestamp when installation started
Timestamp time.Time `json:"timestamp"`
// Installation method (binary or source)
Method string `json:"method"`
// Perl version being installed
Version string `json:"version"`
// Platform triple (e.g., "linux-amd64")
Platform string `json:"platform"`
// Whether installation succeeded
Success bool `json:"success"`
// Generic error type (no sensitive details)
ErrorType string `json:"error_type,omitempty"`
// Non-sensitive error message for analytics
ErrorMessage string `json:"-"` // Not serialized to maintain privacy
// Timing information
InstallStartTime time.Time `json:"install_start_time"`
TotalTime TimedDuration `json:"total_time"`
DownloadTime TimedDuration `json:"download_time"`
// Download metrics
DownloadSize int64 `json:"download_size"`
DownloadSuccess bool `json:"download_success"`
// Performance metadata (no sensitive information)
CacheHit bool `json:"cache_hit"`
ParallelDownload bool `json:"parallel_download"`
ResumedDownload bool `json:"resumed_download"`
}
InstallationMetrics contains comprehensive metrics for a single installation
func NewInstallationMetrics ¶
func NewInstallationMetrics() *InstallationMetrics
NewInstallationMetrics creates a new installation metrics instance
func (*InstallationMetrics) Complete ¶
func (m *InstallationMetrics) Complete(success bool, errorMsg *string)
Complete finalizes the installation metrics
func (*InstallationMetrics) RecordDownloadPhase ¶
func (m *InstallationMetrics) RecordDownloadPhase(size int64, success bool)
RecordDownloadPhase records download timing and metrics
func (*InstallationMetrics) StartDownloadPhase ¶
func (m *InstallationMetrics) StartDownloadPhase()
StartDownloadPhase marks the beginning of the download phase
func (*InstallationMetrics) ToMap ¶
func (m *InstallationMetrics) ToMap() map[string]interface{}
ToMap converts metrics to a map for serialization (privacy-safe)
type LegacyPerl ¶
type LegacyPerl struct {
// Path to the Perl installation
Path string
// Version string
Version string
// Source tool (plenv or perlbrew)
Source LegacyToolType
// Is this the tool's current/default version?
IsDefault bool
// InstallTime is when the version was installed (derived from directory mtime)
InstallTime time.Time
}
LegacyPerl represents a Perl installation from a legacy tool
func DetectPerlbrew ¶
func DetectPerlbrew() ([]LegacyPerl, error)
DetectPerlbrew checks for perlbrew installations and returns their paths
func DetectPlenv ¶
func DetectPlenv() ([]LegacyPerl, error)
DetectPlenv checks for plenv installations and returns their paths
func ImportFromLegacyTool ¶
func ImportFromLegacyTool(toolType LegacyToolType) ([]LegacyPerl, error)
ImportFromLegacyTool imports Perl installations from a legacy tool
type LegacyToolType ¶
type LegacyToolType string
LegacyToolType represents the type of legacy Perl version manager
const ( Plenv LegacyToolType = "plenv" Perlbrew LegacyToolType = "perlbrew" )
type MetricsCollector ¶
type MetricsCollector struct {
// contains filtered or unexported fields
}
MetricsCollector handles collection and storage of installation metrics
func NewMetricsCollector ¶
func NewMetricsCollector(storageDir string, enabled bool) *MetricsCollector
NewMetricsCollector creates a new metrics collector
func (*MetricsCollector) CleanupOldMetrics ¶
func (mc *MetricsCollector) CleanupOldMetrics() error
CleanupOldMetrics removes metrics files older than retention period
func (*MetricsCollector) GetPerformanceComparison ¶
func (mc *MetricsCollector) GetPerformanceComparison() (*PerformanceComparison, error)
GetPerformanceComparison generates binary vs source performance comparison
func (*MetricsCollector) GetSummary ¶
func (mc *MetricsCollector) GetSummary() (*MetricsSummary, error)
GetSummary generates an aggregated summary of all metrics
func (*MetricsCollector) RecordInstallation ¶
func (mc *MetricsCollector) RecordInstallation(metrics *InstallationMetrics) error
RecordInstallation records an installation's metrics
type MetricsSummary ¶
type MetricsSummary struct {
// Total counts
TotalInstallations int `json:"total_installations"`
BinaryInstallations int `json:"binary_installations"`
SourceInstallations int `json:"source_installations"`
// Success rates
OverallSuccessRate float64 `json:"overall_success_rate"`
BinarySuccessRate float64 `json:"binary_success_rate"`
SourceSuccessRate float64 `json:"source_success_rate"`
// Average timing
AverageBinaryTime time.Duration `json:"average_binary_time"`
AverageSourceTime time.Duration `json:"average_source_time"`
// Data period
FromDate time.Time `json:"from_date"`
ToDate time.Time `json:"to_date"`
}
MetricsSummary provides aggregated metrics across installations
type MirrorAuth ¶
type MirrorAuth struct {
// Authentication type (none, basic, bearer, api-key, oauth2)
Type string
// Basic authentication
Username string
Password string
// Bearer token authentication
Token string
// API key authentication
APIKey string
APIKeyHeader string
// OAuth2 authentication (placeholder for future implementation)
OAuth2ClientID string
OAuth2ClientSecret string
OAuth2TokenURL string
OAuth2Scopes []string
}
MirrorAuth represents authentication configuration for mirrors
type MirrorConfig ¶
type MirrorConfig struct {
// Human-readable name for the mirror
Name string `json:"name" yaml:"name"`
// Mirror type (github-releases, jsdelivr, cloudflare-r2, direct)
Type string `json:"type" yaml:"type"`
// Base URL for the mirror
BaseURL string `json:"base_url" yaml:"base_url"`
// Priority (lower numbers = higher priority)
Priority int `json:"priority" yaml:"priority"`
// Whether this mirror is enabled
Enabled bool `json:"enabled" yaml:"enabled"`
// Request timeout for this mirror
Timeout time.Duration `json:"timeout" yaml:"timeout"`
// Maximum number of retries for this mirror
MaxRetries int `json:"max_retries" yaml:"max_retries"`
// Health check path (relative to BaseURL)
HealthCheck string `json:"health_check" yaml:"health_check"`
// Custom headers to send with requests
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
// URL template for custom URL patterns
URLTemplate string `json:"url_template,omitempty" yaml:"url_template,omitempty"`
// Version mapping for custom version names
VersionMapping map[string]string `json:"version_mapping,omitempty" yaml:"version_mapping,omitempty"`
// Authentication configuration
Auth *MirrorAuth `json:"auth,omitempty" yaml:"auth,omitempty"`
}
MirrorConfig represents a single mirror configuration
func ConvertConfigToMirrors ¶
func ConvertConfigToMirrors(cfg *config.Config) []MirrorConfig
ConvertConfigToMirrors converts PVM configuration to internal mirror format
type MirrorHealth ¶
type MirrorHealth struct {
// Mirror configuration
Config MirrorConfig
// Whether the mirror is currently healthy
Healthy bool
// Response time for the last health check
ResponseTime time.Duration
// Last health check timestamp
LastCheck time.Time
// Last error encountered (if any)
LastError error
// Number of consecutive failures
ConsecutiveFailures int
}
MirrorHealth contains health status for a mirror
type MirrorManager ¶
type MirrorManager struct {
// contains filtered or unexported fields
}
MirrorManager handles mirror selection and failover
func NewMirrorManager ¶
func NewMirrorManager() *MirrorManager
NewMirrorManager creates a new mirror manager with default configuration
func NewMirrorManagerFromConfig ¶
func NewMirrorManagerFromConfig(cfg *config.Config) *MirrorManager
NewMirrorManagerFromConfig creates a mirror manager from PVM configuration
func NewMirrorManagerWithConfig ¶
func NewMirrorManagerWithConfig(mirrors []MirrorConfig) *MirrorManager
NewMirrorManagerWithConfig creates a mirror manager with custom configuration
func (*MirrorManager) CheckMirrorHealth ¶
func (mm *MirrorManager) CheckMirrorHealth(mirror MirrorConfig) *MirrorHealth
CheckMirrorHealth performs a health check on a specific mirror
func (*MirrorManager) Close ¶
func (mm *MirrorManager) Close()
Close stops the background health checking
func (*MirrorManager) DownloadWithMirrorFailover ¶
func (mm *MirrorManager) DownloadWithMirrorFailover(version, platform string, options *BinaryDownloadOptions) (*BinaryDownloadResult, error)
DownloadWithMirrorFailover attempts to download using the mirror chain with automatic failover
func (*MirrorManager) GenerateMirrorURL ¶
func (mm *MirrorManager) GenerateMirrorURL(mirror MirrorConfig, version, platform string) (string, error)
GenerateMirrorURL generates a URL for a specific mirror
func (*MirrorManager) GetBestMirror ¶
func (mm *MirrorManager) GetBestMirror() (*MirrorConfig, error)
GetBestMirror returns the best available mirror based on health and performance
func (*MirrorManager) GetMirrorChain ¶
func (mm *MirrorManager) GetMirrorChain() []MirrorConfig
GetMirrorChain returns a prioritized list of mirrors for failover
func (*MirrorManager) GetMirrorHealth ¶
func (mm *MirrorManager) GetMirrorHealth() map[string]*MirrorHealth
GetMirrorHealth returns the health status for all mirrors
func (*MirrorManager) GetMirrors ¶
func (mm *MirrorManager) GetMirrors() []MirrorConfig
GetMirrors returns the current mirror configuration
func (*MirrorManager) SetMirrors ¶
func (mm *MirrorManager) SetMirrors(mirrors []MirrorConfig)
SetMirrors updates the mirror configuration
func (*MirrorManager) UpdateMirrorHealth ¶
func (mm *MirrorManager) UpdateMirrorHealth(name string, healthy bool, responseTime time.Duration, err error)
UpdateMirrorHealth updates the health status for a mirror
type ModuleDependencyInfo ¶
ModuleDependencyInfo contains information about Perl module dependencies
type ModuleInstaller ¶
ModuleInstaller is an interface for installing Perl modules This allows us to inject the PM functionality without creating import cycles
type ParallelExecutor ¶
type ParallelExecutor struct {
// contains filtered or unexported fields
}
ParallelExecutor executes tasks in parallel with error handling
func NewParallelExecutor ¶
func NewParallelExecutor(maxWorkers int, logger *log.Logger) *ParallelExecutor
NewParallelExecutor creates a new parallel executor
type PatchPerlOptions ¶
type PatchPerlOptions struct {
// SourceDir is the Perl source directory to patch
SourceDir string
// PerlVersion is the Perl version being built
PerlVersion string
// Verbose enables verbose patchperl output
Verbose bool
// Context for command execution
Context context.Context
// Timeout for patchperl execution (default: 5 minutes)
Timeout time.Duration
}
PatchPerlOptions configures patchperl behavior
type PatchPerlResult ¶
type PatchPerlResult struct {
// Applied indicates whether patches were applied
Applied bool
// PatchCount is the number of patches applied
PatchCount int
// Output contains the patchperl command output
Output string
// Duration is how long patching took
Duration time.Duration
}
PatchPerlResult contains information about the patching process
func ApplyPatchPerl ¶
func ApplyPatchPerl(options *PatchPerlOptions) (*PatchPerlResult, error)
ApplyPatchPerl applies Devel::PatchPerl patches to Perl source
func ApplyPatchPerlWithAutoInstall ¶
func ApplyPatchPerlWithAutoInstall(options *PatchPerlOptions) (*PatchPerlResult, error)
ApplyPatchPerlWithAutoInstall applies patches, installing Devel::PatchPerl if needed
type PerformanceComparison ¶
type PerformanceComparison struct {
// Speed comparison
BinarySpeedupFactor float64 `json:"binary_speedup_factor"`
// Success rate comparison
BinarySuccessRate float64 `json:"binary_success_rate"`
SourceSuccessRate float64 `json:"source_success_rate"`
// Download metrics
AverageBinaryDownloadSize int64 `json:"average_binary_download_size"`
AverageBinaryDownloadTime time.Duration `json:"average_binary_download_time"`
// Cache effectiveness
BinaryCacheHitRate float64 `json:"binary_cache_hit_rate"`
// Sample sizes
BinarySampleSize int `json:"binary_sample_size"`
SourceSampleSize int `json:"source_sample_size"`
}
PerformanceComparison provides binary vs source performance analysis
type PerlDistribution ¶
type PerlDistribution int
PerlDistribution represents different Perl distributions
const ( DistributionSystem PerlDistribution = iota DistributionStrawberry DistributionActivePerl DistributionHomebrew DistributionApt DistributionYum DistributionDnf DistributionPacman DistributionZypper DistributionPerlBrew DistributionPlenv )
func (PerlDistribution) String ¶
func (d PerlDistribution) String() string
String returns the string representation of a PerlDistribution
type PerlVersion ¶
type PerlVersion struct {
Major int
Minor int
Patch int
Dev bool // True for development versions (e.g., 5.39.0)
}
PerlVersion represents a parsed Perl version (major.minor.patch)
func (PerlVersion) Compare ¶
func (v PerlVersion) Compare(other PerlVersion) int
Compare compares this version with another version Returns: -1 if v < other, 0 if v == other, 1 if v > other
func (PerlVersion) IsStable ¶
func (v PerlVersion) IsStable() bool
IsStable returns true if the version is a stable release
func (PerlVersion) String ¶
func (v PerlVersion) String() string
String returns the string representation of the version
type PlenvVersion ¶
type PlenvVersion struct {
// Version string (e.g., "5.40.2" or "system")
Version string
// Path to the Perl executable for this version
Path string
// Is this the currently active version?
IsActive bool
// Is this the system Perl?
IsSystem bool
}
PlenvVersion represents a Perl version managed by plenv
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress represents build progress tracking
func (*Progress) DownloadCallback ¶
func (p *Progress) DownloadCallback() ProgressCallback
DownloadCallback returns a callback for download progress
type ProgressCallback ¶
ProgressCallback is a function that reports download progress
type ProgressPool ¶
type ProgressPool struct {
// contains filtered or unexported fields
}
ProgressPool manages progress trackers
func NewProgressPool ¶
func NewProgressPool() *ProgressPool
NewProgressPool creates a new progress pool
func (*ProgressPool) Get ¶
func (pp *ProgressPool) Get(callback BuildProgressCallback) *Progress
Get gets a progress tracker from the pool
func (*ProgressPool) Put ¶
func (pp *ProgressPool) Put(p *Progress)
Put returns a progress tracker to the pool
type Remote ¶
type Remote struct {
Name string `toml:"name" json:"name"`
URL string `toml:"url" json:"url"`
Type string `toml:"type" json:"type"`
}
Remote represents a configured fork source
type RemoteList ¶
type RemoteList struct {
// contains filtered or unexported fields
}
RemoteList manages a collection of remotes
func MergeRemoteLists ¶
func MergeRemoteLists(base, override *RemoteList) *RemoteList
MergeRemoteLists merges two remote lists. Remotes from the override list take precedence over remotes with the same name in the base list.
func (*RemoteList) Add ¶
func (rl *RemoteList) Add(r Remote) error
Add adds a remote to the list after validation
func (*RemoteList) Find ¶
func (rl *RemoteList) Find(name string) (Remote, bool)
Find looks up a remote by name
func (*RemoteList) Remove ¶
func (rl *RemoteList) Remove(name string) error
Remove removes a remote by name
type ResolutionOptions ¶
type ResolutionOptions struct {
// Explicit version to use (highest precedence)
ExplicitVersion string
// Script path to analyze for version requirements
ScriptPath string
// Project directory to check (defaults to current directory)
ProjectDir string
// Configuration to use (if nil, will be loaded)
Config *config.Config
// Available versions (if empty, will be detected)
AvailableVersions []string
// Skip specific resolution methods
SkipLocal bool // Skip project-local resolution
SkipEnvVars bool // Skip environment variables
SkipUserConfig bool // Skip user configuration
SkipSystemPerl bool // Skip system Perl detection
SkipVersionResolved bool // Skip calling OnVersionResolved
SkipScriptAnalysis bool // Skip script version requirement analysis
SkipNetworkFetch bool // Skip fetching MetaCPAN downloadable versions list
// Debug callback function called at each step of the resolution process
DebugCallback func(step string, details interface{})
}
ResolutionOptions contains options for version resolution
type ResolutionSource ¶
type ResolutionSource string
ResolutionSource represents the source of a resolved version
const ( // Resolution sources in order of precedence (highest to lowest) ExplicitVersion ResolutionSource = "explicit" // Explicitly specified version ProjectVersionFile ResolutionSource = "project_file" // Project .perl-version file ProjectConfig ResolutionSource = "project_config" // Project .pvm/pvm.toml EnvironmentVariable ResolutionSource = "env_var" // Environment variable (PVM_PERL_VERSION, PLENV_VERSION, PERLBREW_PERL) UserConfig ResolutionSource = "user_config" // User configuration SystemPerlSource ResolutionSource = "system_perl" // System Perl installation )
type ResolvedVersion ¶
type ResolvedVersion struct {
// The resolved version string
Version string
// The library environment name (if any)
Library string
// The source of the resolved version
Source ResolutionSource
// The path to the Perl binary executable
Path string
// The path to the configuration source (e.g., .perl-version file, pvm.toml)
SourcePath string
}
ResolvedVersion represents a resolved Perl version with metadata
func ResolveVersion ¶
func ResolveVersion(options *ResolutionOptions) (*ResolvedVersion, error)
ResolveVersion determines which Perl version to use based on the resolution algorithm The precedence order (highest to lowest) is: 1. Explicitly specified version 2. Environment variables (PVM_PERL_VERSION, PLENV_VERSION, PERLBREW_PERL) 3. Project-local .perl-version file 4. Project-local .pvm/pvm.toml 5. Script version requirements (use v5.xx) 6. User-level configuration 7. System Perl
type ShellScriptData ¶
type ShellScriptData struct {
// The PVM executable path
PVMPath string
// Shims directory
ShimsDir string
// User configuration directory
ConfigDir string
// Function prefix, used to avoid naming collisions
FunctionPrefix string
// Whether the shell supports advanced features
SupportsAdvanced bool
// Conflict warnings for other version managers
ConflictWarnings string
// Fortune quote for initialization Easter egg
FortuneQuote string
}
ShellScriptData contains data for shell script templates
func (ShellScriptData) IsWindows ¶
func (s ShellScriptData) IsWindows() bool
Returns whether the script is for a Windows shell
type ShellType ¶
type ShellType string
ShellType represents the type of shell
func DetectShell ¶
DetectShell attempts to detect the user's shell type using environment-first logic. PSModulePath is checked first on any OS (PowerShell 7 runs on Linux/macOS too), then SHELL is checked, with an OS-based fallback last.
type ShimInfo ¶
type ShimInfo struct {
// Name of the shim (e.g., "perl", "cpan", "prove")
Name string
// Type of the shim (perl or script)
Type ShimType
// Path to the original executable/script (optional, used for system scripts)
OriginalPath string
}
ShimInfo contains information about a shim executable
func DiscoverAvailableShims ¶
DiscoverAvailableShims lists all commands available in installed Perl versions This is used to determine which shims should be created during rehash
type ShimTemplate ¶
type ShimTemplate struct {
// Name of the shim executable
Name string
// Type of the shim
Type string
// Full path to the PVM binary
PVMPath string
// Whether this is a Windows shim
IsWindows bool
// Whether this is a script (as opposed to the perl executable)
IsScript bool
}
ShimTemplate contains the data for the shim template
type SystemInfo ¶
type SystemInfo struct {
OS string `json:"os"`
Arch string `json:"arch"`
Compiler string `json:"compiler"`
CompilerVer string `json:"compiler_version"`
CPUCount int `json:"cpu_count"`
}
SystemInfo contains system-specific information
type SystemPerl ¶
type SystemPerl struct {
// Path to the Perl executable
Path string
// Version string (e.g., "5.34.0")
Version string
// Full version string including additional info
FullVersion string
// Architecture (e.g., "x86_64")
Architecture string
// Is this the primary system Perl?
IsPrimary bool
}
SystemPerl represents information about a system-installed Perl
func DetectAllSystemPerls ¶
func DetectAllSystemPerls() ([]*SystemPerl, error)
DetectAllSystemPerls detects all Perl installations on the system
func DiscoverAllPerlsWithPlenv ¶
func DiscoverAllPerlsWithPlenv() ([]*SystemPerl, error)
DiscoverAllPerlsWithPlenv discovers all available Perl installations using plenv
func FindPerlByVersion ¶
func FindPerlByVersion(version string) (*SystemPerl, error)
FindPerlByVersion finds a system Perl with the specified version
type SystemPerlManager ¶
type SystemPerlManager struct {
// contains filtered or unexported fields
}
SystemPerlManager manages system Perl installations
func NewSystemPerlManager ¶
func NewSystemPerlManager() *SystemPerlManager
NewSystemPerlManager creates a new SystemPerlManager
func (*SystemPerlManager) CheckForUpdates ¶
func (m *SystemPerlManager) CheckForUpdates() (bool, error)
CheckForUpdates checks if there are updates available for system Perl
func (*SystemPerlManager) DetectOrInstallPerl ¶
func (m *SystemPerlManager) DetectOrInstallPerl() (*SystemPerl, error)
DetectOrInstallPerl detects system Perl or installs it if not available
func (*SystemPerlManager) GetAvailableDistributions ¶
func (m *SystemPerlManager) GetAvailableDistributions() []PerlDistribution
GetAvailableDistributions returns the list of available distributions
func (*SystemPerlManager) GetPreferredDistributions ¶
func (m *SystemPerlManager) GetPreferredDistributions() []PerlDistribution
GetPreferredDistributions returns the preferred distribution order
func (*SystemPerlManager) InstallSystemPerl ¶
func (m *SystemPerlManager) InstallSystemPerl() (*SystemPerl, error)
InstallSystemPerl installs Perl using the best available method
func (*SystemPerlManager) ValidateInstallation ¶
func (m *SystemPerlManager) ValidateInstallation(perl *SystemPerl) error
ValidateInstallation validates that a Perl installation is working
type TestSummary ¶
type TestSummary struct {
TotalTests int
PassedTests int
FailedTests int
SkippedTests int
Duration time.Duration
}
TestSummary contains test execution summary
type TimedDuration ¶
type TimedDuration struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time,omitempty"`
Duration time.Duration `json:"duration"`
}
TimedDuration represents a duration with start and end times
type VersionInfo ¶
type VersionInfo struct {
// Version string in normalized format (X.Y.Z)
Version string `json:"version"`
// InstallPath is the absolute path to the installation directory
InstallPath string `json:"install_path"`
// InstallTime is when the version was installed
InstallTime time.Time `json:"install_time"`
// Source is where the version came from: "pvm", "plenv", "perlbrew", "system"
Source string `json:"source"`
// BuildOptions contains the options used to build this version (if built by pvm)
BuildOptions *BuildOptions `json:"build_options,omitempty"`
// Remote is the fork remote name (e.g. "mycompany"); empty for stock origin installs
Remote string `json:"remote,omitempty"`
// ForkName is the name of the fork (e.g. "myfork"); empty when not a named fork
ForkName string `json:"fork_name,omitempty"`
// BaseVersion is the upstream Perl version the fork is based on; empty for stock installs
BaseVersion string `json:"base_version,omitempty"`
}
VersionInfo contains metadata about an installed Perl version
func (VersionInfo) DisplayName ¶
func (v VersionInfo) DisplayName() string
DisplayName returns the human-readable name for this version. For fork installs it returns "<remote>/<forkname>-<version>" or "<remote>/<version>". For stock (origin) installs it returns the bare version string.
type VersionRegistry ¶
type VersionRegistry struct {
// Map of UUID -> VersionInfo
Versions map[string]VersionInfo `json:"versions"`
}
VersionRegistry holds information about all installed Perl versions
Source Files
¶
- auto_import.go
- binary.go
- binary_cache.go
- build.go
- build_cache.go
- build_enhanced.go
- build_enhanced_impl.go
- build_integration.go
- build_utils.go
- checksums.go
- clone_cache.go
- dependencies.go
- download.go
- fork.go
- install_binary.go
- legacy.go
- metrics.go
- mirrors.go
- patchperl.go
- plenv.go
- registry.go
- relocatable.go
- remote.go
- resolver.go
- shell.go
- shim.go
- strawberry.go
- strawberry_layout.go
- system.go
- system_manager.go
- validate_binary.go
- version.go