Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.73k stars 240 forks source link

[Bug]: Failed to build from source (protobufjs and esbuild couldn't be built) #138

Closed vibl closed 1 year ago

vibl commented 1 year ago

What happened?

Here are the command I use to try build Rivet, and the resulting errors:

git clone --filter=blob:none git@github.com:Ironclad/rivet.git
cd rivet
nvm use 20
yarn
yarn dev

The yarn dev command fails:

➤ YN0000: ┌ Project validation
➤ YN0057: │ @ironclad/rivet-app: Resolutions field will be ignored
➤ YN0000: └ Completed
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @algolia/autocomplete-core@npm:1.9.3 doesn't provide @algolia/client-search (pbc410), requested by @algolia/autocomplete-shared
➤ YN0002: │ @algolia/autocomplete-core@npm:1.9.3 doesn't provide algoliasearch (p8ad5b), requested by @algolia/autocomplete-shared
➤ YN0002: │ @algolia/autocomplete-core@npm:1.9.3 doesn't provide search-insights (pfdb70), requested by @algolia/autocomplete-plugin-algolia-insights
➤ YN0002: │ @algolia/autocomplete-plugin-algolia-insights@npm:1.9.3 [e43f4] doesn't provide @algolia/client-search (pdf3b9), requested by @algolia/autocomplete-shared
➤ YN0002: │ @algolia/autocomplete-plugin-algolia-insights@npm:1.9.3 [e43f4] doesn't provide algoliasearch (p0f6bb), requested by @algolia/autocomplete-shared
➤ YN0002: │ @atlaskit/modal-dialog@npm:12.6.4 [388c2] doesn't provide react-dom (p71a81), requested by @atlaskit/portal
➤ YN0002: │ @atlaskit/popper@npm:5.5.3 [af08a] doesn't provide react-dom (pe6a9b), requested by react-popper
➤ YN0002: │ @atlaskit/side-navigation@npm:2.0.3 [388c2] doesn't provide react-dom (pe90e8), requested by @atlaskit/menu
➤ YN0002: │ @docsearch/react@npm:3.5.1 [45935] doesn't provide @algolia/client-search (pc8a10), requested by @algolia/autocomplete-preset-algolia
➤ YN0002: │ @ironclad/rivet-app@workspace:packages/app doesn't provide @typescript-eslint/parser (p52c17), requested by @typescript-eslint/eslint-plugin
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pbd4a5) with version 18.2.0, which doesn't satisfy what @atlaskit/tokens requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p09bd4) with version 18.2.0, which doesn't satisfy what @atlaskit/theme requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p47042) with version 18.2.0, which doesn't satisfy what @atlaskit/icon requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pc7cba) with version 18.2.0, which doesn't satisfy what @atlaskit/button and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p613bc) with version 18.2.0, which doesn't satisfy what @atlaskit/menu requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p281dc) with version 18.2.0, which doesn't satisfy what @atlaskit/popup requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pad932) with version 18.2.0, which doesn't satisfy what @atlaskit/form and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p318a7) with version 18.2.0, which doesn't satisfy what @atlaskit/textfield requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pc532f) with version 18.2.0, which doesn't satisfy what @atlaskit/portal requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p47850) with version 18.2.0, which doesn't satisfy what @atlaskit/banner and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p7d69a) with version 18.2.0, which doesn't satisfy what @atlaskit/checkbox requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pb1f52) with version 18.2.0, which doesn't satisfy what @atlaskit/css-reset requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p25415) with version 18.2.0, which doesn't satisfy what @atlaskit/dropdown-menu and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pde336) with version 18.2.0, which doesn't satisfy what @atlaskit/inline-edit and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p15f9e) with version 18.2.0, which doesn't satisfy what @atlaskit/modal-dialog and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (pf703f) with version 18.2.0, which doesn't satisfy what @atlaskit/select and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p39fd4) with version 18.2.0, which doesn't satisfy what @atlaskit/side-navigation and some of its descendants request
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p67a5d) with version 18.2.0, which doesn't satisfy what @atlaskit/tabs requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p581bd) with version 18.2.0, which doesn't satisfy what @atlaskit/textarea requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react (p35fc4) with version 18.2.0, which doesn't satisfy what @atlaskit/toggle requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react-dom (pe223a) with version 18.2.0, which doesn't satisfy what @atlaskit/menu requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react-dom (p7f140) with version 18.2.0, which doesn't satisfy what @atlaskit/popup requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react-dom (p21edf) with version 18.2.0, which doesn't satisfy what @atlaskit/portal requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react-dom (p6f1aa) with version 18.2.0, which doesn't satisfy what @atlaskit/dropdown-menu requests
➤ YN0060: │ @ironclad/rivet-app@workspace:packages/app provides react-dom (p3d925) with version 18.2.0, which doesn't satisfy what @atlaskit/select and some of its descendants request
➤ YN0002: │ @ironclad/rivet-core@workspace:packages/core doesn't provide @types/node (p2a077), requested by ts-node
➤ YN0002: │ @ironclad/rivet-core@workspace:packages/core doesn't provide @typescript-eslint/parser (pcafdb), requested by @typescript-eslint/eslint-plugin
➤ YN0002: │ @ironclad/rivet-node@workspace:packages/node doesn't provide @typescript-eslint/parser (p5d7b8), requested by @typescript-eslint/eslint-plugin
➤ YN0002: │ @ironclad/rivet@workspace:. doesn't provide @typescript-eslint/parser (p14739), requested by @typescript-eslint/eslint-plugin
➤ YN0002: │ @ironclad/trivet@workspace:packages/trivet doesn't provide @typescript-eslint/parser (pc3af5), requested by @typescript-eslint/eslint-plugin
➤ YN0060: │ docs@workspace:packages/docs provides react (p4e1cc) with version 18.2.0, which doesn't satisfy what @docusaurus/types requests
➤ YN0060: │ docs@workspace:packages/docs provides react (p9d5e3) with version 18.2.0, which doesn't satisfy what @docusaurus/core and some of its descendants request
➤ YN0060: │ docs@workspace:packages/docs provides react (p1334f) with version 18.2.0, which doesn't satisfy what @mdx-js/react requests
➤ YN0060: │ docs@workspace:packages/docs provides react (p0e283) with version 18.2.0, which doesn't satisfy what @docusaurus/preset-classic and some of its descendants request
➤ YN0060: │ docs@workspace:packages/docs provides react-dom (p1a640) with version 18.2.0, which doesn't satisfy what @docusaurus/types requests
➤ YN0060: │ docs@workspace:packages/docs provides react-dom (p47f6f) with version 18.2.0, which doesn't satisfy what @docusaurus/core and some of its descendants request
➤ YN0060: │ docs@workspace:packages/docs provides react-dom (p45133) with version 18.2.0, which doesn't satisfy what @docusaurus/preset-classic and some of its descendants request
➤ YN0002: │ eslint-config-react-app@npm:7.0.1 [388c2] doesn't provide @babel/plugin-syntax-flow (p32599), requested by eslint-plugin-flowtype
➤ YN0002: │ eslint-config-react-app@npm:7.0.1 [388c2] doesn't provide @babel/plugin-transform-react-jsx (pff2ca), requested by eslint-plugin-flowtype
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 223ms
➤ YN0000: ┌ Fetch step
➤ YN0019: │ @esbuild-darwin-arm64-npm-0.18.17-4da6dfeef9-9.zip appears to be unused - removing
➤ YN0019: │ @esbuild-darwin-arm64-npm-0.19.1-f737930702-9.zip appears to be unused - removing
➤ YN0019: │ @swc-core-darwin-arm64-npm-1.3.71-5ea24a12db-9.zip appears to be unused - removing
➤ YN0019: │ @tauri-apps-cli-darwin-arm64-npm-1.4.0-07239c8e68-9.zip appears to be unused - removing
➤ YN0019: │ fsevents-patch-19706e7e35-9.zip appears to be unused - removing
➤ YN0000: └ Completed in 0s 317ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ esbuild@npm:0.19.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.17.19 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.18.17 must be built because it never has been before or the last one failed
➤ YN0007: │ @swc/core@npm:1.3.71 [36b10] must be built because it never has been before or the last one failed
➤ YN0007: │ protobufjs@npm:7.2.4 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.32.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.31.0 must be built because it never has been before or the last one failed
➤ YN0009: │ protobufjs@npm:7.2.4 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-46cfb9aa/build.log)
➤ YN0009: │ esbuild@npm:0.19.1 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-03f71264/build.log)
➤ YN0009: │ esbuild@npm:0.18.17 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-14790621/build.log)
➤ YN0009: │ esbuild@npm:0.17.19 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-07c8db9e/build.log)
➤ YN0000: └ Completed in 2s 306ms
➤ YN0000: Failed with errors in 3s 83ms

If I run it again, it fails with another error message:

yarn dev

Type Error: Cannot read properties of undefined (reading '/home/vianney/dev/js/forks/rivet/.pnp.cjs')
    at wne (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:134:54215)
    at LXe (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:134:54684)
    at Object.zp (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:134:54825)
    at /home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:650:4665
    at Object.Sf (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:134:53360)
    at vh.findPackageLocation (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:650:4620)
    at /home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:184:1268
    at Function.from (<anonymous>)
    at qx (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:184:1012)
    at wue (/home/vianney/dev/js/forks/rivet/.yarn/releases/yarn-4.0.0-rc.45.cjs:184:1595)

What was the expected functionality?

Build

Describe your environment

Kubuntu 23.04 Node.js v20.6.1

Relevant log output

The file logs:


cat /tmp/xfs-46cfb9aa/build.log

# This file contains the result of Yarn building a package (protobufjs@npm:7.2.4)
# Script name: postinstall

node:internal/process/esm_loader:48
      internalBinding('errors').triggerUncaughtException(
                                ^
TypeError [Error]: [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///home/vianney/dev/js/forks/rivet/.yarn/unplugged/protobufjs-npm-7.2.4-c40bd79e8d/node_modules/protobufjs/package.json" needs an import assertion of type "json"
    at load$1 (file:///home/vianney/dev/js/forks/rivet/.pnp.loader.mjs:1487:17)
    at nextLoad (node:internal/modules/esm/hooks:832:28)
    at Hooks.load (node:internal/modules/esm/hooks:415:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}
cat /tmp/xfs-03f71264/build.log

# This file contains the result of Yarn building a package (esbuild@npm:0.19.1)
# Script name: postinstall

node:internal/process/esm_loader:48
      internalBinding('errors').triggerUncaughtException(
                                ^
TypeError [Error]: [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///home/vianney/dev/js/forks/rivet/.yarn/unplugged/esbuild-npm-0.19.1-892202a3bf/node_modules/esbuild/package.json" needs an import assertion of type "json"
    at load$1 (file:///home/vianney/dev/js/forks/rivet/.pnp.loader.mjs:1487:17)
    at nextLoad (node:internal/modules/esm/hooks:832:28)
    at Hooks.load (node:internal/modules/esm/hooks:415:26)
    at handleMessage (node:internal/modules/esm/worker:168:24)
    at checkForMessages (node:internal/modules/esm/worker:117:28)
    at process.<anonymous> (node:internal/modules/esm/worker:136:5)
    at process.emit (node:events:514:28)
    at process.emit (/home/vianney/dev/js/forks/rivet/.pnp.cjs:29840:25) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}

The other log files are the same.

Relevant screenshots

No response

Code of Conduct

abrenneke commented 1 year ago

@vibl try node 20.4, 20.6.1 doesn't seem to have prebuilt binaries yet.

vibl commented 1 year ago

Using Node 20.4, it does build but with some errors:


yarn dev

Bundling to bin/executor-bundle.js...
Compiling to native binary for linux...
> pkg@5.8.1
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v18.5.0-linux-x64           [====================] 100%

> Warning Cannot resolve 'config.extends'
  /home/vianney/dev/js/forks/rivet/packages/app-executor/bin/executor-bundle.js
  Dynamic require may fail at run time, because the requested file
  is unknown at compilation time and not included into executable.
  Use a string literal as an argument for 'require', or leave it
  as is and specify the resolved file name in 'scripts' option.
> Warning Cannot resolve 'path2'
  /home/vianney/dev/js/forks/rivet/packages/app-executor/bin/executor-bundle.js
  Dynamic require may fail at run time, because the requested file
  is unknown at compilation time and not included into executable.
  Use a string literal as an argument for 'require', or leave it
  as is and specify the resolved file name in 'scripts' option.
Copied dist/rivet-app-executor to dist/app-executor-x86_64-unknown-linux-gnu for tauri sidecar
     Running BeforeDevCommand (`yarn start`)

  VITE v4.4.7  ready in 494 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
        Info Watching /home/vianney/dev/js/forks/rivet/packages/app/src-tauri for changes...
    Updating crates.io index
    Updating git repository `https://github.com/tauri-apps/plugins-workspace`
    Updating git repository `https://github.com/tauri-apps/plugins-workspace`
  Downloaded gdkwayland-sys v0.15.3
  Downloaded string_cache_codegen v0.5.2
  Downloaded alloc-stdlib v0.2.2
  [...]
   Compiling regex-automata v0.3.6
   Compiling json-patch v1.0.0
   Compiling tauri-utils v1.4.0
The following warnings were emitted during compilation:

warning: `"pkg-config" "--libs" "--cflags" "libsoup-2.4" "libsoup-2.4 >= 2.62"` did not exit successfully: exit status: 1

error: failed to run custom build command for `soup2-sys v0.2.0`

Caused by:
  process didn't exit successfully: `/home/vianney/dev/js/forks/rivet/packages/app/src-tauri/target/debug/build/soup2-sys-3b58d5373361346e/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBSOUP_2.4_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=`"pkg-config" "--libs" "--cflags" "libsoup-2.4" "libsoup-2.4 >= 2.62"` did not exit successfully: exit status: 1
  error: could not find system library 'libsoup-2.4' required by the 'soup2-sys' crate

  --- stderr
  Package libsoup-2.4 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libsoup-2.4.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'libsoup-2.4', required by 'virtual:world', not found
  Package 'libsoup-2.4', required by 'virtual:world', not found

warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: `"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1

error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`

Caused by:
  process didn't exit successfully: `/home/vianney/dev/js/forks/rivet/packages/app/src-tauri/target/debug/build/javascriptcore-rs-sys-e38355fbdda0f806/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=JAVASCRIPTCOREGTK_4.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=`"pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.0" "javascriptcoregtk-4.0 >= 2.24"` did not exit successfully: exit status: 1
  error: could not find system library 'javascriptcoregtk-4.0' required by the 'javascriptcore-rs-sys' crate

  --- stderr
  Package javascriptcoregtk-4.0 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `javascriptcoregtk-4.0.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'javascriptcoregtk-4.0', required by 'virtual:world', not found
  Package 'javascriptcoregtk-4.0', required by 'virtual:world', not found
vibl commented 1 year ago

I created a separate issue for this, for better future reference: https://github.com/Ironclad/rivet/issues/146

Closing this one.