This is an issue that affects most XP-projects on Linux with the Snap CLI. The exception is some older versions of Node being used with 'com.github.node-gradle.node'.
Steps to reproduce:
Install the Enonic Cli as Snap on Linux
Create a new project with tsup-starter
Run enonic project build
This produces the error:
Building in sandbox 'hello'...
Welcome to Gradle 8.2.1!
Here are the highlights of this release:
- Kotlin DSL: new reference documentation, assignment syntax by default
- Kotlin DSL is now the default with Gradle init
- Improved suggestions to resolve errors in console output
- Reduced sync memory consumption
For more details see https://docs.gradle.org/8.2.1/release-notes.html
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :compileJava NO-SOURCE
> Task :processResources
> Task :classes
> Task :nodeSetup
> Task :npmSetup SKIPPED
> Task :npmInstall FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
3 actionable tasks: 3 executed
<-------------> 0% WAITING
> IDLE
node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':npmInstall'.
> Process 'command '/home/tomaj/code/testing/hello/.gradle/nodejs/node-v18.17.1-linux-x64/bin/npm'' finished with non-zero exit value 1
Running ./gradlew build works fine.
If I would guess what the problem is, I would say that packaging the CLI as Snap prevents Node to reach outside the sandbox and interact with The GNU C Library (glibc).
– Tom Arild
PS: I tried to report it on Slack, but I think everyone forgot about it as soon as I lost all my sandboxes.
ldd (Ubuntu GLIBC 2.37-0ubuntu2) 2.37
Copyright (C) 2023 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.
Written by Roland McGrath and Ulrich Drepper.
I’m don’t feel good about how I was treated the last time I tried to help Enonic debug a CLI-issue. There was no “sorry we made you loose all your sandboxes” or anything…
So if you see the slack thread I said the following:
This is the last time I help you guys debug a CLI-bug… It’s always someting…
And I stand by that. Fix the bug, or don’t… I don’t care. I’m not helping with debugging any more CLI-issues. I have reported it, and that is as far as I intend to go.
First of all - we are really sorry that you lost your data. This should’ve been clearly communicated right away, so I apologise for that as well. We have spent two days trying to reproduce your case, trying different ways of installing and uninstalling CLI from other sources along with already installed version of Snapcraft. The only case where we managed to delete data inside the Snapcraft installation was when we completely uninstalled the Snapcraft installation (which was not your case, as you mentioned this happened for you during installation, not when running CLI). So it’s still a bit of a mystery to us how this could happen but we absolutely understand and regret your frustration.
To be absolutely sure CLI won’t delete any data, we fixed one case where CLI tried to symlink manual installation of CLI with a new Snapcraft installation and moved the data under dot-enonic folder. This fix is available in 2.6.2-B1 on Snapcraft. Still not sure that’s what happened in your case, but at least we can now be sure that CLI won’t delete any data.
We really appreciate all the help and support you have provided us with over the last years and we’ll do our best to win back your good disposition towards Enonic
We have started investigating the problem you mentioned and will let you know when it’s fixed.