Title: "undefined symbol: gcry_control" after building in linux/amd64 alpine · Issue #1975 · nodegit/nodegit · GitHub
Open Graph Title: "undefined symbol: gcry_control" after building in linux/amd64 alpine · Issue #1975 · nodegit/nodegit
X Title: "undefined symbol: gcry_control" after building in linux/amd64 alpine · Issue #1975 · nodegit/nodegit
Description: System information node version: 18.15.0 npm or yarn version: yarn 1.22.19 OS/version/architecture: Linux a2a48d191f5f 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux Applicable nodegit version: 0.27.0 The i...
Open Graph Description: System information node version: 18.15.0 npm or yarn version: yarn 1.22.19 OS/version/architecture: Linux a2a48d191f5f 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux ...
X Description: System information node version: 18.15.0 npm or yarn version: yarn 1.22.19 OS/version/architecture: Linux a2a48d191f5f 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux ...
Opengraph URL: https://github.com/nodegit/nodegit/issues/1975
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"undefined symbol: gcry_control\" after building in linux/amd64 alpine","articleBody":"## System information\r\n\r\n - node version: 18.15.0\r\n - npm or yarn version: yarn 1.22.19\r\n - OS/version/architecture: Linux a2a48d191f5f 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux\r\n - Applicable nodegit version: 0.27.0\r\n\r\n## The issue\r\n\r\nI built with following command:\r\n\r\n```sh\r\napt-get install -y libgit2-27 libgit2-dev libkrb5-dev build-essential python2\r\nalias python=python2\r\nyarn --frozen-lockfile\r\n```\r\n\r\nit builds fine, but when I try to run my project, as soon as it requires nodegit:\r\n\r\n```\r\nnode: symbol lookup error: /usr/share/apps/node_modules/nodegit/build/Release/nodegit.node: undefined symbol: gcry_control\r\n```\r\n\r\nOn my runtime I have following packages installed:\r\n\r\n```\r\napt-get install -y git libgit2-27 libkrb5-dev libssl1.1 libgcrypt20\r\n```\r\n\r\nWhen I inspect the built file with `ldd node_modules/nodegit/build/Release/nodegit.node` it says this:\r\n\r\n```\r\n\tlibgssapi_krb5.so.2 =\u003e /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x0000004001cfc000)\r\n\tlibkrb5.so.3 =\u003e /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x0000004001d4b000)\r\n\tlibk5crypto.so.3 =\u003e /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x0000004001e2b000)\r\n\tlibcom_err.so.2 =\u003e /lib/x86_64-linux-gnu/libcom_err.so.2 (0x0000004001e5f000)\r\n\tlibstdc++.so.6 =\u003e /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x0000004001e65000)\r\n\tlibm.so.6 =\u003e /lib/x86_64-linux-gnu/libm.so.6 (0x0000004001fe9000)\r\n\tlibgcc_s.so.1 =\u003e /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000000400216c000)\r\n\tlibpthread.so.0 =\u003e /lib/x86_64-linux-gnu/libpthread.so.0 (0x0000004002188000)\r\n\tlibc.so.6 =\u003e /lib/x86_64-linux-gnu/libc.so.6 (0x00000040021a9000)\r\n\tlibkrb5support.so.0 =\u003e /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x0000004002369000)\r\n\tlibdl.so.2 =\u003e /lib/x86_64-linux-gnu/libdl.so.2 (0x0000004002378000)\r\n\tlibkeyutils.so.1 =\u003e /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x000000400237d000)\r\n\tlibresolv.so.2 =\u003e /lib/x86_64-linux-gnu/libresolv.so.2 (0x0000004002384000)\r\n\t/lib64/ld-linux-x86-64.so.2 (0x0000004000000000)\r\n```\r\n\r\n## The workaround\r\n\r\nI fixed it by running my process with `LD_PRELOAD=\"/lib/x86_64-linux-gnu/libgcrypt.so.20\" node build/server.js`\r\n\r\n## The root-cause and additional questions\r\n\r\n- Shouldn't the lib be included right at build time? It's very bad to discover a crash at runtime and not at build time 😓 \r\n- Is it possible I'll have other similar surprises at runtime, or the fact that it properly imports nodegit is enough to be reassured about this?","author":{"url":"https://github.com/nicolaschambrier","@type":"Person","name":"nicolaschambrier"},"datePublished":"2023-03-20T18:38:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1975/nodegit/issues/1975"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f073de3-2be8-ff96-52e9-84a4f65f09b3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9322:30C905:F4BD1B:1497416:6971D5CE |
| html-safe-nonce | b37b37ff5df83ba292b0a5a16ebf6b51af25e850928933617a2b43340b1d850b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzIyOjMwQzkwNTpGNEJEMUI6MTQ5NzQxNjo2OTcxRDVDRSIsInZpc2l0b3JfaWQiOiIxNDA4NjgzNDk3NDMyOTI5NzQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 54a69e9cb078110bf6323e3c511fe22b90c74355cb073811a267868640ba4b54 |
| hovercard-subject-tag | issue:1632666525 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/1975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/818e69e150746911db1eca26bc97f9baaae93d51903fae6872017e0f09d07672/nodegit/nodegit/issues/1975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/818e69e150746911db1eca26bc97f9baaae93d51903fae6872017e0f09d07672/nodegit/nodegit/issues/1975 |
| og:image:alt | System information node version: 18.15.0 npm or yarn version: yarn 1.22.19 OS/version/architecture: Linux a2a48d191f5f 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 x86_64 GNU/Linux ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicolaschambrier |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7476eb4140129667a7530d10cfb7688f701883e35a4dcaa4673e3ec599af5199 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2cc0827c872b538cd08371730242ae4951d2d61a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width