yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

official debian packages #1305

Closed marado closed 5 years ago

marado commented 8 years ago

Do you want to request a feature or report a bug? Feature

What is the current behavior? No package on official Debian repositories.

What is the expected behavior? Package on official Debian repositories.

Description

At #275 debian packages were created, and there are yarn-maintained repositories to allow users to install yarn via apt. However, it would be better still if people could install yarn directly from debian repositories.

For that to happen, an ITP should be created. I believe this will end up happening anyway, but it would be advantageous if the debian package was actually maintained by someone from upstream (I mean, whomever is currently maintaining the yarn debian repository).

This issue is not being submitted simply as a "feature request", but also to know if this is something yarn people are willing to do in the future, or if someone else should work on it.

Daniel15 commented 8 years ago

Hi @marado!

whomever is currently maintaining the yarn debian repository)

That's me! 😄

Getting it into Debian would require some more work. The current Debian package is "good enough" for people to use and works well, but I don't think it's quite ready for inclusion in Debian as they have pretty strict quality requirements for packages. For one, the current package bundles all dependencies into the package itself. Debian requires dependencies to be in their own separate packages (for example, see the npm package in Ubuntu). Additionally, we currently don't have manpages/docs or a proper changelog for Yarn.

It's not something we'll do in the short term, but maybe in the long term!

Thanks for your interest.

simevo commented 8 years ago

Here is the RFP https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843021

simevo commented 7 years ago

We're making progress on this one !

The introduction with this commit of the new dependency on the inquirer module makes the matter harder because we need to package that first...

Next there's waiting for gulp to get into debian and finally implement the actual build in the curiously named makefile debian/rules.

For detailed a status update see https://bugs.debian.org/843021.

Daniel15 commented 7 years ago

@simevo - Why node-yarnpkg rather than just yarnpkg? npm's package is just npm rather than node-npm, right?

simevo commented 7 years ago

The normal JS maintainers team best practice is that "binary and the source package should be called node-foo". But since node-yarnpkg also installs a binary in /usr/bin called yarnpkg, as I have currently set it up (see the control file), the binary in this case is called just yarnpkg. So users will happily install it with:

apt install yarnpkg
Daniel15 commented 7 years ago

Oh cool, thanks for the info! 😃

simevo commented 7 years ago

Status update: we've all dependencies and main build dependencies (gulp-if and gulp-watch we avoided)in the archive with the exception of babel and gulp-babel. ATM just for testing I'm patching the gulpfile to skip the babel step: https://anonscm.debian.org/git/pkg-javascript/node-yarnpkg.git/tree/debian/patches/07-gulp-babel.diff The resulting package passes the lintian tests and can be installed but on launching the CLI of course the nodejs interpreter version 4.6.1 cannot cope with the javascript which has not been processed with babel:

# yarnpkg 
/usr/lib/nodejs/yarn/lib-legacy/constants.js:5
let userHome = os.homedir();
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/lib/nodejs/yarn/bin/yarn.js:29:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

We face the risk of missing the stretch freeze. I wonder if there is any other transpiler or I-dont-kno-what-trick to make it run in node 4.6.1 ?

Daniel15 commented 7 years ago

I wonder if there is any other transpiler or I-dont-kno-what-trick to make it run in node 4.6.1 ?

@simevo - Unfortunately there's no other trick to make it run in Node.js 4.6.1, the code must be transpiled. I think Babel is only a build-time dependency and not a runtime dependency, so it just has to be available at build time. Does that help at all? Could the build script install Babel via npm?

It looks like Node.js 6.9.2 is available in Debian experimental and it supports much more ES6 syntax. Do you know if it will be migrated to unstable/testing?

simevo commented 7 years ago

Alright we just missed the stretch freeze window so let's relax !

The good news is that since all dependencies required to run are in the archive (but for the versions of diff, ini, mkdirp and request which are bit behind), if anybody wants to provide a .deb for yarnpkg as it is now (0.18.1) they don't need to ship a node_modules dir with the dependencies inside. Until the yarn developers add some new dependency...

@Daniel15 as you know the Debian project is quite strict in requiring consistency of the build environment (that's for reproducible builds, for long term support and for free software guidelines compliance) but you're right we could still build with npm and target the contrib archive. I'm not too interested in that personally; my new goal is to finish the build deps and target the next Debian release (testing i..e buster). I hope nodejs 6.9.x we'll soon land from experimental so that should make it easier.

Creating a version for stretch-backports is also a possibility.

simevo commented 6 years ago

After a long pause (mostly we have been busy packaging build tools such as webpack...) here I am back with a status update.

The repo moved to the debian-hosted gitlab instance "salsa": https://salsa.debian.org/js-team/node-yarnpkg

In the wiki home page of the repo I keep track of the packaging progress: https://salsa.debian.org/js-team/node-yarnpkg/wikis/home there's 6 new packages and 8 updated packages to go.

While we wait for those, there is also debian-contrib branch where we cheat on dependencies and run npm install in debian/rules, you can try it out like this:

git checkout debian-contrib 
gbp buildpackage -uc -us --git-debian-branch=debian-contrib 

The resulting yarnpkg_1.6.0-1_all.deb installs, and yarnpkg can be run, for example:

mkdir q
cd q
yarnpkg init
yarnpkg add ci-info

yields:

yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ ci-info@1.1.3
info All dependencies
└─ ci-info@1.1.3
Done in 1.01s.
Daniel15 commented 6 years ago

Glad to hear that it's going well! 😃

simevo commented 5 years ago

Hi, FYI the official Debian package for yarnpkg is almost ready, see: https://alioth-lists.debian.net/pipermail/pkg-javascript-devel/2019-January/030431.html

Once it's been tested and reviewed, I'd like to try to contribute upstream two of the patches I created, in particular:

Daniel15 commented 5 years ago

Once it's been tested and reviewed, I'd like to try to contribute upstream two of the patches I created

This sounds fine to me! Feel free to send pull requests on Github with your changes.

Daniel15 commented 5 years ago

This landed in Buster, so I think we can close this out now.

reeaosirjustsir commented 5 months ago

Hello there! reeao here!

You have to go this termux github issue link!: https://github.com/termux/proot-distro/issues/416