Skip to content

Larger xref module cycles after upgrading from 1.18 -> 1.19 #14844

@vanderhoop

Description

@vanderhoop

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.2.6] [source] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]

Elixir 1.19.0 (compiled with Erlang/OTP 27)

Operating system

Both macOS 15.6.1 and ubuntu-latest (on GH actions)

Current behavior

After upgrading from Elixir 1.18.4 -> 1.19.0, I'm now getting lengthier xref module cycles despite no changes to the application source code. For example, where before mix xref graph --format cycles --min-cycle-size 5 --fail-above 0 identified no cycles, elixir 1.19.0 flags multiple cycles, one as long as 21 modules:

$ mix xref graph --format cycles --min-cycle-size 5 --fail-above 0
Compiling 1 file (.ex)
Generated rum_dash app
2 cycles found. Showing them in decreasing size:

Cycle of length 21:

    lib/rum_dash_web/components/app_layout.ex
    lib/rum_dash_web/components/layouts.ex
    lib/rum_dash_web/controllers/blog_controller.ex
    lib/rum_dash_web/controllers/client_error_controller.ex
    lib/rum_dash_web/controllers/email_previews_controller.ex
    lib/rum_dash_web/controllers/error_html.ex
    lib/rum_dash_web/controllers/fallback_controller.ex
    lib/rum_dash_web/controllers/health_check_controller.ex
    lib/rum_dash_web/controllers/navigation_controller.ex
    lib/rum_dash_web/controllers/oauth_controller.ex
    lib/rum_dash_web/controllers/page_controller.ex (export)
    lib/rum_dash_web/controllers/user_session_controller.ex
    lib/rum_dash_web/emails/daily_digest_template.ex
    lib/rum_dash_web/endpoint.ex
    lib/rum_dash_web/live/website_live/common.ex
    lib/rum_dash_web/plugs/admin_layout_plug.ex
    lib/rum_dash_web/plugs/early_hints_plug.ex
    lib/rum_dash_web/plugs/layout_plug.ex
    lib/rum_dash_web/plugs/website_plugs.ex
    lib/rum_dash_web/router.ex (export)
    lib/rum_dash_web/user_auth.ex

Cycle of length 5:

    lib/rum_dash/accounts/user.ex
    lib/rum_dash/accounts/website.ex
    lib/rum_dash/accounts/website_membership.ex
    lib/rum_dash/analytics/navigation.ex
    lib/rum_dash/analytics/path_regex.ex

** (Mix) Too many cycles (found: 2, permitted: 0)

Expected behavior

My (perhaps hopeful) expectation is that the cycle length should be unchanged when upgrading. That said, I know that Elixir v1.19 introduces some additional goodies to the compiler, so if those goodies depend on longer cycles, feel free to close.

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