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

Remove separate part for @signalapp/better-sqlite3 #237

Open
jnsgruk opened this issue Dec 7, 2023 · 0 comments
Open

Remove separate part for @signalapp/better-sqlite3 #237

jnsgruk opened this issue Dec 7, 2023 · 0 comments
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@jnsgruk
Copy link
Member

jnsgruk commented Dec 7, 2023

We currently build the @signalapp/better-sqlite3 NPM package manually because the package has a build process that fetches artifacts in a non-proxy aware way.

I have a pull request against the upstream package to "fix" this behaviour, but it has yet to be merged. Once it does merge, it'll likely take a couple of Signal Desktop releases to land. signalapp/better-sqlite3#12

# NodeJS dependency which uses a non-proxy aware fetch during its build.
# The purpose of this part is to introduce proxy awareness so the build succeeds in LP.
better-sqlite3:
plugin: dump
source: https://registry.npmjs.org/@signalapp/better-sqlite3/-/better-sqlite3-8.6.0.tgz
override-build: |
# Patch the file; inject a proxy agent at the top of the file
cat <<-EOF > deps/download.js
const { HttpsProxyAgent } = require('https-proxy-agent');
const agent = new HttpsProxyAgent('${https_proxy:-}');
$(cat deps/download.js)
EOF
# Ensure the fetch actually uses the agent
sed -i 's|https.get(URL, async (res)|https.get(URL, { agent }, async (res)|g' deps/download.js

@jnsgruk jnsgruk added the dependencies Pull requests that update a dependency file label Dec 7, 2023
@jnsgruk jnsgruk self-assigned this Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

1 participant