Skip to content

Remaining issues with merged test projects #38

@sethaxen

Description

@sethaxen

#37 added support for [sources] entries by

  1. creating a new temporary environment containing both the main project and test project dependencies,
  2. jointly resolving this new environment,
  3. copying the resulting manifest back to the main directory, and
  4. manually adding the main project entry to the manifest.

I've found a few remaining problems with this implementation

  • If the test project has a dependency that itself depends on the main package, then the main package is already in the manifest at Step 2 but pointing to a released version instead of the local version. After Step 4 the main package is then listed twice, which results in an ambiguity that makes the resolved environment unusable.
  • If the main project has a weakdep that is also a test dep, then the merged project file includes that entry both as a dep and a weakdep. Pkg ignores deps that are also weakdeps (see below), so the testdep is then missing from the manifest, and tests will fail:

    Newer Julia versions will ignore dependencies in [deps] that are also in [weakdeps].

  • Step 4 fails to copy the deps entry for the main project, so it looks like the package has no dependencies, and an error may be raised when running tests (see e.g. https://github.com/TuringLang/MCMCDiagnosticTools.jl/actions/runs/21393672665/job/61586548602?pr=150#step:7:396), and note that in the following lines no deps entry is added:
    entry_lines = String[]
    push!(entry_lines, "[[deps.$pkg_name]]")
    push!(entry_lines, "path = \".\"")
    push!(entry_lines, "uuid = \"$pkg_uuid\"")
    if pkg_version !== nothing
    push!(entry_lines, "version = \"$pkg_version\"")
    end
    push!(entry_lines, "")
    main_pkg_entry = join(entry_lines, "\n")
  • Step 4 also fails to add entries for the extensions and weakdeps of the main project.

There may be additional issues, but these are blocking further testing of the workflow in my packages that use [sources].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions