alfredopalhares / arch-pkgbuilds

Alfredo's Arch Linux PKGBUILDs
38 stars 24 forks source link

Failed in build(): root@workspace:. couldn't be built successfully #112

Closed cuihaoleo closed 10 months ago

cuihaoleo commented 2 years ago

When packaging 2.7.15-4, I got this error (joplin-2.7.15-4-x86_64-build.log):

➤ YN0009: │ root@workspace:. couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-68722820/build.log)
➤ YN0000: └ Completed in 1m 22s
➤ YN0000: Failed with errors in 1m 36s
==> ERROR: A failure occurred in build().
    Aborting...

The error in /tmp/xfs-68722820/build.log (full text)) is:

➤ YN0000: [joplin]: Process exited (exit code 0), completed in 6s 516ms
➤ YN0000: [@joplin/lib]: Process exited (exit code 0), completed in 8s 644ms
➤ YN0000: [@joplin/server]: Process exited (exit code 0), completed in 8s 726ms
➤ YN0000: [@joplin/app-desktop]: gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx(868,4): error TS2786: 'ErrorBoundary' cannot be used as a JSX component.
➤ YN0000: [@joplin/app-desktop]:   Its instance type 'ErrorBoundary' is not a valid JSX element.
➤ YN0000: [@joplin/app-desktop]:     The types returned by 'render()' are incompatible between these types.
➤ YN0000: [@joplin/app-desktop]:       Type '{}' is not assignable to type 'ReactNode'.
➤ YN0000: [@joplin/app-desktop]:         Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props
➤ YN0000: [@joplin/app-desktop]: gui/Root.tsx(257,4): error TS2786: 'ErrorBoundary' cannot be used as a JSX component.
➤ YN0000: [@joplin/app-desktop]:   Its instance ty
[joplin-2.7.15-4-x86_64-build.log](https://github.com/alfredopalhares/arch-pkgbuilds/files/8460838/joplin-2.7.15-4-x86_64-build.log)
pe 'ErrorBoundary' is not a valid JSX element.
➤ YN0000: [@joplin/app-desktop]: Process exited (exit code 2), completed in 11s 676ms
➤ YN0000: Done in 11s 684ms
    at makeError (/home/cuihao/tmp/joplin-tests/joplin-original/src/joplin-2.7.15/packages/tools/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/cuihao/tmp/joplin-tests/joplin-original/src/joplin-2.7.15/packages/tools/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async fn (/home/cuihao/tmp/joplin-tests/joplin-original/src/joplin-2.7.15/gulpfile.js:35:5)

I guess this is because some dependencies were updated. I tried to restore dependency pinning by commenting out the line rm "${srcdir}/joplin-${pkgver}/yarn.lock" in PKGBUILD, and got the same error as in #111

cuihaoleo commented 2 years ago

I don't know how to fix the PKGBUILD so I wrote a new one from scratch for archlinuxcn repo: https://github.com/archlinuxcn/repo/blob/69b44e1cf576ca261a4868906d5ab9f238570839/archlinuxcn/joplin/PKGBUILD It built successfully on my Arch PC and inside a clean chroot (extra-x86_64-build).

alfredopalhares commented 2 years ago

Hello,

Can you show your electron dependencies versions and the versions of the makedepends ?

sahal commented 2 years ago

Not sure why we're removing the package lock and yarn lock in the PKGBUILD. I'm no JS developer, but I think those are important to pin versions so these types of build issues don't occur.

If I modify the PKGBUILD included in this repo to comment out the removal of the package-lock.json and yarn.lock, Joplin builds correctly.

$ git diff | cat
diff --git a/PKGBUILD b/PKGBUILD
index 2b43429..2451e38 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -63,7 +63,7 @@ prepare() {
   fi

   msg2 "Deleting all package-locks.json"
-  find "${srcdir}/joplin-${pkgver}" -type f -name package-lock.json -delete
+#  find "${srcdir}/joplin-${pkgver}" -type f -name package-lock.json -delete
   msg2 "Appliying patches..."

   msg2 "Tweaking .yarnrc"
@@ -88,7 +88,7 @@ prepare() {
   cat "$desktop_package_json" | grep "electron-rebuild"

   msg2 "Removing yarn.lock"
-  rm "${srcdir}/joplin-${pkgver}/yarn.lock"
+#  rm "${srcdir}/joplin-${pkgver}/yarn.lock"
 }
alfredopalhares commented 2 years ago

@sahal good catch.

I intruduced them there while was trying to package joplin when it changed to yarn 3, i needed to some custumizations. I will remove this and do a release.

JPFrancoia commented 2 years ago

I confirm that @sahal fix works.

kentahikaru commented 2 years ago

commenting out those "removing of lock" lines worked for me too.

alfredopalhares commented 10 months ago

This has been fixed,reopen if necessary.