-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node: Add yarn2 support #252
base: master
Are you sure you want to change the base?
Conversation
159ca9f
to
ff204fd
Compare
d22a790
to
8aaa053
Compare
Isn't lockfile v2 format just normal YAML? |
I think you've managed to use this PR in https://sourcegraph.com/github.com/flathub/net.cozic.joplin_desktop@5420d1b2d6c0debe599222af99d048f10de2ac1f/-/blob/net.cozic.joplin_desktop.yml?L62. But just wondering how you get |
@proletarius101 |
@catsout I found there might be some errors: https://buildbot.flathub.org/#/builders/10/builds/12201 |
@proletarius101 |
@catsout Could you please push your fix so that I can check, or will you fix it yourself? |
@proletarius101 |
True. But do you know why? I thought I confirm that this PR works for standard notes. |
Hi @gasinvein @catsout any updates? :) |
f0d317a causes the following error: https://buildbot.flathub.org/#/builders/10/builds/13033
afc6911 doesn't |
Seems I forgot |
799eb2a
to
0894c91
Compare
I'm trying to run this on https://github.com/mifi/lossless-cut/blob/37e49d5682a4dada498f3fe7ec3d2d2cf530a7df/yarn.lock but it fails:
|
@muelli |
I'm still experiencing the error. I'm on c278045 now. And I'm calling like this: |
Yes, it works.
|
ah, silly me. I have indeed taken the wrong file. I has generated the sources file. But it doesn't seem to working. I wonder whether the upstream file is broken, though. I'm trying to make it work here: flathub/no.mifi.losslesscut#21
I cannot find acorn-class-fields in the yarn.lock file. I wonder why it thinks it's necessary. |
You need to use |
|
k. works for me. Thanks! So, what is needed to merge this? Would it be helpful to detect whether the setup script was run? It could then fail (or warn on stderr) to indicate the lack of setup. Maybe the setup script can set an environment variable or something and the generated-source can embed a script to check for that. |
@gasinvein do you have any doubt about merging this? It provides the functionality I need for https://github.com/flathub/no.mifi.losslesscut/ and seems to work well. |
I would like to see at least some explanation of the changes proposed here. Massive code dumps like this, especially without comments, are nigh impossible to review. |
Okay so, I will admit, I did not realize this was undrafted until a few weeks ago, and then promptly forgot about it again. Ditto on the above comment, but also...do we really need a 250 LoC yarn plugin? Would very much like to know what it does in the very least...seems to be related to converting something to zip files, triggered by some |
lock file
From: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-core/sources/Resolver.ts
More type detail: https://github.com/yarnpkg/berry/blob/%40yarnpkg/shell/3.2.5/packages/yarnpkg-core/sources/types.ts#L81
So:
cache filefilename:
https://github.com/yarnpkg/berry/blob/%40yarnpkg/shell/3.2.5/packages/yarnpkg-core/sources/Cache.ts#L99 `@${locator.scope}-${locator.name}-${humanProtocol}-${humanVersion}-${locator.locatorHash.slice(0, 10)}-${zip_cache_checksum.slice(0, 10)}`
humanProtocol, humanVersion come from locator.reference cache file is valid only when:
fetcherhttps://github.com/yarnpkg/berry/blob/%40yarnpkg/shell/3.2.5/packages/plugin-npm/sources/NpmSemverFetcher.ts#L49 the js pluginThe py generate the flathub source of tgz file. Then in js plugin, loop the file, extract the locator info to generate the zip cache filename. |
git sourceyarn uses |
patch lockfileThere is a yarn 1.x bug yarnpkg/yarn#685, which cause |
Hi, I've been using this for a bit and have discovered this doesn't work with yarn canary/yarn 4 the plugin used always crashes with this error,
|
zipfs seems to have been moved to |
Note that updating the generated sources is more complicated at the moment until flatpak-node-generator starts supporting Yarn version 2+. I had to use the code in pull request flatpak/flatpak-builder-tools#252 which adds support for Yarn version 2+. The exact commit that I used is: flatpak/flatpak-builder-tools@eb43ec2. A newer update of this pull request also removes the need to execute "$FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn2-setup.sh" before running "yarn install" so I removed that line from the build-commands. Commands that I used to update the generated sources are: wget https://raw.githubusercontent.com/mifi/lossless-cut/refs/tags/v3.64.0/yarn.lock pipx run "flatpak_node_generator @ git+https://github.com/flatpak/flatpak-builder-tools.git@refs/pull/252/head#subdirectory=node" yarn yarn.lock --output generated-sources.json rm yarn.lock
@catsout , I've used the current latest commit in this PR (eb43ec2) to successfully generate However, the Flatpak build process now fails at
The LosslessCut project currently uses Yarn 4.4.0. Do you have any suggestion on which commands to use in |
todo:
need to manually add
$FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn2-setup.sh
tobuild-commands