packages icon indicating copy to clipboard operation
packages copied to clipboard

Update RPC debian package to install stellar-core

Open mollykarcher opened this issue 2 years ago • 5 comments

What problem does your feature solve?

When installing the debian package for RPC, we want it to just work out-of-the-box. The installation process should be seamless.

What would you like to see?

The package we created for RPC does not install stellar-core as well, which is necessary for it to function as expected. We can likely model the installation off of how horizon packages currently do this.

What alternatives are there?

Installer/customer needs to install and configure RPC and core independently

mollykarcher avatar Mar 23 '23 17:03 mollykarcher

This is quite easy to do by adding "Depends" field to the control file in a way similar to this. I believe that currently soroban-rpc needs specific build of core is that right? If that's the case adding stellar-core as dependency might result in unsupported core build being installed.

The question is - should we make this change now (and risk broken installs) or should we wait and document how to install supported core (less convenient). @mollykarcher which way do you think is more appropriate?

jacekn avatar Mar 24 '23 09:03 jacekn

We could specify the exact stellar-core version in the depends, e.g.:

Depends: stellar-core (= 19.8.1-1250.064a2787a.focal~soroban)

But, in this repo set it as:

Depends: stellar-core (= _CORE_VERSION_)

Then in the build pipeline take that as a param and sed it in, like we do the _VERSION_ field.

Would you expect that to work, @jacekn ?

For some reason when I'm trying it apt says:

root@cc3eaa4a53f9:/stuff# apt install ./stellar-soroban-rpc_0.7.2-1_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'stellar-soroban-rpc' instead of './stellar-soroban-rpc_0.7.2-1_amd64.deb'
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 stellar-soroban-rpc : Depends: stellar-core (= 19.8.1-1250.064a2787a.focal~soroban) but 19.9.1-1255.d21f6a9a1.focal is to be installed
E: Unable to correct problems, you have held broken packages.

But if I apt install stellar-core=19.8.1-1250.064a2787a.focal~soroban, then it installs and runs fine... Not ideal, and that is the behaviour on a clean docker image of ubuntu:focal. :/

paulbellamy avatar Apr 10 '23 17:04 paulbellamy

@paulbellamy

Would you expect that to work, @jacekn ?

Yeah that should do it, we can edit the file on the fly in the build pipeline

But if I apt install stellar-core=19.8.1-1250.064a2787a.focal~soroban, then it installs and runs fine... Not ideal, and that is the behaviour on a clean docker image of ubuntu:focal. :/

I think this happens because apt finds newer stellar-soroban-rpc package in the repos and installs that one instead. You could confirm what's available in the repos using apt-cache policy stellar-soroban-rpc. There may be a way to force version from the CLI but the quickest workaround I can think of is to use dpkg --install ./stellar-soroban-rpc_0.7.2-1_amd64.deb to install the deb.

jacekn avatar Apr 12 '23 08:04 jacekn

Yeah, I suspect the issue is that, there is a stellar-core 19.9.1, so it sees that as newer. But even if not, apt treats tilde-suffix versions ~suffix, as being "older" than a non-suffixed version. So even without the 19.9.1 version, it would still want to install 19.8.1-1250.064a2787a.focal (without the ~soroban suffix). dpkg --install ./stellar-soroban-rpc_0.7.2-1_amd64.deb, seems to just complain that stellar-core is not installed, then abort, but doesn't actually offer any solutions.

🤔

Edit: It seems like the only way to get apt to install the needed version is to manually pin it, which is not ideal.

paulbellamy avatar Apr 12 '23 11:04 paulbellamy

Yeah, we can make stellar-soroban-rpc depend on a specific version of stellar-core, but if there is a newer version of core available, then the package install will fail.

This is really confusing, because then I'm really not sure what is the point of the equals in: Depends: stellar-core (= 19.8.1-1250.064a2787a.focal) It seems totally useless in practice.

This mailing list post seems to indicate that the solution to this is some carefully managed combination of the relationship params as documented here

Given all those, I don't think this is worth the effort before soroban is released and stellar-core stabilizes. At that point we can do the dependency the same way horizon does, which is a bit looser.

paulbellamy avatar Apr 13 '23 16:04 paulbellamy