vixalien / sticky

A simple sticky notes app for GNOME
https://flathub.org/apps/details/com.vixalien.sticky
MIT License
183 stars 28 forks source link

Couldn't find a package.json file #3

Closed yochananmarqos closed 1 year ago

yochananmarqos commented 1 year ago

When building from source, Yarn is not able to find files while in the Meson build directory.

+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=true -D b_pie=true sticky build
The Meson build system
Version: 1.0.1
Source dir: /build/sticky-notes/src/sticky
Build dir: /build/sticky-notes/src/build
Build type: native build
Project name: sticky-notes
Project version: 0.1.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Run-time dependency gjs-1.0 found: YES 1.74.2
Program yarn found: YES (/usr/bin/yarn)
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: YES (/usr/bin/appstream-util)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring com.vixalien.sticky using configuration
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Build-time dependency gio-2.0 found: YES 2.74.6
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Build targets in project: 12
NOTICE: Future-deprecated features used:
 * 0.64.0: {'copy arg in configure_file'}

sticky-notes 0.1.0

  User defined options
    auto_features: enabled
    buildtype    : plain
    libexecdir   : lib
    prefix       : /usr
    sbindir      : bin
    wrap_mode    : nodownload
    b_lto        : true
    b_pie        : true

Found ninja-1.11.1 at /usr/bin/ninja
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /build/sticky-notes/src/build
ninja: Entering directory `/build/sticky-notes/src/build'
[3/7] Generating node-package-manager-deps with a custom command
yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.03s.
[4/7] Generating data/stylus-compile with a custom command
FAILED: data/style.css data/style-selector.css data/style-dark.css 
/usr/bin/yarn --cwd /build/sticky-notes/src/build run css --out /build/sticky-notes/src/build/data --cwd /build/sticky-notes/src/sticky/data ../sticky/data/style.styl ../sticky/data/style-selector.styl ../sticky/data/style-dark.styl
yarn run v1.22.19
error Couldn't find a package.json file in "/build/sticky-notes/src/build"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[5/7] Generating src/typescript-compile with a custom command
FAILED: src/application.js src/card.js src/main.js src/notes.js src/styleselector.js src/view.js src/window.js src/util.js 
/usr/bin/yarn --cwd /build/sticky-notes/src/build run build --out /build/sticky-notes/src/build/src --cwd /build/sticky-notes/src/sticky/src ../sticky/src/application.ts ../sticky/src/card.ts ../sticky/src/main.ts ../sticky/src/notes.ts ../sticky/src/styleselector.ts ../sticky/src/view.ts ../sticky/src/window.ts ../sticky/src/util.ts
yarn run v1.22.19
error Couldn't find a package.json file in "/build/sticky-notes/src/build"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ninja: build stopped: subcommand failed.
yochananmarqos commented 1 year ago

Ah! It was so simple. I knew it had something to do with that line. Thanks!

yochananmarqos commented 1 year ago

Oops, spoke too soon.

[4/7] Generating src/typescript-compile with a custom command
FAILED: src/application.js src/card.js src/main.js src/notes.js src/styleselector.js src/view.js src/window.js src/util.js 
/usr/bin/yarn --cwd /build/sticky-notes/src/sticky run build --out /build/sticky-notes/src/build/src --cwd /build/sticky-notes/src/sticky/src ../sticky/src/application.ts ../sticky/src/card.ts ../sticky/src/main.ts ../sticky/src/notes.ts ../sticky/src/styleselector.ts ../sticky/src/view.ts ../sticky/src/window.ts ../sticky/src/util.ts
yarn run v1.22.19
$ node lib/build.js --out /build/sticky-notes/src/build/src --cwd /build/sticky-notes/src/sticky/src ../sticky/src/application.ts ../sticky/src/card.ts ../sticky/src/main.ts ../sticky/src/notes.ts ../sticky/src/styleselector.ts ../sticky/src/view.ts ../sticky/src/window.ts ../sticky/src/util.ts
✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/util.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/notes.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/application.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/card.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/main.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/window.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/view.ts"

✘ [ERROR] Could not resolve "/build/sticky-notes/src/sticky/sticky/src/styleselector.ts"

/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 8 errors:
error: Could not resolve "/build/sticky-notes/src/sticky/sticky/src/util.ts"
error: Could not resolve "/build/sticky-notes/src/sticky/sticky/src/notes.ts"
error: Could not resolve "/build/sticky-notes/src/sticky/sticky/src/application.ts"
error: Could not resolve "/build/sticky-notes/src/sticky/sticky/src/card.ts"
error: Could not resolve "/build/sticky-notes/src/sticky/sticky/src/main.ts"
...
    at failureErrorWithLog (/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:1636:15)
    at /build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:1048:25
    at /build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:993:52
    at buildResponseToResult (/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:1046:7)
    at /build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:1075:16
    at responseCallbacks.<computed> (/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:697:9)
    at handleIncomingPacket (/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:752:9)
    at Socket.readFromStdout (/build/sticky-notes/src/sticky/node_modules/esbuild/lib/main.js:673:7)
    at Socket.emit (node:events:512:28)
    at addChunk (node:internal/streams/readable:324:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/util.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/notes.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/application.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/card.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/main.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/window.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/view.ts"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "/build/sticky-notes/src/sticky/sticky/src/styleselector.ts"'
    }
  ],
  warnings: []
}

Node.js v19.7.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[5/7] Generating data/stylus-compile with a custom command
FAILED: data/style.css data/style-selector.css data/style-dark.css 
/usr/bin/yarn --cwd /build/sticky-notes/src/sticky run css --out /build/sticky-notes/src/build/data --cwd /build/sticky-notes/src/sticky/data ../sticky/data/style.styl ../sticky/data/style-selector.styl ../sticky/data/style-dark.styl
yarn run v1.22.19
$ node lib/stylus.js --out /build/sticky-notes/src/build/data --cwd /build/sticky-notes/src/sticky/data ../sticky/data/style.styl ../sticky/data/style-selector.styl ../sticky/data/style-dark.styl
node:internal/process/esm_loader:100
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: ENOENT: no such file or directory, open '/build/sticky-notes/src/sticky/sticky/data/style.styl'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/build/sticky-notes/src/sticky/sticky/data/style.styl'
}

Node.js v19.7.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ninja: build stopped: subcommand failed.
vixalien commented 1 year ago

ohh I think it's because stylus and esbuild steps still gets in the old --cwd. if this does not fix it, I'll ask you to experiment with different kinds of meson variables to see what fixes it since I'm not familiar with meson:

or whether it's not source but build...

yochananmarqos commented 1 year ago

Success! :+1:

Off topic query out of curiosity:

You use Yarn and there's a yarn.lock, but you also have a pnpm.lock. Using two package managers makes no sense.

vixalien commented 1 year ago

thank!!

yes I know, I'll remove the files. Actually, older versions of this package allowed to use whatever package manager you want (npm, pnpm, yarn, bun etc...) but it's now hardcoded to yarn since yarn is the only one that (reliably) supports offline mirrors for packages, and that's kinda required for flatpak (I suspect it's also used for caching...)