e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 34 forks source link

`npx cordova` freezes on Linux Machines #1054

Open the-bay-kay opened 9 months ago

the-bay-kay commented 9 months ago

Background

The Issue

Following our build instructions for android (link), the build process fails when running bash setup/setup_android_native.sh. When running this script, it freezes at this point:

# .... More output above
added 76 packages, removed 256 packages, changed 1 package, and audited 2435 packages in 30s

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

54 vulnerabilities (2 low, 21 moderate, 17 high, 14 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
hack to make the local cordova fail on error

Going into the setup scripts (link), each test of this script seems to freeze upon the execution of npx cordova prepare. Indeed, after testing, it seems that any variation of npx cordova freezes at this point in the Linux install. This appears to be unusual behavior, as this command is run in both iOS and Android setup - and the MacOS builds I have done have not had this issue. Furthermore, running any version of npx cordova on MacOS executes as expected.

Working Theories

So far, I know that:

Given the information above, all signs seem to point to an error with how we install the cordova packages: specifically, cordova@11.1.0 Running npm list | grep cordova after the freeze occurs results in the following outputs:

├── @havesource/cordova-plugin-push@4.0.0-dev.0 (git+ssh://git@github.com/havesource/cordova-plugin-push.git#c3fb5b894afe17a05e21be135961f5831bafb1e0)
├── cordova-android@12.0.0
├── cordova-custom-config@5.1.1
├── cordova-ios@6.2.0
├── cordova-plugin-advanced-http@3.3.1
├── cordova-plugin-androidx-adapter@1.1.3
├── cordova-plugin-app-version@0.1.14
├── cordova-plugin-bluetooth-classic-serial-port@0.9.13
├── cordova-plugin-customurlscheme@5.0.2
├── cordova-plugin-device@2.1.0
├── cordova-plugin-em-datacollection@1.7.8 (git+ssh://git@github.com/e-mission/e-mission-data-collection.git#0ef1cd30fa305090eabcbd199d8f2d6be323f35a)
├── cordova-plugin-em-opcodeauth@1.7.1 (git+ssh://git@github.com/e-mission/cordova-jwt-auth.git#141cf3c378da0563ba1f868dca2341ce71dd98ba)
├── cordova-plugin-em-server-communication@1.2.5 (git+ssh://git@github.com/e-mission/cordova-server-communication.git#72d3a4e73003e99e952f965649ef3ce0ac191a84)
├── cordova-plugin-em-serversync@1.3.1 (git+ssh://git@github.com/e-mission/cordova-server-sync.git#01c4e4cb7cd9bfd1b86f451d184ae187139ab7e2)
├── cordova-plugin-em-settings@1.2.2 (git+ssh://git@github.com/e-mission/cordova-connection-settings.git#df2e225b994cbd0f13d0c21b1e79bf219f8c1a13)
├── cordova-plugin-em-unifiedlogger@1.3.6 (git+ssh://git@github.com/e-mission/cordova-unified-logger.git#49611d64b11e9ff2ec98c0517de227db0c13db69)
├── cordova-plugin-em-usercache@1.1.4 (git+ssh://git@github.com/e-mission/cordova-usercache.git#6b6d85506a9cddb59f2ba84ccd131c39b0839633)
├── cordova-plugin-email-composer@0.10.1 (git+ssh://git@github.com/katzer/cordova-plugin-email-composer.git#5b342254deeda1bf836ae309ae2da069b1d58f98)
├── cordova-plugin-file@8.0.0
├── cordova-plugin-inappbrowser@5.0.0
├── cordova-plugin-ionic-keyboard@2.2.0
├── cordova-plugin-ionic-webview@5.0.0
├── cordova-plugin-local-notification-12@0.1.4-fix-android-action (git+ssh://git@github.com/e-mission/cordova-plugin-local-notification-12.git#86195b9781d1e0ef6dc20770651b919c72ef8ea6)
├── cordova-plugin-x-socialsharing@6.0.4
├── cordova@11.1.0

At a glance (and when cross referenced with the same command, run on MacOS), nothing seems missing or out of place.

Finally, I have found very little information on this issue online. Most of the threads I've found relate to either npx freezing (link link). Multiple threads have suggested running npm cache clear --force , but this has not helped remedy the issue. This thread seems to suggest I'm not the first person to have this issue: since our NPM version is past v5, so I'm not sure how relevant this is.


Given all of the research above, and my current research in issue #1053 , my first thought was that the Linux install must be missing a linux-based dependency that cordova relies on.

I'm not entirely satisfied with this answer for a few reasons; first, it leaves me with few lines of inquiry. Second, the issue in 1053 is an issue with the browser version of the app. That is, I would be somewhat surprised if the android build of the app had dependencies that needed to match the build OS. As of writing, I'm re-reading some of our our internal docs (issues such as #958), in case I missed any past work on this issue.

All of this to say, I'll keep this thread updated as I find more information! If anyone has experience building on a non-MacOS device, feel free to throw in your two cents on this thread -- any advice is greatly appreciated!