jmurphyweb

jmurphyweb

Automated check for circular compile time dependencies

I have a case of cyclical compile time dependencies. I have read lot’s about it and watched the great video on youtube.

Updating a View or Controller or many other files causes a 70 module recompile. I have discovered that my extensive (ab)use of controller level plugs is one cause, but there are others, such as an over-imported ViewHelpers module. I am slowly but surely removing imports, which I think is getting me closer to resolving this issue :crossed_fingers:

My question is, from an xref graph or another tool out there, is it possible to ascertain whether there is a cyclical dependency issue ? I am wondering whether I could run a check to my CI to ensure we never get into this position again.


lib/ev2_web/views/production/custom_field_view.ex
├── lib/ev2_web.ex (compile)
├── lib/ev2_web/router.ex
│   ├── lib/ev2_web/controllers/dashboard_controller.ex
│   │   ├── lib/ev2_web.ex (compile)
│   │   ├── lib/ev2_web/controllers/data_plugs.ex (compile)
│   │   │   ├── lib/ev2/accounts/accounts.ex
│   │   │   │   ├── lib/ev2/accounts/core_logic.ex (compile)
│   │   │   │   ├── lib/ev2/accounts/login_attempt/login_attempt_api.ex (compile)
│   │   │   │   │   ├── lib/ev2/accounts/accounts.ex
│   │   │   │   │   ├── lib/ev2/accounts/login_attempt/login_attempt.ex (struct)
│   │   │   │   │   │   └── lib/ev2/accounts/user/user.ex
│   │   │   │   │   │       ├── lib/ev2/accounts/login_attempt/login_attempt.ex
│   │   │   │   │   │       ├── lib/ev2/accounts/role/project_role.ex
│   │   │   │   │   │       │   ├── lib/ev2/accounts/role/role.ex
│   │   │   │   │   │       │   │   └── lib/ev2/accounts/role/permission.ex
│   │   │   │   │   │       │   │       └── lib/ev2/accounts/role/role.ex
│   │   │   │   │   │       │   ├── lib/ev2/accounts/user/user.ex
│   │   │   │   │   │       │   └── lib/ev2/production/department/department.ex
│   │   │   │   │   │       │       └── lib/ev2/production/job_title/job_title.ex
│   │   │   │   │   │       │           ├── lib/ev2/production/contract_type/contract_type.ex
│   │   │   │   │   │       │           │   └── lib/ev2/production/job_title/job_title.ex
│   │   │   │   │   │       │           └── lib/ev2/production/department/department.ex
│   │   │   │   │   │       ├── lib/ev2/accounts/role/role.ex
│   │   │   │   │   │       ├── lib/ev2/accounts/startpack/startpack.ex
│   │   │   │   │   │       │   ├── lib/ev2/accounts/user/user.ex
│   │   │   │   │   │       │   ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   ├── lib/ev2/ecto_types/string/upcase.ex (compile)
│   │   │   │   │   │       │   ├── lib/ev2/lib/doc_security/doc_security.ex
│   │   │   │   │   │       │   │   ├── lib/ev2/lib/doc_security/anti_virus/anti_virus.ex (compile)
│   │   │   │   │   │       │   │   └── lib/ev2/lib/doc_security/file_type/file_type.ex (compile)
│   │   │   │   │   │       │   ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   ├── lib/ev2/lib/doc_security/doc_security.ex
│   │   │   │   │   │       │   │   ├── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   ├── lib/ev2/lib/utils/time_utils.ex
│   │   │   │   │   │       │   │   ├── lib/ev2/timecards/tc_utils.ex
│   │   │   │   │   │       │   │   │   ├── lib/ev2/lib/utils/time_utils.ex
│   │   │   │   │   │       │   │   │   ├── lib/ev2/production/prod_utils.ex
│   │   │   │   │   │       │   │   │   ├── lib/ev2/timecards/approver/approver.ex (struct)
│   │   │   │   │   │       │   │   │   ├── lib/ev2/timecards/timecard/timecard.ex (struct)
│   │   │   │   │   │       │   │   │   │   ├── lib/ev2/lib/utils/time_utils.ex
│   │   │   │   │   │       │   │   │   │   ├── lib/ev2/timecards/approval/approval.ex
│   │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/timecards/approver/approver.ex
│   │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/timecards/timecard/timecard.ex
│   │   │   │   │   │       │   │   │   │   │   └── lib/ev2/timecards/timecard_data/timecard_data.ex
│   │   │   │   │   │       │   │   │   │   │       ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       ├── lib/ev2/production/production.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/altered_document/altered_document_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/altered_document/altered_document.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   ├── lib/ev2/production/document/document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   ├── lib/ev2/production/altered_document/altered_document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   ├── lib/ev2/production/offer/offer.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/accounts/accounts.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/accounts/role/role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   ├── lib/ev2/accounts/role/helpers.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   │   ├── lib/ev2/accounts/role/project_role.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   │   ├── lib/ev2/accounts/role/role.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   ├── lib/ev2/accounts/role/permission.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   ├── lib/ev2/accounts/role/role.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   ├── lib/ev2/accounts/role/role_permission.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   │   ├── lib/ev2/accounts/role/permission.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   │   └── lib/ev2/accounts/role/role.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/altered_document/altered_document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/constants.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/contract_type/contract_type.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/custom_field/custom_field.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   ├── lib/ev2/production/offer/offer.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/constants.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/custom_field/custom_field.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/document/document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/offer/offer.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/place/place.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/production.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/project_default/project_default.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       ├── lib/ev2/production/signee/signee.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   ├── lib/ev2/production/document/document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       │   └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │       └── lib/ev2/production/vehicle/vehicle.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │           ├── lib/ev2/ecto_types/string/trim.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │           ├── lib/ev2/production/company/company.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │           │   └── lib/ev2/production/vehicle/vehicle.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │           └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/department/department.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/department_inclusive/department_inclusive.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/document/document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/frozen_document/frozen_document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   │   └── lib/ev2/production/offer/offer.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/job_title/job_title.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/place/place.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/prod_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   ├── lib/ev2/production/production.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   │   └── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   ├── lib/ev2/production/project/project.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   └── lib/ev2/production/signee/signee.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   └── lib/ev2/production/offer/offer.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/offer/offer.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/company/company_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/company/company.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/contract_type/contract_type_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/contract_type/contract_type.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/contract_type/contract_type_helpers.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/prod_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/custom_field/custom_field_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/custom_field/custom_field.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/department/department_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/department/department.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/job_title/job_title.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/document/document_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/lib/doc_security/doc_security.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/document/document.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/production.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/document_signee/document_signee_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/document_signee/document_signee.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   ├── lib/ev2/production/document/document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   └── lib/ev2/production/signee/signee.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/frozen_document/frozen_document_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/frozen_document/frozen_document.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/job_title/job_title_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/production/job_title/job_title.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   ├── lib/ev2/production/offer/offer_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/accounts/accounts.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/accounts/role/role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/accounts/user/user.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   ├── lib/ev2/engagement/engagements.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   ├── lib/ev2/engagement/eng_utils.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   ├── lib/ev2/lib/utils/time_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │   └── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       ├── lib/ev2/timecards/approval/approval_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/approval/approval.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/approval/validate.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/approver/approver.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/timecard/timecard.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   └── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       ├── lib/ev2/timecards/approver/approver_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/accounts/role/project_role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/accounts/accounts.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/accounts/role/project_role.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/accounts/role/role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/accounts/user/user.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/production/project/project.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   └── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/approver/approver.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/timecard/timecard.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/timecard_setting/timecard_setting.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/production/production.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/timecards/timecard/timecard.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/timecards/timecard_setting/timecard_setting_constants.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   └── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   └── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       ├── lib/ev2/timecards/department_inclusive/department_inclusive_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/production/department/department.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   └── lib/ev2/timecards/department_inclusive/department_inclusive.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       ├── lib/ev2/lib/utils/changeset.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       ├── lib/ev2/timecards/department/department.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       │   └── lib/ev2/timecards/department_inclusive/department_inclusive.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       ├── lib/ev2/timecards/regular_site/regular_site.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       │   └── lib/ev2/timecards/department_inclusive/department_inclusive.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │       └── lib/ev2/timecards/timecard_setting/timecard_setting.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       ├── lib/ev2/timecards/export/export_api.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/accounts/role/role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/accounts/user/user.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/engagement/engagements.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/repo.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/export/export.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   └── lib/ev2/timecards/timecard_setting/timecard_setting.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   ├── lib/ev2_web/views/timecards/timecard_approval_view.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/engagement/eng_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/lib/utils/humanize.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   └── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/lib/utils/time_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/production/prod_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/timecards/tc_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/timecards/timecard/timecard.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2/timecards/timecards.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2_web.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2_web/endpoint.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2_web/controllers/block_direct_heroku_access.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   └── lib/ev2_web/router.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2_web/router.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   ├── lib/ev2_web/views/component_view.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2/lib/utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2/lib/utils/humanize.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2/production/prod_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2/timecards/tc_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2_web.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2_web/router.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2_web/views/error_helpers.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   └── lib/ev2_web/gettext.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   ├── lib/ev2_web/views/production/document_view.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2/production/altered_document/altered_document.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2/production/document/document.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2_web.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2_web/router.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2_web/views/component_view.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   ├── lib/ev2_web/views/error_helpers.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │   └── lib/ev2_web/views/view_helpers.ex (compile)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │       ├── lib/ev2/accounts/role/role_api.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │       ├── lib/ev2/engagement/eng_utils.ex
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │       ├── lib/ev2/engagement/engagement/engagement.ex (struct)
│   │   │   │   │   │       │   │   │   │   │       │   │   │   │       │   │   │   │       │   ├── lib/ev2/engagement/ot_setting/ot_setting.ex
...

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @jmurphyweb. I also have an issue where a large number of files are recompiled when I make even trial changes to many files (like adding or removing a comment). I don’t think that phrasing this as a “circular compile time dependency” though is helping, because if it were actually that then you’d have gridlock at compile time and get an actual error.

For example, these modules have a true compile time dependency on each other:

# a.ex
defmodule A do
  B.run()
end

# b.ex
defmodule B do
  A.run()
end

If I try to compile these, I get:

== Compilation error in file lib/sensetra/integration/b.ex ==
** (CompileError)  deadlocked waiting on module A
    lib/sensetra/integration/b.ex:2: (module)
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6

== Compilation error in file lib/sensetra/integration/a.ex ==
** (CompileError)  deadlocked waiting on module B
    lib/sensetra/integration/a.ex:2: (module)
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6

Compilation failed because of a deadlock between files.
The following files depended on the following modules:

  lib/sensetra/integration/b.ex => A
  lib/sensetra/integration/a.ex => B

Ensure there are no compile-time dependencies between those files and that the modules they reference exist and are correctly named
jmurphyweb

jmurphyweb

@outlog thanks! That is my own thread actually :slight_smile: - I am not using the latest version, but my data plugs are function plugs, which this does not apply to unfortunately (only to Module plugs).

I have found the cause of my problems (eventually). This question is more about understanding if it is possible to know from analysing xref graph whether an issue exists, and if so, where.

christhekeele

christhekeele

Just to be clarify, you aren’t suffering from a cyclical dependency issue, this is incorrect terminology. A cyclical dependency refers very specifically to a ‘cycle’ in the dependency graph. Elixir doesn’t support cyclical module dependencies and would refuse to compile in this situation (as @benwilson512 explains well here).

You seem to be concerned more about depth of your module dependency graph, rather than cycles. That’s a pretty cool idea! As far as I can tell, mix xref has access to this information (it must in parsing the module graph), but doesn’t report on it (anywhere I can find in its documentation). That would make a nifty PR or proposal.

Where Next?

Popular in Questions Top

New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement