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

Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement