Windows has problems PendingCodegen after `ash.setup`

Hi in mac os i have no problem. in windows when My colleague clone the project and fresh install (after create db and migrate all migrations) , it gets this error in my phoenix project! (without any new changes) or changing anu resource code!
mix ecto.drop; mix ash.setup; mix run priv/repo/entry_dev_test_seeds.exs ; iex -S mix phx.server

[debug] Converted error Ash.Error.Framework.PendingCodegen to 500 response
[error] ** (Ash.Error.Framework.PendingCodegen) Pending Code Generation Detected for 7 files

Don't worry! This just means Ash needs to generate some files based on your recent changes.
Here's what you can do:

🚀 Ready to generate the files? Create temporary development files so you can keep working:

mix ash.codegen --dev

🔍 Want to see what will be generated?

mix ash.codegen --dry-run

✅ Finished with your changes? Create final production-ready files:

mix ash.codegen <describe_your_changes>

‼️ Don't forget to run `mix ash.codegen` without the `--dev` flag before you
wrap up!
Add the following to your CI pipeline to ensure you've always generated up
to date files, and that no --dev files are left behind.

mix ash.codegen --check
mix ecto.drop; mix ash.setup; mix run priv/repo/entry_dev_test_seeds.exs ; iex -S mix phx.server

[debug] Converted error Ash.Error.Framework.PendingCodegen to 500 response
[error] ** (Ash.Error.Framework.PendingCodegen) Pending Code Generation Detected for 7 files

Don't worry! This just means Ash needs to generate some files based on your recent changes.
Here's what you can do:

🚀 Ready to generate the files? Create temporary development files so you can keep working:

mix ash.codegen --dev

🔍 Want to see what will be generated?

mix ash.codegen --dry-run

✅ Finished with your changes? Create final production-ready files:

mix ash.codegen <describe_your_changes>

‼️ Don't forget to run `mix ash.codegen` without the `--dev` flag before you
wrap up!
Add the following to your CI pipeline to ensure you've always generated up
to date files, and that no --dev files are left behind.

mix ash.codegen --check
I even again clone the project in my system (which mac os) and i have no problem ! By the way in windows if we run mix ash.codegen --dev it creates some file and if run ash.setup it shows error it is already exist Ash last version Postgres version: psql (PostgreSQL) 16.10 windows 11 in mac os i can see when i start server and run a page in my log
Getting extensions in current project...
Getting extensions in current project...
Getting extensions in current project...
Getting extensions in current project...
Getting extensions in current project...
Getting extensions in current project...
By the way Ash uses picosat_elixir and windows has problem with it log after install all packages like c++ tools for build and let us to compile it: https://gist.github.com/MonaAghili/7893e23fee6a4e2769129ba9cfc2b807 ‌By the way in windows if we mix ash.codegen it rebuilds existing resources
No description
Solution:
I just honestly don't think I have the bandwidth to support windows at this point, someone else will have to figure out this strangeness
Jump to solution
15 Replies
ZachDaniel
ZachDaniel3w ago
So, mix ash.codegen --dev by design means that when you run mix ash.codegen name it will regenerate. That is by design. So when you get that error, if you run mix ash.codegen --dev --check what do you see?
Shahryar
ShahryarOP3w ago
Assuming that all the migrations are correctly created and are present in the repo, running mix ash.codegen again will regenerate several resources that already have migrations. I encounter an error when I clone the project from GitHub, fetch the dependencies, and then run:
mix ecto.create
mix ash.setup
mix run some_seeds.exs
mix ecto.create
mix ash.setup
mix run some_seeds.exs
Even the seed data gets inserted into the database correctly. Then I start the server with:
iex -S mix phx.server
iex -S mix phx.server
At this point, some queries are also executed successfully — until I open a page on the Phoenix site, and then the above-mentioned error appears.
ZachDaniel
ZachDaniel3w ago
Can you run the command I showed once that happens?
Shahryar
ShahryarOP3w ago
mix ash.codegen --dev --check
Getting extensions in current project...
Running codegen for AshPostgres.DataLayer...
** (Mix) Pending Code Generation Detected for 7 files


Run with --dry-run to view pending changes
mix ash.codegen --dev --check
Getting extensions in current project...
Running codegen for AshPostgres.DataLayer...
** (Mix) Pending Code Generation Detected for 7 files


Run with --dry-run to view pending changes
ZachDaniel
ZachDaniel3w ago
Add the dry run flag
Shahryar
ShahryarOP3w ago
you mean this?
mix ash.codegen --dev --check --dry-run
Getting extensions in current project...
Running codegen for AshPostgres.DataLayer...
** (Mix) Pending Code Generation Detected for 7 files


Run with --dry-run to view pending changes
mix ash.codegen --dev --check --dry-run
Getting extensions in current project...
Running codegen for AshPostgres.DataLayer...
** (Mix) Pending Code Generation Detected for 7 files


Run with --dry-run to view pending changes
ZachDaniel
ZachDaniel3w ago
Yes Does it show any changes?
Shahryar
ShahryarOP3w ago
No, and did not create any files or changed
ZachDaniel
ZachDaniel3w ago
Why does windows have to be this way 😢
Shahryar
ShahryarOP3w ago
😂 i even see the psql and it has tabels
No description
ZachDaniel
ZachDaniel3w ago
Can you not use WSL instead
Shahryar
ShahryarOP3w ago
she is using power shell
ZachDaniel
ZachDaniel3w ago
I figured that, but WSL would make these problems entirely go away
Solution
ZachDaniel
ZachDaniel3w ago
I just honestly don't think I have the bandwidth to support windows at this point, someone else will have to figure out this strangeness

Did you find this page helpful?