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

Don't ignore failed pre-install/post-install scripts/lua files in pkg-register(8) (#2073) #2111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michael-o
Copy link
Contributor

When a package is registered through pkg-register(8) the return codes of pre-install and post-install scripts and lua files are ignored. Now they are respected as with pkg-add(8).

This fixes #2073

Copy link

@igalic igalic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the title of the pull request / commit message should be what is changed, not what is wrong.

it's a commit/pull request, not an issue report

@michael-o
Copy link
Contributor Author

the title of the pull request / commit message should be what is changed, not what is wrong.

it's a commit/pull request, not an issue report

I agree, will change

@michael-o michael-o changed the title pkg-register ignores failed pre-install/post-install scripts (#2073) Don't ignore failed pre-install/post-install scripts/lua files in pkg-register(8) (#2073) Mar 1, 2023
@bapt
Copy link
Member

bapt commented Mar 1, 2023

this is not failing on purpose for now, there are many things in the port tree that should be fixed before we do get to a point, that we stop ignore script failures.

@michael-o
Copy link
Contributor Author

this is not failing on purpose for now, there are many things in the port tree that should be fixed before we do get to a point, that we stop ignore script failures.

Interesting..can your shortly elaborate?

Maybe those spots require comments in code depicting that this is on purpose?

@bapt
Copy link
Member

bapt commented Mar 1, 2023

I need to find time, to write down all of it yes, I will to make that happen in the next couple of weeks.

@michael-o
Copy link
Contributor Author

I need to find time, to write down all of it yes, I will to make that happen in the next couple of weeks.

Merci!

…-register(8) (freebsd#2073)

When a package is registered through pkg-register(8) the return codes of
pre-install and post-install scripts and lua files  are ignored. Now they are
respected as with pkg-add(8).

This fixes freebsd#2073
@michael-o
Copy link
Contributor Author

I need to find time, to write down all of it yes, I will to make that happen in the next couple of weeks.

Did you find the time to work on this/document it?

@bapt
Copy link
Member

bapt commented Apr 19, 2023

after checking the current status of the ports tree, most of the issues are gone. so it might be safe now to die on script failure.
One important left issue is the fact that some package are doing some sanity checking in pre/post scripts, this should be moved to a pre transaction sanity script. As soon as we have such feature we can merge this PR and actually fail in scripts.

@michael-o michael-o requested a review from igalic April 19, 2023 07:52
@michael-o
Copy link
Contributor Author

after checking the current status of the ports tree, most of the issues are gone. so it might be safe now to die on script failure. One important left issue is the fact that some package are doing some sanity checking in pre/post scripts, this should be moved to a pre transaction sanity script. As soon as we have such feature we can merge this PR and actually fail in scripts.

But wouldn't the outcome be the same? Failure is failure, though just better separated?

@bapt
Copy link
Member

bapt commented Apr 19, 2023

the outcone would be slightly different, if you die in a middle of a transaction do end up into an unstable state: half upgraded, some things might get broken more deeply than just the package that failed to installed) for example a library has been bumped all the dependent package are not update yet, but the pre install of one of them (and worst case scénario the first in the transaction) dies, ten the whole transaction is aborted, rolling back the entire transaction is impossible, the user ends up with a broken system.

With pre transaction checking, then we die early enough, an example of such scripts are in the linux packages.

@michael-o
Copy link
Contributor Author

This explanation makes absolutely sense!

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.

pkg-register ignores failed pre-install/post-install scripts
3 participants