Git Product home page Git Product logo

Comments (11)

refi64 avatar refi64 commented on August 15, 2024 3

Status update: did not forget about this, it just got a lot hairier than I initially thought. This is due to the new @electron/get module, which is likely going to be used elsewhere in the future too, and which doesn't seem to have any proper caching support which is...fun.

from flatpak-builder-tools.

refi64 avatar refi64 commented on August 15, 2024 1

from flatpak-builder-tools.

gasinvein avatar gasinvein commented on August 15, 2024 1

@x80486 Huh, electron-chromedriver is not chromedriver itself but a node.js module for (downloading?) it.

from flatpak-builder-tools.

Arxcis avatar Arxcis commented on August 15, 2024

this is going to be fun to work around.

I really have no idea how to proceed from here. What can be done to mitigate this issue?

from flatpak-builder-tools.

refi64 avatar refi64 commented on August 15, 2024

You could try running yarn with --ignore-scripts to create node_modules without running the scripts, then swap out download-chromedriver.js with a stub that e.g. copies it from an already downloaded file elsewhere, then run yarn again.

from flatpak-builder-tools.

Arxcis avatar Arxcis commented on August 15, 2024

I found a solution here electron/chromedriver#28
He basically patches the electron-chromedriver-package, to add a cache option:

diff --git a/download-chromedriver.js b/download-chromedriver.js
index 4614a66..0ed8eae 100644
--- a/download-chromedriver.js
+++ b/download-chromedriver.js
@@ -6,6 +6,7 @@ var extractZip = require('extract-zip')
 var versionSegments = require('./package').version.split('.')

 electronDownload({
+  cache: '/run/build/sideka-app/chromedriver-cache',
   version: versionSegments[0] + '.' + versionSegments[1] + '.0',
   chromedriver: true,
   platform: process.env.npm_config_platform,

He than patches the electron-chromedriver from the generated-sources.json like this.

	"generated-sources.json",
	{
		"type": "patch",
		"path": "electron-chromedriver.patch",
		"dest": "electron-chromedriver-1.7.1"
	},

https://github.com/flathub/id.sideka.App/blob/master/id.sideka.App.json#L100-L103

My electron-chromedriver-package is version 3.0.0. Other than that it seems quite similar.

function download (version, callback) {
  electronDownload({
    version,
    chromedriver: true,    
    platform: process.env.npm_config_platform,
// ...

I have no idea on how to create a patch like that though. I will ask him.

from flatpak-builder-tools.

Arxcis avatar Arxcis commented on August 15, 2024

You could try running yarn with --ignore-scripts to create node_modules without running the scripts, then swap out download-chromedriver.js with a stub that e.g. copies it from an already downloaded file elsewhere, then run yarn again.

This is a great second option If I cannot figure out how to do it with a .patch-file. Thanks @refi64 👍 But wouldn't I miss a lot of other scripts then?

from flatpak-builder-tools.

x80486 avatar x80486 commented on August 15, 2024

Exactly the same issue with a different application:

Running: yarn --cwd /run/build/standardnotes/main/ --offline
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "eslint-config-standard@^13.0.1".
[4/4] Building fresh packages...
[5/6] ⠠ electron
[-/6] ⠠ waiting...
[3/6] ⠠ electron-chromedriver
[-/6] ⠠ waiting...
error /run/build/standardnotes/main/node_modules/electron-chromedriver: Command failed.
Exit code: 1
Command: node ./download-chromedriver.js
Arguments: 
Directory: /run/build/standardnotes/main/node_modules/electron-chromedriver
Output:
/run/build/standardnotes/main/node_modules/electron-chromedriver/download-chromedriver.js:19
  if (err != null) throw err
                   ^

Error: getaddrinfo EAI_AGAIN github.com
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26) {
  errno: 'EAI_AGAIN',
  code: 'EAI_AGAIN',


Error: module standardnotes: Child process exited with code 1

from flatpak-builder-tools.

gasinvein avatar gasinvein commented on August 15, 2024

@x80486 Is chromedriver present in generated-sources.json at all?

from flatpak-builder-tools.

x80486 avatar x80486 commented on August 15, 2024

Yes, @gasinvein, I can see it. Here is the repository: https://github.com/x80486/flathub/tree/org.standardnotes.standardnotes/ ...specifically: https://github.com/x80486/flathub/blob/org.standardnotes.standardnotes/generated-sources.json#L2340

from flatpak-builder-tools.

x80486 avatar x80486 commented on August 15, 2024

I think you might be on the right track, because if I provide chromedriver-v8.0.0-linux-x64.zip manually in the manifest I don't get that error 🙄 ...but that's super-inconvenient.

from flatpak-builder-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.