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

failing to use instructions from README #3783

Closed
r10s opened this issue Apr 22, 2024 · 9 comments
Closed

failing to use instructions from README #3783

r10s opened this issue Apr 22, 2024 · 9 comments
Labels
bug Something isn't working build build and release related issues OS: Mac Related to MacOS

Comments

@r10s
Copy link
Member

r10s commented Apr 22, 2024

for $reasons, i did a new checkout of deltachat-desktop and trying to build the project as described in README.md with ...

npm install

... which however fails with error Error: Command failed: npm run install:prebuilds after some weird compilation errors à la incompatible function pointer types passing

full log

it did work for me before, but that was an ages old checkout, might be i tweaked sth i forgot :)

  • rust is installed, and this is also not changed (and seems also be used regarding the log)
  • also tried suggestions from the troubleshooting and READMEs linked there - no success
  • i finally cleared Caches/node-gyp caches and rebooted - no success
  • an npm install & npm run build in deltachat-core-rust (following README there) fails in "build" with a similar error
  • i checked with master, 1.44.1 as well as adz/instant-onboarding — all fail

using macos 14.4.1, node 21.7.3

however, i am also only poking around in the dark, migth be it is sth basal i've just overseen or did wrong :)

@r10s r10s added bug Something isn't working build build and release related issues labels Apr 22, 2024
@link2xt
Copy link
Collaborator

link2xt commented Apr 22, 2024

Probably prebuild for the used core was not uploaded to npm.

EDIT: seems to be uploaded already :/

@r10s
Copy link
Member Author

r10s commented Apr 22, 2024

i also tried over with node 18 - similar issue:

log

EDIT: also same with node 20

@Simon-Laux
Copy link
Member

Simon-Laux commented Apr 22, 2024

deltachat-node has no arm/m1 prebuild, so it is always built. the "linking" to node step somehow fails for you, it looks like a nodejs header problem. For me node 18.18.2 worked.

Anyways might be easier to figure this issue out with a local core, so:

  • delete node_modules folder
  • checkout core repo, run npm run build in both repo-root folder and deltachat-jsonrpc/typescript/
  • run npm i ../deltachat-core-rust ../deltachat-core-rust/deltachat-jsonrpc/typescript in desktop repo (path should point to your core checkout)

If you already have a core git checkout, you can skip the first step.
1. clone the core repo, right next to your desktop repo folder: `git clone [email protected]:deltachat/deltachat-core-rust.git`
2. go into your core checkout and run `git pull` to update it to the newest version, then create a branch for your changes
3. run `npm i` and `npm run build` inside `../deltachat-core-rust/`
4. run `npm i` and `npm run build` inside `../deltachat-core-rust/deltachat-jsonrpc/typescript/`
5. go into your desktop repo and run `npm i ../deltachat-core-rust/deltachat-jsonrpc/typescript` and `npm i ../deltachat-core-rust`
Note that you need to run step 3 and 4 again after each change to core sourcecode.

@link2xt
Copy link
Collaborator

link2xt commented Apr 22, 2024

Similar issue: balena-io/balena-cli#2721

@link2xt
Copy link
Collaborator

link2xt commented Apr 22, 2024

This change seems to fix the problem in my case: deltachat/deltachat-core-rust#5489
I tried on macOS with node 20 installed via nix profile install nixpkgs#nodejs.

@link2xt
Copy link
Collaborator

link2xt commented Apr 22, 2024

@r10 What is your output of cc --version?

In my case problems happen with:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

It seems part of the problem is new clang which treats -Wincompatible-function-pointer-types as error by default.

@link2xt
Copy link
Collaborator

link2xt commented Apr 22, 2024

I have reproduced it with Node 18 and Xcode 15.3 in CI on macos-14 runner (macos-latest does not have Xcode 15.3): https://github.com/deltachat/deltachat-core-rust/actions/runs/8791852121/job/24126899012?pr=5488

Fix is at deltachat/deltachat-core-rust#5489

@r10s
Copy link
Member Author

r10s commented Apr 23, 2024

@Simon-Laux , @link2xt , @adbenitez thanks a lot for help! ❤️ i will try out the suggestions from simon to build core with the PR from link2xt.

but please do not let that block things and go forward to merge and do whatever is needed :)

EDIT: @link2xt cc --version shows the same for me:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

and, yes, iirc, there was an xcode update

@r10s
Copy link
Member Author

r10s commented Apr 23, 2024

i will try out the suggestions from simon to build core with the PR from link2xt

yeah, that works out. i am in business again :) thanks a lot for help, i would have no chance to build desktop without your help 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build build and release related issues OS: Mac Related to MacOS
Projects
None yet
Development

No branches or pull requests

4 participants