Skip to content
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

Add pnpm installation methods using standard OS package managers #3633

Open
7 of 8 tasks
zkochan opened this issue Jul 31, 2021 · 44 comments
Open
7 of 8 tasks

Add pnpm installation methods using standard OS package managers #3633

zkochan opened this issue Jul 31, 2021 · 44 comments

Comments

@zkochan
Copy link
Member

zkochan commented Jul 31, 2021

Related: #3624

For inspiration:

@zkochan zkochan pinned this issue Jul 31, 2021
@KSXGitHub
Copy link
Contributor

For Arch Linux, an AUR already exists, so you can safely remove the "pacman" entry.

@zkochan
Copy link
Member Author

zkochan commented Aug 1, 2021 via email

@KSXGitHub
Copy link
Contributor

If you still find the pacman version necessary then go for it. What I was trying to say is if you don't want to maintain too many targets then feel free to remove "pacman" from the list (I don't think it's going to be a huge impact, because Arch Linux users prefer their system to be lightweight, i.e. use nodejs as a shared dependency instead of duplicating it).

@KSXGitHub
Copy link
Contributor

KSXGitHub commented Aug 1, 2021

Actually, isn't it better to just create an AUR (called pnpm-standalone or pnpm-bundled or whatever) that downloads and installs pnpm executables? I also have a github action that publishes PKGBUILD and .SRCINFO to the AUR (you have to generate the PKGBUILD yourself, the action would then generate .SRCINFO from provided PKGBUILD).

@zkochan
Copy link
Member Author

zkochan commented Aug 1, 2021

I want the executable version to be the default one starting from pnpm v7. If someone would love the plain js version, we may ship that separately.

@suptejas
Copy link

suptejas commented Aug 5, 2021

@zkochan silent installation of NodeJS is quite simple, I could help with Windows (I've built electric) so feel free to let me know what info you would need

@zkochan
Copy link
Member Author

zkochan commented Aug 5, 2021

I was trying to build the deb/rpm packages automatically with GitHub actions but no luck for now.

First I tried to do it using these tools: pkg-deb and pkg-rpm

However, the artifact generated by pkg-deb via GitHub action doesn't work when I try to use it on Ubuntu. When I built the artifact locally, it worked.

Now I am looking into nFPM. It is not as convenient as the above tools (which reuse info from package.json) but it can build both deb and rpm with no additional dependencies installed. The deb artifact built with it seems to work.

@zkochan
Copy link
Member Author

zkochan commented Aug 5, 2021

silent installation of NodeJS is quite simple

There is no need to install Node.js. pnpm is built into an executable together with Node.js. So just pnpm needs to be installed, and it will work even if there is no Node.js installed on the target system.

@zkochan
Copy link
Member Author

zkochan commented Aug 5, 2021

I think for now it will be easier to use a standalone shell script to install pnpm (I already worked on it here).

And in the future we may add support for different system package managers, if needed.

umireon added a commit to umireon/homebrew-core that referenced this issue Aug 8, 2021
pnpm author wants to use binary edition of pnpm for package managers
pnpm/pnpm#3633
@umireon
Copy link
Member

umireon commented Aug 8, 2021

@zkochan I'm working on the pnpm Homebrew formula. Please help me.
Homebrew/homebrew-core#82892

@zkochan
Copy link
Member Author

zkochan commented Aug 9, 2021

I can look into the PR later.

If you have some specific questions, feel free to ask here or in the chatroom.

Regarding shipping pnpm binaries as independent executables, the plan is to ship them by default from pnpm v7. If you want to use the binaries for brew, they are uploaded already to the release page: https://github.com/pnpm/pnpm/releases/tag/v6.12.1

I think I can add binaries for arm architecture as well.

@umireon
Copy link
Member

umireon commented Aug 9, 2021

@zkochan Thanks for your kind responce!
What I need now is the linuxstatic binary for Linuxbrew and the arm64 binary for M1 Mac.

Regarding shipping pnpm binaries as independent executables, the plan is to ship them by default from pnpm v7. If you want to use the binaries for brew, they are uploaded already to the release page: https://github.com/pnpm/pnpm/releases/tag/v6.12.1

Homebrew will never allow the prebuilt binaries for OSS. The binaries must be built from the Homebrew's definitions (formulae) and from their sources.
(For example, the node's formula)

@hronro
Copy link

hronro commented Aug 15, 2021

Is MacPorts going to be supported as well?

@zkochan
Copy link
Member Author

zkochan commented Aug 17, 2021

Is MacPorts going to be supported as well?

We will accept contributions that add support for any package managers and/or systems.

But for now I want to concentrate on creating a cross-platform shell script for installing pnpm on any system. As I mentioned above, I already have one in progress: https://github.com/pnpm/get/blob/main/beta-install.sh

However, we started to use the XDG desktop standard, so finding the right location is a bit hard. I think I will use the following steps to install pnpm using the standalone script:

  1. Download the latest tarball of pnpm
  2. Unpack it
  3. Run pnpm setup. pnpm setup will:
    1. Find the correct location for the pnpm home directory
    2. Add the pnpm home directory to the PATH (by modifying shell bootstrap scripts)
    3. Move (or copy and remove) the pnpm binary to the home directory

@umireon
Copy link
Member

umireon commented Aug 17, 2021

@zkochan Will the preferred global bin be changed from writable /usr/local/bin by respecting XDG standard?
This is essential for Homebrew.

@umireon
Copy link
Member

umireon commented Aug 17, 2021

But for now I want to concentrate on creating a cross-platform shell script for installing pnpm on any system. As I mentioned above, I already have one in progress: https://github.com/pnpm/get/blob/main/beta-install.sh

Shellcheck will help you very much. pnpm/get.pnpm.io#3

@zkochan
Copy link
Member Author

zkochan commented Aug 17, 2021

The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?

@umireon
Copy link
Member

umireon commented Aug 18, 2021

@zkochan

The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?

I suggest ~/Library/Application Support/pnpm.

@noahehall
Copy link

noahehall commented Oct 15, 2021

Im patiently waiting for this to be complete! (fingers crossed) as I would prefer to get the pnpm cli fully compatible with alpine and able to use pnpm env to install nodejs on alpine linux.

I am currenlty resorting to nodejs-current apack in my repo :(

@zkochan
Copy link
Member Author

zkochan commented Oct 15, 2021

We already ship all the necessary assets. I don't have experience with any of these system package managers but it shouldn't be hard to add support for them as the assets are present

@noahehall
Copy link

@zkochan i've resorted to installing the pnpm cli separately from the nodejs binary (using the one available in alpine contributing repo)

but i do plan on addressing this later as i use pnpm env to manage my entire node setup when on baremetal and its fkn awesome

@umireon
Copy link
Member

umireon commented Oct 20, 2021

@zkochan I think we should have our own repository dedicated to the latest pnpm binary.
All the OS standard repositories of package managers cannot catch up with the development speed of pnpm (except Homebrew afaik).
Do you know what apt install nodejs in the latest Debian distribution installs?

_人人人人人_
> 12.22.5 <
 ̄Y^Y^Y^Y^Y^ ̄

This is why Docker and Yarn have their own repository.
At least with my experiences of Debian packages, pnpm needs its own repository in Debian and Ubuntu.

Building the repository would be hard but once it establishes users can use it easily because there is plenty of third-party repositories and tools to register such repositories.

@zkochan
Copy link
Member Author

zkochan commented Oct 20, 2021

I don't have objections

@umireon
Copy link
Member

umireon commented Oct 20, 2021

I will investigate how we can have our own repository in Debian and Ubuntu. We would need some hosting.
Of course, I will make my best effort in the brew as you know 😉

@zkochan
Copy link
Member Author

zkochan commented Oct 20, 2021

we have a hosting on netlify

@umireon
Copy link
Member

umireon commented Oct 20, 2021

How much bandwidth do we have?

@zkochan
Copy link
Member Author

zkochan commented Oct 20, 2021

image

we also have cloudflare, so I am not sure why so much bandwidth is consumed.

@umireon
Copy link
Member

umireon commented Oct 20, 2021

400 GB / mo might not be enough for production but we can try.
I think aptly is what we need for Debian and Ubuntu.
It can publish to AWS S3.

@umireon
Copy link
Member

umireon commented Oct 20, 2021

Can we have S3-compatible cloud storage or AWS S3 as a backend of Netlify or CloudFlare?
We need to find a corresponding tool to aptly in the dnf/yum world if that is true.
https://www.aptly.info/doc/feature/s3/

@zkochan
Copy link
Member Author

zkochan commented Oct 20, 2021

can't we just commit to a git repo?

@umireon
Copy link
Member

umireon commented Oct 20, 2021

That cannot (I know this is technically possible but would go very messy) be automated and the size of the git repo grows rapidly.
Ideally, the repository would have a new deb package on each release, and this requires automation.
If that the binary version from the standard package manager is old and not the latest is acceptable, I think a git repo is a good solution.

@zkochan
Copy link
Member Author

zkochan commented Oct 20, 2021

Well, we should use a free solution if possible. S3 is not free and I would be afraid to use my card.

@BasixKOR
Copy link

Many big distros provide a way to host a custom repository. Ubuntu has PPAs, Fedora has Copr, etc. I'm guessing we could benefit from them.

@bompus
Copy link

bompus commented Oct 26, 2021

From searching around, you may be able to use GitHub Pages for this, for free. I found a guide that might help. The same concept likely applies for Cloudflare Pages, Netlify, etc.

@frank-dspeed
Copy link

@zkochan your wrong here you can make it easy if you like https://snapcraft.io/ and https://appimage.org/

@JJRcop
Copy link

JJRcop commented Mar 28, 2022

If you host in a GitHub repo, you could amend the first commit every time, so the repo size stays completely under control, and will only ever have 1 commit.

@millette
Copy link

Might be worth to investigate https://build.opensuse.org/ which lets you build for many linux distributions.

@frank-dspeed

This comment was marked as off-topic.

@JJRcop

This comment was marked as off-topic.

@frank-dspeed

This comment was marked as off-topic.

@zkochan

This comment was marked as off-topic.

@frank-dspeed

This comment was marked as off-topic.

@kecrily
Copy link

kecrily commented May 25, 2022

Packaging status

It looks like scoop and choco are already supported.

@meadowsys
Copy link

The XDG standard is for Linux. What should be the preferred home direrory location for pnpm on macOS?

Would like to mention (a bit late) that I believe there are programs that follow the XDG standard on macos too

@zkochan zkochan unpinned this issue Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests