Skip to content

Conversation

@hugopl
Copy link
Contributor

@hugopl hugopl commented Jan 3, 2025

This works by having a wrapper that compiles the CLI on first use, when the database backend libraries were already downloaded by shards.

Changes:

  • Rename src/micrate-bin.cr to src/micrate-cli.cr
  • Add src/micrate-wrapper.cr that compiles in a post install to bin/micrate.
  • bin/micrate compiles src/micrate-cli to bin/micrate-cli-
  • src/micrate-cli.cr only require database backends found in lib/
  • Do not pin crystal-db version to avoid having to release new micrate versions on every crystal-db release.

Fix #87

Caution

Despite of the code dealing with windows I only tested this on Linux, would be nice if someone else test this (and possible fix it) on windows before merge.

This works by having a wrapper that compiles the CLI on first use, when
the database backend libraries were already downloaded by shards.

Changes:
- Rename src/micrate-bin.cr to src/micrate-cli.cr
- Add src/micrate-wrapper.cr that compiles in a post install to
  bin/micrate.
- bin/micrate compiles src/micrate-cli to bin/micrate-cli-<VERSION>
- src/micrate-cli.cr only require database backends found in lib/
- Do not pin crystal-db version to avoid having to release new micrate versions on every crystal-db release.

Fix amberframework#87
@hugopl
Copy link
Contributor Author

hugopl commented Feb 11, 2025

@crimson-knight could you review/provide some feedback on this?

Copy link
Member

@crimson-knight crimson-knight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to approve and merge this into master, and I'm building a new amber cli that'll depend on it and test against Windows, Linux and MacOS on github actions. If this finds a compatibility problem then I'll just make a PR with the solution.

Thank you for doing this!

@crimson-knight crimson-knight merged commit 647fac0 into amberframework:master Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.14+ requires all dependencies (pg, mysql, sqlite3 + dev package)

2 participants