Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

[DEV]: make build fails with error TS2370: A rest parameter must be of an array type. #506

Open
ChocolateMagnate opened this issue May 27, 2024 · 0 comments
Labels
dev Developers only issue

Comments

@ChocolateMagnate
Copy link

ChocolateMagnate commented May 27, 2024

Summary

Cloning the repository, setting the environment and building with Make fails with a TypeScript compiler error:

cd /home/chocolate-magnate/Software-Engineering/Clones/bismuth/build/src/kwinscript && npx tsc --noEmit --incremental && npx esbuild --bundle /home/chocolate-magnate/Software-Engineering/Clones/bismuth/src/kwinscript/index.ts --outfile=/home/chocolate-magnate/Software-Engineering/Clones/bismuth/build/src/kwinscript/bismuth/contents/code/index.mjs --format=esm --platform=neutral
../../../node_modules/@types/node/events.d.ts(102,43): error TS2370: A rest parameter must be of an array type.

Expected behaviour: building the project succeeds.
Actual behaviour: a the TypeScript error TS2370: A rest parameter must be of an array type fails the build process.

[chocolate-magnate@millenium bismuth]$ make setup-dev-env
scripts/sysdep-install.sh
⛓️ Installing system dependencies...
⚠ Your distribution is Gentoo Linux, but you have to install system dependencies manually.
pre-commit install
pre-commit installed at .git/hooks/pre-commit
npm install # Install development dependencies
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@es-joy/[email protected]',
npm warn EBADENGINE   required: { node: '^12 || ^14 || ^16 || ^17' },
npm warn EBADENGINE   current: { node: 'v22.1.0', npm: '10.7.0' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '[email protected]',
npm warn EBADENGINE   required: { node: '^12 || ^14 || ^16 || ^17' },
npm warn EBADENGINE   current: { node: 'v22.1.0', npm: '10.7.0' }
npm warn EBADENGINE }

up to date, audited 221 packages in 6s

37 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.0
npm notice To update run: npm install -g [email protected]
npm notice
[chocolate-magnate@millenium bismuth]$ make build
scripts/build.sh
🏗️ Building Bismuth...
-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found KF5Config: /usr/lib64/cmake/KF5Config/KF5ConfigConfig.cmake (found version "5.116.0")
-- Found KF5ConfigWidgets: /usr/lib64/cmake/KF5ConfigWidgets/KF5ConfigWidgetsConfig.cmake (found version "5.116.0")
-- Found KF5CoreAddons: /usr/lib64/cmake/KF5CoreAddons/KF5CoreAddonsConfig.cmake (found version "5.116.0")
-- Found KF5Declarative: /usr/lib64/cmake/KF5Declarative/KF5DeclarativeConfig.cmake (found version "5.116.0")
-- Found KF5GlobalAccel: /usr/lib64/cmake/KF5GlobalAccel/KF5GlobalAccelConfig.cmake (found version "5.116.0")
-- Found KF5KCMUtils: /usr/lib64/cmake/KF5KCMUtils/KF5KCMUtilsConfig.cmake (found version "5.116.0")
-- Found KF5I18n: /usr/lib64/cmake/KF5I18n/KF5I18nConfig.cmake (found version "5.116.0")
-- Found KF5: success (found suitable version "5.116.0", minimum required is "5.78.0") found components: Config ConfigWidgets CoreAddons Declarative GlobalAccel KCMUtils I18n
CMake Warning at /usr/lib64/cmake/KF5CoreAddons/KF5CoreAddonsMacros.cmake:37 (message):
  kcoreaddons_desktop_to_json is deprecated and will be removed in KF6.
  Convert the desktop files to JSON in source using the desktoptojson
  executable
Call Stack (most recent call first):
  src/kcm/CMakeLists.txt:25 (kcoreaddons_desktop_to_json)


CMake Warning at /usr/lib64/cmake/KF5Package/KF5PackageMacros.cmake:46 (message):
  Providing metadata with .desktop files is deprecated.  Please run
  "desktoptojson -i
  /home/chocolate-magnate/Software-Engineering/Clones/bismuth/src/kcm/package/metadata.desktop"
  to convert the file to json and remove the desktop file
Call Stack (most recent call first):
  src/kcm/CMakeLists.txt:33 (kpackage_install_package)


CMake Warning at /usr/lib64/cmake/KF5CoreAddons/KF5CoreAddonsMacros.cmake:37 (message):
  kcoreaddons_desktop_to_json is deprecated and will be removed in KF6.
  Convert the desktop files to JSON in source using the desktoptojson
  executable
Call Stack (most recent call first):
  /usr/lib64/cmake/KF5Package/KF5PackageMacros.cmake:49 (kcoreaddons_desktop_to_json)
  src/kcm/CMakeLists.txt:33 (kpackage_install_package)


-- Configuring done (2.5s)
-- Generating done (0.1s)
-- Build files have been written to: /home/chocolate-magnate/Software-Engineering/Clones/bismuth/build
[0/2] Re-checking globbed directories...
[6/29] 🏗️ Compiling and bundling TypeScript sources...
FAILED: src/kwinscript/bismuth/contents/code/index.mjs /home/chocolate-magnate/Software-Engineering/Clones/bismuth/build/src/kwinscript/bismuth/contents/code/index.mjs 
cd /home/chocolate-magnate/Software-Engineering/Clones/bismuth/build/src/kwinscript && npx tsc --noEmit --incremental && npx esbuild --bundle /home/chocolate-magnate/Software-Engineering/Clones/bismuth/src/kwinscript/index.ts --outfile=/home/chocolate-magnate/Software-Engineering/Clones/bismuth/build/src/kwinscript/bismuth/contents/code/index.mjs --format=esm --platform=neutral
../../../node_modules/@types/node/events.d.ts(102,43): error TS2370: A rest parameter must be of an array type.
[11/29] Building CXX object src/core/CMakeFiles/bismuth_core.dir/qml-plugin.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:12: build] Error 1

Additional info

Branch: master, latest commit:

[chocolate-magnate@millenium bismuth]$ git switch master
Already on 'master'
Your branch is up to date with 'origin/master'.

Operating system: Gentoo Linux, kernel 6.8.9-gentoo-x86_64.
Make, Cmake, GCC and TypeScript versions:

[chocolate-magnate@millenium bismuth]$ make --version
GNU Make 4.4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[chocolate-magnate@millenium bismuth]$ cmake --version 
cmake version 3.29.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[chocolate-magnate@millenium bismuth]$ gcc --version 
gcc (Gentoo 14.1.1_p20240518 p1) 14.1.1 20240516
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[chocolate-magnate@millenium bismuth]$ tsc --version 
Version 5.4.5
@ChocolateMagnate ChocolateMagnate added the dev Developers only issue label May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dev Developers only issue
Projects
None yet
Development

No branches or pull requests

1 participant