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

[RFC] abi support #331

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[RFC] abi support #331

wants to merge 2 commits into from

Conversation

ericonr
Copy link
Member

@ericonr ericonr commented Sep 7, 2020

No description provided.

repodata can't contain packages with different ABIs.
@ericonr ericonr changed the title [WIP] abi support [RFC] abi support Sep 8, 2020
@fosslinux
Copy link

Interesting would this work with the musl update, once appropriate changes are added to xbps-install?

@ericonr
Copy link
Member Author

ericonr commented Nov 4, 2020

Interesting would this work with the musl update, once appropriate changes are added to xbps-install?

It's an idea for a possible solution to the musl update.

@motorto
Copy link

motorto commented Jul 17, 2022

@ericonr Would love to help making this happen, what Is missing here ? It looks feature complete this pr ...

@ericonr
Copy link
Member Author

ericonr commented Jul 17, 2022

@motorto we need to implement the xbps-install side where, upon receiving a package with a greater ABI field, we force update the entire system in one go.

@motorto
Copy link

motorto commented Jul 18, 2022

probably not good, but here is my currently work on it I just don't know how can I get the repo abi version.

And I am not sure if its the repo abi version that increases or the package that increases:
if (abi_repo < abi_package) or if(abi_package < abi_repo)

Here is the diff
diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c
index d747c760..aa1f7793 100644
--- a/bin/xbps-install/transaction.c
+++ b/bin/xbps-install/transaction.c
@@ -292,6 +292,8 @@ install_new_pkg(struct xbps_handle *xhp, const char *pkg, bool force)
 		fprintf(stderr, "Package `%s' contains invalid dependencies, exiting.\n", pkg);
 	else if (rv == EBUSY)
 		fprintf(stderr, "The 'xbps' package must be updated, please run `xbps-install -u xbps`\n");
+	else if (rv == 2) // TODO: FIND GOOD VALUE HERE
+		fprintf(stderr, "ABI changed, please run `xbps-install -Su` to do a full system upgrade\n");
 	else if (rv != 0) {
 		fprintf(stderr, "Unexpected error: %s\n", strerror(rv));
 		rv = -1;
diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c
index 5c0deda4..ba7907d4 100644
--- a/lib/transaction_ops.c
+++ b/lib/transaction_ops.c
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2009-2020 Juan Romero Pardines.
  * All rights reserved.
  *
@@ -347,8 +347,10 @@ xbps_transaction_update_packages(struct xbps_handle *xhp)
 int
 xbps_transaction_update_pkg(struct xbps_handle *xhp, const char *pkg, bool force)
 {
+	const char *t_abi = NULL;
+	xbps_dictionary_t pkg_pkgdb = NULL;
 	xbps_array_t rdeps;
-	int rv;
+	int abi_repo, abi_pkg, rv;
 
 	rv = xbps_autoupdate(xhp);
 	xbps_dbg_printf(xhp, "%s: xbps_autoupdate %d\n", __func__, rv);
@@ -366,6 +368,19 @@ xbps_transaction_update_pkg(struct xbps_handle *xhp, const char *pkg, bool force
 		break;
 	}
 
+	/* check abi version */
+	xbps_dictionary_get_cstring_nocopy(xhp->pkgdb,"abi", &t_abi);
+	abi_repo=atoi(t_abi);
+
+	pkg_pkgdb = xbps_pkgdb_get_pkg(xhp, pkg);
+	xbps_dictionary_get_cstring_nocopy(pkg_pkgdb,"abi", &t_abi);
+
+	abi_pkg=atoi(t_abi);
+
+	if (abi_repo < abi_pkg) {
+		return 2;
+	}
+
 	/* update its reverse dependencies */
 	rdeps = xbps_pkgdb_get_pkg_revdeps(xhp, pkg);
 	if (xhp->flags & XBPS_FLAG_DOWNLOAD_ONLY) {

@dataCobra
Copy link

I'm pretty new to this whole stuff, but I want to contribute.

How can I help and what should I read to understand the bigger picture?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants