fix: build better-sqlite3 (#27968)

* fix: build better-sqlite3

* fix syntax

* fix syntax

* fix syntax

* fix syntax

* fix syntax

* fix syntax

* fix syntax

* fix syntax

* better sqlite3

* publish pre-release

* Update CHANGELOG.md

* add comment

* try to cache

* try and speed things up even more

* fixes

* improve caching

* improve caching

* improve caching

* fix build

* fix build

* Update scripts/binary/build.ts

Co-authored-by: Adam Stone-Lord <adams@cypress.io>

* Update centos7-builder.Dockerfile

Co-authored-by: Adam Stone-Lord <adams@cypress.io>

* Update centos7-builder.Dockerfile

Co-authored-by: Adam Stone-Lord <adams@cypress.io>

* Update CHANGELOG.md

* fix keys

* Update cli/CHANGELOG.md

* Update cli/CHANGELOG.md

* Revert "fix keys"

This reverts commit b1383d4432.

* fix keys

* fix build

* optimize

* bump cache

* optimize

* bump cache

* blank

* blank

* Update scripts/binary/trigger-publish-binary-pipeline.js

* Update cli/CHANGELOG.md

* Update CHANGELOG.md

* Update cli/CHANGELOG.md

---------

Co-authored-by: Adam Stone-Lord <adams@cypress.io>
This commit is contained in:
Ryan Manuel
2023-10-09 14:23:56 -05:00
committed by GitHub
parent 1a6f87922c
commit 9f3d5b4565
7 changed files with 129 additions and 29 deletions

View File

@@ -138,8 +138,8 @@ export async function buildCypressApp (options: BuildCypressAppOpts) {
fs.writeJsonSync(meta.distDir('package.json'), {
...packageJsonContents,
scripts: {
// After the `yarn --production` install, we need to patch packages and trigger a server build to rebuild native bindings for `better-sqlite3`
postinstall: 'patch-package && yarn workspace @packages/server rebuild-better-sqlite3',
// After the `yarn --production` install, we need to patch packages
postinstall: 'patch-package',
},
}, { spaces: 2 })
@@ -158,6 +158,12 @@ export async function buildCypressApp (options: BuildCypressAppOpts) {
stdio: 'inherit',
})
log('#copying better-sqlite3')
fs.copySync(
path.join(CY_ROOT_DIR, 'node_modules', 'better-sqlite3', 'build', 'Release', 'better_sqlite3.node'),
path.join(DIST_DIR, 'node_modules', 'better-sqlite3', 'build', 'Release', 'better_sqlite3.node'),
)
// TODO: Validate no-hoists / single copies of libs
// Remove extra directories that are large/unneeded