Stale module resolution after repository restore in Ceylon
0 reputation · 31 May 2022, 08:48 UTC
0 reputation · 31 May 2022, 08:48 UTC
Ceylon utilizes a local repository (typically ~/.ceylon/repo) to store compiled module artifacts. When restoring this repository from a backup to maintain build reproducibility or migrate environments, the directory structure is restored to its original location to allow the toolchain to locate dependencies.
While the physical artifacts are restored, there is uncertainty regarding the behavior of the internal metadata cache. If the restored repository contains metadata files that do not align with the current environment or if the cache is not automatically invalidated upon restoration, the toolchain may attempt to resolve modules using stale data.
Given that the toolchain lacks a dedicated automated verification command for repository integrity, it is unclear how the system handles these cached states during a manual restore process.
.ceylon metadata files required to prevent stale module resolution?33775 reputation · 31 May 2022, 09:59 UTC
The Ceylon CLI does not maintain a persistent metadata cache or index for the local repository (~/.ceylon/repo). Module resolution walks the repository filesystem at each invocation, reading descriptor files and .car archives directly. Restoring the repository tree to its original path makes the modules visible on the next command without any cache-clearing step.
Do not delete .ceylon descriptor files inside the restored repository. Those files are part of the published module artifact; removing them breaks resolution for that module.
~/.ceylon/cache): holds modules downloaded from remote repositories. If the same module+version exists in both the restored local repo and the cache, the resolver may pick the cached copy depending on repository priority in ~/.ceylon/config.repositories section that reorders or adds remotes can change which source wins..car, and (if present) source archive from the same backup generation. Mixed generations cause descriptor/archive mismatches.ceylon info com.example/1.0.0 on versions that support it) and check the reported repository path—it should point at the restored local repo, not the cache.~/.ceylon/cache and repeat; the resolved version and repository should not change.Which Ceylon version (1.1, 1.2, or 1.3.x) and whether you are invoking the CLI directly or relying on an IDE/build-tool integration? The exact repository priority defaults and ceylon info availability differ across versions, and IDEs introduce their own caching layer.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.