wireapp / wire-desktop

:computer: Wire for desktop
https://wire.com/download/
GNU General Public License v3.0
1.08k stars 234 forks source link

Can not build version 3.1 error: Could not compile `rust_sodium-sys` #1070

Closed Reichl closed 6 years ago

Reichl commented 6 years ago

Wire Version: 3.1 from github 19.10.17 cd8364cb3bc1671791dd261b7400c7117c483296 OS: OpenSuse Leap 42.3 Do you have an antivirus software installed: No

What steps will reproduce the problem?

m_reichl@reichl-x64:/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon> npm run build --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node6',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'build',
npm verb cli   '--verbose' ]
npm info using npm@3.10.8
npm info using node@v6.11.1
npm verb run-script [ 'prebuild', 'build', 'postbuild' ]
npm info lifecycle libsodium-neon@2.1.1~prebuild: libsodium-neon@2.1.1
npm info lifecycle libsodium-neon@2.1.1~build: libsodium-neon@2.1.1

> libsodium-neon@2.1.1 build /mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon
> neon build

neon info forcing rebuild for new build settings
neon info running cargo
   Compiling lazy_static v0.2.9
   Compiling gcc v0.3.54
   Compiling cfg-if v0.1.2
   Compiling neon-build v0.1.20
   Compiling cc v1.0.1
   Compiling utf8-ranges v1.0.0
   Compiling libsodium-neon v2.1.1 (file:///mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/native)
   Compiling unwrap v1.1.0
   Compiling regex-syntax v0.4.1
   Compiling podio v0.1.5
   Compiling cslice v0.2.0
   Compiling serde v1.0.15
   Compiling miniz-sys v0.1.10
   Compiling void v1.0.2
   Compiling unreachable v1.0.0
   Compiling thread_local v0.3.4
   Compiling libc v0.2.32
   Compiling bzip2-sys v0.1.6
   Compiling memchr v1.0.1
   Compiling rand v0.3.17
   Compiling aho-corasick v0.6.3
   Compiling filetime v0.1.14
   Compiling xattr v0.1.11
   Compiling tar v0.4.13
   Compiling time v0.1.38
   Compiling regex v0.2.2
   Compiling bzip2 v0.3.2
   Compiling flate2 v0.2.20
   Compiling neon v0.1.20
   Compiling msdos_time v0.1.5
   Compiling zip v0.2.6
   Compiling rust_sodium-sys v0.3.1
   Compiling neon-runtime v0.1.20
error: could not find native static library `sodium`, perhaps an -L flag is missing?

error: Could not compile `rust_sodium-sys`.

To learn more, run the command again with --verbose.
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/node_modules/neon-cli/dist/neon-cli/target.js:124:35)
    at step (/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/node_modules/neon-cli/dist/neon-cli/target.js:32:23)
    at Object.next (/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/node_modules/neon-cli/dist/neon-cli/target.js:13:53)
    at fulfilled (/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/node_modules/neon-cli/dist/neon-cli/target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)
npm verb lifecycle libsodium-neon@2.1.1~build: unsafe-perm in lifecycle true
npm verb lifecycle libsodium-neon@2.1.1~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/node_modules/.bin:/mnt/Musik/wire-desktop/electron/node_modules/.bin:/usr/NX/bin:/home/m_reichl/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
npm verb lifecycle libsodium-neon@2.1.1~build: CWD: /mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon
npm info lifecycle libsodium-neon@2.1.1~postbuild: libsodium-neon@2.1.1
npm verb exit [ 0, true ]
npm info ok 

Could build successfully wire-3.1.0-e15e0c1.x86_64.rpm from 6.10.17

mythsunwind commented 6 years ago

Can you check if you have the package libsodium or libsodium18 installed? If not, install it and try to compile again. Let us know if this works.

Reichl commented 6 years ago

libsodium18 is installed, see below. Looks like libsodium does not exist in OS Leap 42.3.

m_reichl@reichl-x64:~> zypper se sodium Repository-Daten werden geladen... Installierte Pakete werden gelesen...

S | Name | Zusammenfassung | Typ
---+-----------------+------------------------------------+------ i+ | libsodium-devel | Portable NaCl-based crypto library | Paket i+ | libsodium18 | Portable NaCl-based crypto library | Paket m_reichl@reichl-x64:~>

Reichl commented 6 years ago

m_reichl@reichl-x64:/usr/lib64> ls -al libsodium* lrwxrwxrwx 1 root root 19 10. Okt 17:12 libsodium.so -> libsodium.so.18.2.0 lrwxrwxrwx 1 root root 19 28. Jul 16:58 libsodium.so.18 -> libsodium.so.18.2.0 -rw-r--r-- 1 root root 446160 29. Mai 11:19 libsodium.so.18.2.0

mythsunwind commented 6 years ago

Unfortunately I have no OpenSuse to test. Do you compile with grunt --arch=amd64 --target=rpm linux-other?

Reichl commented 6 years ago

The error with libsodium above comes already when doing "npm install"

m_reichl@reichl-x64:/mnt/Musik/wire-desktop> npm install

> wire-desktop@ preinstall /mnt/Musik/wire-desktop
> cd electron && npm install

> wire-desktop@ install /mnt/Musik/wire-desktop
> cd electron && npm run rebuild-native-modules

> wireinternal@ rebuild-native-modules /mnt/Musik/wire-desktop/electron
> node ./rebuild-native-modules.js "electron-rebuild" "-f -m ./"

✔ Rebuild Complete

> wire-desktop@ postinstall /mnt/Musik/wire-desktop
> cd electron && npm run rebuild-neon

> wireinternal@ rebuild-neon /mnt/Musik/wire-desktop/electron
> node ./rebuild-native-modules.js "electron-build-env" "neon build libsodium-neon"

neon info forcing rebuild for new build settings
neon info running cargo
   Compiling neon-build v0.1.20
   Compiling serde v1.0.15
   Compiling unwrap v1.1.0
   Compiling podio v0.1.5
   Compiling utf8-ranges v1.0.0
   Compiling cslice v0.2.0
   Compiling libsodium-neon v2.1.1 (file:///mnt/Musik/wire-desktop/electron/node_modules/libsodium-neon/native)
   Compiling void v1.0.2
   Compiling regex-syntax v0.4.1
   Compiling gcc v0.3.54
   Compiling cc v1.0.1
   Compiling lazy_static v0.2.9
   Compiling unreachable v1.0.0
   Compiling neon v0.1.20
   Compiling thread_local v0.3.4
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.32
   Compiling miniz-sys v0.1.10
   Compiling bzip2-sys v0.1.6
   Compiling memchr v1.0.1
   Compiling time v0.1.38
   Compiling filetime v0.1.14
   Compiling aho-corasick v0.6.3
   Compiling regex v0.2.2
   Compiling bzip2 v0.3.2
   Compiling msdos_time v0.1.5
   Compiling xattr v0.1.11
   Compiling flate2 v0.2.20
   Compiling tar v0.4.13
   Compiling rand v0.3.17
   Compiling zip v0.2.6
   Compiling rust_sodium-sys v0.3.1
   Compiling neon-runtime v0.1.20
error: could not find native static library `sodium`, perhaps an -L flag is missing?

error: Could not compile `rust_sodium-sys`.

To learn more, run the command again with --verbose.
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (/mnt/Musik/wire-desktop/electron/node_modules/neon-cli/dist/neon-cli/target.js:124:35)
    at step (/mnt/Musik/wire-desktop/electron/node_modules/neon-cli/dist/neon-cli/target.js:32:23)
    at Object.next (/mnt/Musik/wire-desktop/electron/node_modules/neon-cli/dist/neon-cli/target.js:13:53)
    at fulfilled (/mnt/Musik/wire-desktop/electron/node_modules/neon-cli/dist/neon-cli/target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:109:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@^2.1.1 (node_modules/7zip-bin/node_modules/7zip-bin-win):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-win@2.1.1: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@^1.0.1 (node_modules/7zip-bin/node_modules/7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.1 (node_modules/sane/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Ignoring this and doing grunt --arch=amd64 --target=rpm linux-other I get :

m_reichl@reichl-x64:/mnt/Musik/wire-desktop> grunt --arch=amd64 --target=rpm linux-other
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected token )
Warning: Task "linux-other" not found. Use --force to continue.

Aborted due to warnings.

With my successfull build some weeks ago both commands npm install and grunt --arch=amd64 --target=rpm linux-other did run without errors.

mythsunwind commented 6 years ago

The Gruntfile was recently changed from CoffeeScript to ES6 Javascript. It seems your node cannot interpret this file correctly or there is an issue with the file. You probably need a nodejs version >= 8 now. Can you check which version you are using and if updating node to the current (8.7) helps?

P.S.: Can you please use the formatting features of github to make the code distinguishable from your comments

Reichl commented 6 years ago

Ok, will update to nodejs 8.7 and come back. But isn't the libsodium issue above a different problem?

mythsunwind commented 6 years ago

Yes, it looks like a different problem. But it could be also that the rust compiler wants to compile for 32-bit platform instead of 64 and you have only the 64-bit libsodium installed. I hope that this is the problem, because I am out of ideas :(

Reichl commented 6 years ago

With updated nodejs:

m_reichl@reichl-x64:/mnt/Musik/wire-desktop> grunt --arch=amd64 --target=rpm linux-other
Running "clean:linux" (clean) task
>> 0 paths cleaned.
Running "update-keys" task
Running "gitinfo" task
Running "release-prod" task
Releases URL points to https://wire-app.wire.com/win/prod/ OK
Running "bundle" task
Running "electronbuilder:linux_other" (electronbuilder) task
Warning: Unsupported arch amd64 Use --force to continue.
Aborted due to warnings.
Reichl commented 6 years ago

--arch has to be x64 for grunt: grunt --arch=x64 --target=rpm linux-other then wire-3.1.0-cd8364c.x86_64.rpm is built. Do I need the libsodium stuff anway?

mythsunwind commented 6 years ago

You are right x64 it is.

You do not need libsodium necessarily, but it will make decrypting/encrypting messages faster.

Reichl commented 6 years ago

Thanks, just checked under Debian 8/stretch, compiling rust_sodium-sys works there.

ffflorian commented 6 years ago

Hi @Reichl, sorry to hear that you have problems with building on openSUSE.

In general it should not be necessary to have libsodium installed. Can you tell me which Rust version you use and if you use nightly or stable?

Reichl commented 6 years ago

m_reichl@reichl-x64:~> rustc --version rustc 1.21.0 (3b72af97e 2017-10-09)
This is the same as on Debian 8, where building works. Building an rpm on Opensuse without libsodium works.

ffflorian commented 6 years ago

@Reichl I tested it on a fresh openSUSE 42.3 installation and unfortunately I can't reproduce your error.

Install Log ``` florian@linux-1qwt:~/git/wire-desktop> rustc --version rustc 1.21.0 (3b72af97e 2017-10-09) florian@linux-1qwt:~/git/wire-desktop> git reset --hard cd8364cb3bc1671791dd261b7400c7117c483296 HEAD is now at cd8364c chore: Update version to 3.1 (#1068) florian@linux-1qwt:~/git/wire-desktop> npm i > wire-desktop@ preinstall /home/florian/git/wire-desktop > cd electron && npm install up to date in 1.488s > electron@1.7.9 postinstall /home/florian/git/wire-desktop/node_modules/electron > node install.js > wire-desktop@ install /home/florian/git/wire-desktop > cd electron && npm run rebuild-native-modules > wireinternal@ rebuild-native-modules /home/florian/git/wire-desktop/electron > node ./rebuild-native-modules.js "electron-rebuild" "-f -m ./" ✔ Rebuild Complete > wire-desktop@ postinstall /home/florian/git/wire-desktop > cd electron && npm run rebuild-neon > wireinternal@ rebuild-neon /home/florian/git/wire-desktop/electron > node ./rebuild-native-modules.js "electron-build-env" "neon build libsodium-neon" neon info forcing rebuild for new build settings neon info running cargo Updating registry `https://github.com/rust-lang/crates.io-index` Downloading neon v0.1.20 Downloading libc v0.2.32 Downloading rust_sodium v0.3.0 Downloading cslice v0.2.0 Downloading neon-runtime v0.1.20 Downloading gcc v0.3.54 Downloading regex v0.2.2 Downloading memchr v1.0.2 Downloading thread_local v0.3.4 Downloading aho-corasick v0.6.3 Downloading utf8-ranges v1.0.0 Downloading regex-syntax v0.4.1 Downloading unreachable v1.0.0 Downloading lazy_static v0.2.9 Downloading void v1.0.2 Downloading neon-build v0.1.20 Downloading rust_sodium-sys v0.3.1 Downloading rand v0.3.17 Downloading unwrap v1.1.0 Downloading serde v1.0.16 Downloading zip v0.2.6 Downloading tar v0.4.13 Downloading flate2 v0.2.20 Downloading time v0.1.38 Downloading bzip2 v0.3.2 Downloading msdos_time v0.1.5 Downloading podio v0.1.5 Downloading miniz-sys v0.1.10 Downloading cc v1.0.1 Downloading bzip2-sys v0.1.6 Downloading filetime v0.1.14 Downloading cfg-if v0.1.2 Downloading xattr v0.1.11 Compiling cfg-if v0.1.2 Compiling unwrap v1.1.0 Compiling gcc v0.3.54 Compiling serde v1.0.16 Compiling regex-syntax v0.4.1 Compiling neon-build v0.1.20 Compiling cc v1.0.1 Compiling libc v0.2.32 Compiling cslice v0.2.0 Compiling void v1.0.2 Compiling utf8-ranges v1.0.0 Compiling podio v0.1.5 Compiling lazy_static v0.2.9 Compiling libsodium-neon v2.1.1 (file:///home/florian/git/wire-desktop/electron/node_modules/libsodium-neon/native) Compiling neon v0.1.20 Compiling bzip2-sys v0.1.6 Compiling miniz-sys v0.1.10 Compiling memchr v1.0.2 Compiling rand v0.3.17 Compiling time v0.1.38 Compiling xattr v0.1.11 Compiling filetime v0.1.14 Compiling unreachable v1.0.0 Compiling aho-corasick v0.6.3 Compiling msdos_time v0.1.5 Compiling tar v0.4.13 Compiling thread_local v0.3.4 Compiling regex v0.2.2 Compiling bzip2 v0.3.2 Compiling flate2 v0.2.20 Compiling neon-runtime v0.1.20 Compiling zip v0.2.6 Compiling rust_sodium-sys v0.3.1 Compiling rust_sodium v0.3.0 Finished release [optimized] target(s) in 142.21 secs neon info generating native/index.node npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-win@2.1.1 (node_modules/7zip-bin-win): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-win@2.1.1: wanted {"os":"win32","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac@1.0.1 (node_modules/7zip-bin-mac): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac@1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) added 128 packages in 322.37s florian@linux-1qwt:~/git/wire-desktop> ```
ConorIA commented 6 years ago

@Reichl, when I tried a few months ago, electron-builder gave me a garbage rpm. Did yours work? Anyway, that led me to get up to all this, with this end result.

Reichl commented 6 years ago

@ConorIA, thanks for the links. The generated rpms do work and install with only a minor dep issue under Opensuse 42.3: The rpm requires libappindicator whereas Opensuse provides libappindicator1 and libappindicator3-1. The program nevertheless works when installed with rpm --nodeps. I build under Debian 8 for Opensuse because I could not fix the above compiling error for libsodium on my Opensuse machine.

rriemann commented 6 years ago

I ran into the same error message and tried to solve it by installing libsodium18 from https://software.opensuse.org/package/libsodium18 as my opensuse Tumbleweed (rolling release) has only libsodium23.

However, this did not solve the problem.

I found out that the rpm for Fedor rawhide provided by https://gitlab.com/ConorIA/wire-builds can be installed on opensuse and the app seems to work well in a first test.