Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from #373 bumping to PSQL 14 not compatible with M1 Macs/ARM64 #397

Closed
CoolMatty opened this issue May 10, 2022 · 3 comments
Closed

Comments

@CoolMatty
Copy link

  • Sail Version: 1.14.1
  • Laravel Version: 9.11.0
  • PHP Version: 8.1
  • OS: macOS 12.3.1

Description:

Out of the box, Laravel Sail, with the changes from #373, will install a Postgres 14 docker container, but will grab Postgres client 13 for the ubuntu 21.11 container, on any non-AMD64 device. This is because the Postgres package repository does not have builds for anything except AMD64 on non-LTS Ubuntu versions. This causes an immediate incompatibility on common development devices such as M1 Macs.

Furthermore, I am not sure if it was intentional, but the "POSTGRES_VERSION" feature, added to the Dockerfile, was only added to PHP 7.4, not to 8.0 and 8.1. The argument is defined in the 8.0 and 8.1, but is not used anywhere. This also makes it more difficult to work around the above stated out of box incompatibility.

Steps To Reproduce:

  • Install latest release version of Laravel via Laravel Sail on a non-AMD64 platform (such as an M1 Mac). Ensure you select pgsql during the install steps.
  • Run sail up
  • Attempt to use any Postgres features, such as sail artisan schema:dump

MY Thoughts

I'm not sure how the team would like to resolve this particular issue, although there's multiple ways to go about it.

Since the issue only appears with non-LTS releases, if Laravel Sail bumps to Ubuntu 22.04, this issue will be temporarily rendered moot. However, it will resurface if Laravel Sail does not remain on LTS releases going forward.

A more basic approach would be to lock the out of the box Postgres version to the last LTS version available (13 at the time of writing). However, I think that'll require someone to remember this or find a way to automatically determine this for the future.

A more robust option would be to auto-detect the platform in use and adjust the settings as necessary. That might be more work than desired for the team, however.

Perhaps the team has better options to resolve this, but those were my ideas.

I also believe the POSTGRES_VERSION feature should be made functional in all of the PHP Dockerfiles.

@driesvints
Copy link
Member

I already sent in a PR to fix the POSTGRES_VERSION issue but will talk to the team on what to do with the default version. Thanks!

#398

@daveaiello
Copy link

I just ran into this myself today while trying to build sail for the first time on an M1 Mac mini. What do I have to do in order to send a PR?

@driesvints
Copy link
Member

I released Sail v1.14.3 which bumps Ubuntu to 22.04 which contains the v14 of the PostgreSQL package. You should be able to rebuild it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants