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

fix: add special case for sharp@0.33.0 optional dependencies #372

Merged
merged 34 commits into from
Jan 2, 2024
Merged

Conversation

styfle
Copy link
Member

@styfle styfle commented Dec 1, 2023

Additionally:

  • Replaced yarn with npm (sharp requires it)
  • Updated @ffmpeg-installer/ffmpeg, oracledb, sharp to versions which support Apple Silicon
  • Disabled microtime-node-gyp test on Apple Silicon
  • Fixed expected output for some tests which implicitly upgraded dep versions

I also skipped a few ECMAScript Next tests because they currently fail.

At first I thought this must be a regression since the tests were passing on main (head is 285c930). However, the tests were always failing and jest was silently succeeding. Regenerating the lockfile, implicitly upgraded jest from 27.4.5 to 27.5.1 (due to the ^ prefix) and this included a fix that is now surfacing the error.

I also converted this file from jest to node:test just to confirm that it also fails on main.

Since these tests are Stage 2 features, likely no one has noticed they don't work because no JS runtime implements them.

@styfle styfle changed the title test sharp@0.33.0 fix: add special case for sharp@0.33.0 optional dependencies Dec 1, 2023
@styfle
Copy link
Member Author

styfle commented Dec 1, 2023

Looks like sharp doesn't support yarn@1 anymore since it didn't install optionalDependencies 🤔

https://github.com/vercel/nft/actions/runs/7054667887/job/19203908329?pr=372#step:8:7545

So we might need to change the repo to use npm or at least this specific test needs npm.

@lovell is that expected?

@devunt
Copy link

devunt commented Dec 1, 2023

Adding --ignore-engines on yarn install per lovell/sharp#3871 might solve the installation issue.

@lovell
Copy link

lovell commented Dec 1, 2023

yarn v1 has been in maintenance mode for almost 4 years and does not properly support optionalDependencies. I highly recommend people upgrade, but please avoid the plug'n'play feature.

@cb1kenobi cb1kenobi marked this pull request as ready for review December 18, 2023 22:18
@cb1kenobi cb1kenobi requested a review from ijjk as a code owner December 18, 2023 22:18
@cb1kenobi
Copy link
Contributor

@styfle Whatcha think about this PR? Merge it?

.gitignore Show resolved Hide resolved
test/ecmascript/data-esnext.js Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
cb1kenobi and others added 2 commits January 2, 2024 14:22
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
@lovell
Copy link

lovell commented Jan 2, 2024

Great to see some progress on this, thank you.

The sharp-related change adds 10 lines whereas the majority of this PR appears to relate to replacing yarn v1 with the latest npm. If clean version control history is of interest then may I suggest a split into a PR for the package manager upgrade and a PR to support optionalDependencies.

@styfle
Copy link
Member Author

styfle commented Jan 2, 2024

Even if we split it into 2 PRs, it will still have the same problem because we can't run tests without installing sharp.

This should be wrapping up soon though, there was a bug in jest causing some confusion and I think we have it resolved.

@@ -13,6 +13,9 @@ console.log('created directory ' + tmpdir);

// These are tests known to fail so we skip them
const ignoreCategories = new Set([
'Generator function.sent Meta Property',
'Class and Property Decorators',
'throw expressions',
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

We are skipping these tests now because they currently fail.

At first I thought this must be a regression since the tests were passing on main (head is 285c930). However, the tests were always failing and jest was silently succeeding. Regenerating the lockfile, implicitly upgraded jest from 27.4.5 to 27.5.1 (due to the ^ prefix) and this included a fix that is now surfacing the error.

I also converted this file from jest to node:test just to confirm that it also fails on main.

Since these tests are Stage 2 features, likely no one has noticed they don't work because no JS runtime implements them.

@styfle
Copy link
Member Author

styfle commented Jan 2, 2024

@styfle styfle requested a review from cb1kenobi January 2, 2024 22:45
@styfle styfle enabled auto-merge (squash) January 2, 2024 22:49
@styfle styfle merged commit 9470e71 into main Jan 2, 2024
16 checks passed
@styfle styfle deleted the issue-371 branch January 2, 2024 22:51
Copy link

github-actions bot commented Jan 2, 2024

🎉 This PR is included in version 0.26.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

styfle pushed a commit that referenced this pull request Jul 3, 2024
There's a need to skip some integration tests for Windows, this PR moves
the logic for skipping to the test setup itself rather than altering the
tests and dependencies as we were doing in the `prepare-install` step.
The pre-install logic was also deleting the `package-lock.json`, I'm not
100% clear on what the purpose was, but seems like it may have been done
accidentally given the context of the [diff
here](#372 (comment)).

With the previous logic, CI started to fail on Windows because the
`package-lock.json` was removed before install, causing us to install a
later version of dependency. Instead of removing that line of code in
the `prepare-install` file, just trying this approach which feels a
little more straightforward.

---------

Co-authored-by: Nathan Rajlich <n@n8.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@vercel/nft does not pick up platform-specific binaries for sharp
5 participants