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

Provide an 'I don't care'-easy installation option #129

Closed
4 tasks
cschwan opened this issue Mar 17, 2022 · 15 comments
Closed
4 tasks

Provide an 'I don't care'-easy installation option #129

cschwan opened this issue Mar 17, 2022 · 15 comments
Labels
enhancement New feature or request

Comments

@cschwan
Copy link
Contributor

cschwan commented Mar 17, 2022

After talking with @alecandido yesterday, we decided it useful to have a third and very easy installation option. This would be a feature for people who don't care about/don't want Rust. We should write a script which

  • checks if cargo is available,
  • if not downloads rustup and installs a minimal version of Rust,
  • installs the latest released version of pineappl and finally
  • gets rid of Rust again.

This works because everything is statically linked. Maybe we'd also like to a have a similar installer for the Rust C API (could be automatically used inside Madgraph5_aMC@NLO).

@cschwan cschwan added the enhancement New feature or request label Mar 17, 2022
@Zaharid
Copy link

Zaharid commented Mar 25, 2022

Uh, make a conda package instead!

@alecandido
Copy link
Member

Already available:
https://anaconda.org/conda-forge/pineappl

But a binary installation is more general than conda, not everyone would like to install conda on its system, nor to rely on conda's environment.

@alecandido
Copy link
Member

At the moment runcardsrunner installs PineAPPL on its own, cloning the repository and compiling it (it needs the C API for MadGraph).

Since GitHub changed cloning policy, it is no longer possible to use unauthenticated https:// protocol to do it.
In e5d1ce27 I fixed with the git:// protocol, but even that is not going to work unauthenticated, as @Radonirinaunimi noticed.

Then, I'd like to deliver soon the extra installation script (leveraging rustup it shouldn't take much), and to base rr on some released version of PineAPPL instead of master. Thus I would make a version argument, to be passed to cargo install (default latest, i.e. the Cargo default).
Installation of master should be a manual installation, that is always a good thing, since it is the development version.

@cschwan
Copy link
Contributor Author

cschwan commented Jun 14, 2022

@alecandido are you sure that https isn't working anymore/will not work at some point in the future? I checked that (unauthenticated) cloning is still possible and the site you mentioned explicitly states that nothing will change for https. I think the real problem might be that pygit2 tries to use authentication.

@alecandido
Copy link
Member

alecandido commented Jun 14, 2022

One of the two blog posts I mentioned was SSH specific, so it was saying nothing will change for https, but the other one was.

Actually, I don't remember exactly why, but the change in the URL was consequential to a bug report (not even sure I found myself, it was in February and yadism was already settled, so I should look in Issues + Mails + Telegram to hunt for it).

Maybe there is a way to make it work, but I'm really inclined towards removing git operations as much as possible, and use instead released version on crates.io (it should be the official way for users).

@cschwan
Copy link
Contributor Author

cschwan commented Jun 14, 2022

@alecandido I agree. The only tricky installation is the C API, for which we can use the release tarballs, for instance https://github.com/N3PDF/pineappl/archive/refs/tags/v0.5.2.tar.gz.

@cschwan
Copy link
Contributor Author

cschwan commented Jun 14, 2022

BTW: if one really wants to use git, you can using cargo install --git ....

@alecandido
Copy link
Member

@alecandido I agree. The only tricky installation is the C API, for which we can use the release tarballs, for instance https://github.com/N3PDF/pineappl/archive/refs/tags/v0.5.2.tar.gz.

That's fine as well, but can't cargo cinstall make use of the pineappl_capi crate?
Something like:

cargo cinstall pineappl_capi

@cschwan
Copy link
Contributor Author

cschwan commented Jun 14, 2022

That doesn't work unfortunately.

@cschwan
Copy link
Contributor Author

cschwan commented Sep 16, 2022

We might have discovered an easier option: #176. And here's yet another option: https://rust-cli.github.io/book/tutorial/packaging.html#distributing-binaries.

@alecandido
Copy link
Member

Second part of the note referred in #183, but it is relevant here:

Installation script

While for Windows I don't care the less (people that uses Windows might want to
use the respective binary manually, and otherwise use cargo install), for
Linux (and MacOS if working the same way) we might host on the website (i.e.
https://n3pdf.github.io/pineappl) an install script (e.g.
https://n3pdf.github.io/pineappl/install.sh) in order to use it with just
curl, like:

curl -fsSL https://n3pdf.github.io/pineappl/install.sh | sh

(in principle it should be possible to do the same for Windows with a
install.ps1 script, but I don't care).
It might be very simple, something like:

curl https://github.com/N3PDF/pineappl/archive/refs/tags/pineappl-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz --output pineappl.tar.gz
tar -xvzf pineappl.tar.gz
rm -f pineappl.tar.gz
install pineappl $PREFIX/bin
rm -f pineappl

@cschwan
Copy link
Contributor Author

cschwan commented Feb 8, 2023

This could help making releases easier: https://github.com/axodotdev/cargo-dist#way-too-quick-start.

@alecandido
Copy link
Member

Great!

I forgot to mention before, but another relevant cargo command (that I like for my personal use) is https://github.com/cargo-bins/cargo-binstall.
However, this is really going to be lower priority, since it is just a matter of automate binary updates (so first we need to have binary installation in the first place), and of course it's dependent on cargo (so it doesn't help with non-Rust users, while Rust users can already compile the crate on their own).

@cschwan
Copy link
Contributor Author

cschwan commented Sep 7, 2023

We've got pre-built binaries for the CAPI now, and we can do the same for the CLI, for which we'll need our LHAPDF replacement first, however.

@cschwan
Copy link
Contributor Author

cschwan commented Jul 1, 2024

I think we can close this, we now have two methods of installing pre-built binaries.

@cschwan cschwan closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants