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

Update sharp to 0.33 to fix issue with Alpine Linux #10684

Merged
merged 100 commits into from
Apr 24, 2024

Conversation

PeterDraex
Copy link
Contributor

@PeterDraex PeterDraex commented Apr 4, 2024

Changes

This PR updates the version of the sharp dependency to ^0.33 and thus makes Astro compatible with Alpine Linux containers.

It was impossible for me to use the Astro image service in an Alpine Linux docker container. Even though I would install sharp 0.33.3 in my app, pnpm would download version 0.32.6, which doesn't work in Alpine Linux container. I have to override the downloaded version in my package.json.

For more details about the issue see:

Testing

  • Automatic tests
  • Override of sharp with the current version in local project

Docs

This resolves existing bug. No documentation needed.

It was impossible for me to use the Astro image service in an Alpine Linux docker container. Even though I would install sharp `0.33.3` in my app, pnpm would download version `0.32.6`, which doesn't work in Alpine Linux container. 

Currently, I have to override the downloaded version in my package.json. For more details see:
- lovell/sharp#4054
- https://discord.com/channels/830184174198718474/1224861729792458803/1224861729792458803

This PR updates the version of the `sharp` dependency to `^0.33` and thus makes Astro compatible with Alpine Linux.
Copy link

changeset-bot bot commented Apr 4, 2024

🦋 Changeset detected

Latest commit: be1979b

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Apr 4, 2024
@PeterDraex PeterDraex marked this pull request as ready for review April 4, 2024 21:42
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Blocking this because it's a breaking change. Sharp's 0.33.0 engines contract is stricter than Astro's, requiring a higher version of Node 18 and 20 than Astro, and not supporting Node 19 at all.

As such, for a certain percentage of users, Sharp would just not get installed ever unless they forced the install. Last time we updated to 0.33.0 (because I didn't know its checks were stricter than us, ha), we ended up with a bunch of support threads from people running outdated versions of Node.

@Princesseuh Princesseuh added this to the 4.7.0 milestone Apr 19, 2024
@Princesseuh Princesseuh dismissed their stale review April 19, 2024 08:05

Now that we upgraded our Node contract in 4.6.0, we can do this

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Thank you, this looks great!

pnpm-lock.yaml Outdated Show resolved Hide resolved
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thanks for this helpful contribution @PeterDraex ! I've just updated the changeset message to be a tiny bit more explicit. Especially since this is being released with a minor version of Astro, we try to give the changesets a little extra love and attention as people are checking more closely! 🙌

.changeset/famous-mugs-grab.md Show resolved Hide resolved
@matthewp
Copy link
Contributor

@PeterDraex would you mind rebasing with main and rerunning install to update the lockfile?

ematipico and others added 12 commits April 23, 2024 12:02
…ithastro#10693)

* Add disableremoteplayback attribute to VideoHTMLAttributes interface

* Move disableremoteplayback from VideoHTMLAttributes to MediaHTMLAttributes

* Create olive-camels-greet.md

* Update packages/astro/astro-jsx.d.ts

---------

Co-authored-by: Erika <[email protected]>
…withastro#10694)

* test(@astrojs/node) wait for server listening in trailing-slash tests

* fix missing waitServerListen

* fix import statement

---------

Co-authored-by: Emanuele Stoppa <[email protected]>
…and `build:ci:no-cache` to skip caching for build as well (withastro#10696)

* chore: add test:citgm command that would run tests without caching

* adding build ci with no cache
* fix(withastro#10399, PLT-1786): improve notification contrast on hover

* chore: add changeset
bluwy and others added 24 commits April 23, 2024 12:02
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* db: export 'alias' from drizzle-orm/sqlite-core

* chore: changeset

* fix: changeset target

---------

Co-authored-by: Ben Holmes <[email protected]>
* chore: configuration

* chore: update main commands

* chore: revert formatting package.json

* chore: rebase
…us during view transition navigation. (withastro#10799)

* Fixes an issue with persisted non-text input fields that have the focus during view transition navigation.

* better check
* add tests that reveal issue

* fix trailing slash root page issue

* add changeset
…ithastro#10773)

* optimization(runtime): create smaller objects for each Astro global

* add changeset

* Make slots lazy

---------

Co-authored-by: bluwy <[email protected]>
…ro#10763)

* Invalidate CC cache manifest when lockfile or config changes

* Close the handle and increment manifest version

* debug info

* Provide a reason for cache busting

* Handle compile metadata missing

* Try it this way

* Copy over cached assets as well

* Only restore chunks when cache is valid

* Better handle invalid caches

* Explain when there is no content manifest

* Add tests

* debugging

* Remove debugging

* Update packages/astro/src/core/build/plugins/plugin-content.ts

Co-authored-by: Bjorn Lu <[email protected]>

* Update packages/astro/src/core/build/plugins/plugin-content.ts

Co-authored-by: Bjorn Lu <[email protected]>

* Review comments

* Add chunks path constant

---------

Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…e blog starter template (withastro#10814)

Currently the 4th point on home page says: "Check out the included blog posts in src/pages/blog/". It the path here should be "src/content/blog/".
@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Apr 23, 2024
@PeterDraex
Copy link
Contributor Author

@PeterDraex would you mind rebasing with main and rerunning install to update the lockfile?

@matthewp Done. I've also updated sharp version in examples/starlog/package.json. Is that okay?

@matthewp
Copy link
Contributor

Yes, thank you!

@matthewp matthewp merged commit 8b59d5d into withastro:main Apr 24, 2024
14 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.