Skip to content

Add hy_goal_favor and hy_goal_disfavor#937

Closed
jlebon wants to merge 2 commits intorpm-software-management:dnf-4-masterfrom
jlebon:pr/favor
Closed

Add hy_goal_favor and hy_goal_disfavor#937
jlebon wants to merge 2 commits intorpm-software-management:dnf-4-masterfrom
jlebon:pr/favor

Conversation

@jlebon
Copy link
Copy Markdown
Contributor

@jlebon jlebon commented Apr 14, 2020

Minimal wrappers around SOLVER_FAVOR and SOLVER_DISFAVOR. We'd like
to make use of these in rpm-ostree.

@jlebon
Copy link
Copy Markdown
Contributor Author

jlebon commented Apr 20, 2020

Any thoughts on this?

@j-mracek
Copy link
Copy Markdown
Contributor

@jlebon Please could you provide information for what purpose (user-case) you want to use solver_favor?

@j-mracek
Copy link
Copy Markdown
Contributor

@jlebon Based also on user-case we would like to have some test, to guarantee that it does what is expected.

@j-mracek j-mracek self-assigned this Apr 22, 2020
@Conan-Kudo
Copy link
Copy Markdown
Member

SOLVER_FAVOR (and its opposing counterpart SOLVER_DISFAVOR) were added by @mlschroe to libsolv to implement the capability to support urpmi's prefer.vendor.list feature in DNF and other package managers. The idea is that you could maintain an externalized list of preferences that the solver would account for that could be dynamically managed without requiring building an empty package with a pile of Suggests to influence the transaction.

jlebon added 2 commits April 22, 2020 11:28
Minimal wrappers around `SOLVER_FAVOR` and `SOLVER_DISFAVOR`. We'd like
to make use of these in rpm-ostree.
This is the same thing we already have for e.g. `DnfReldepList`. These
helpers are really useful to keep C client code clean and make it harder
to leak resources.
@jlebon jlebon changed the title Add hy_goal_favor Add hy_goal_favor and hy_goal_disfavor Apr 22, 2020
@jlebon
Copy link
Copy Markdown
Contributor Author

jlebon commented Apr 22, 2020

OK, now added tests for this and added hy_goal_disfavor for completeness!

@jlebon Please could you provide information for what purpose (user-case) you want to use solver_favor?

Yes, this will allow us to have more influence over libsolv's decisions. Without this, it's impossible to make libsolv "prefer" a package but still letting it not be part of a possible solution. For more details on the rpm-ostree use case, see coreos/rpm-ostree#2059. The goal there is for "locked" packages to be given preference when updating the lockfile, but still allow solutions which require picking packages outside the lockfile.

@j-mracek
Copy link
Copy Markdown
Contributor

LGTM!

@j-mracek
Copy link
Copy Markdown
Contributor

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Copy Markdown

📌 Commit 83b1d62 has been approved by j-mracek

@rh-atomic-bot
Copy link
Copy Markdown

⌛ Testing commit 83b1d62 with merge 702b9db...

rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
Minimal wrappers around `SOLVER_FAVOR` and `SOLVER_DISFAVOR`. We'd like
to make use of these in rpm-ostree.

Closes: #937
Approved by: j-mracek
rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
This is the same thing we already have for e.g. `DnfReldepList`. These
helpers are really useful to keep C client code clean and make it harder
to leak resources.

Closes: #937
Approved by: j-mracek
@rh-atomic-bot
Copy link
Copy Markdown

💔 Test failed - status-papr

@jlebon
Copy link
Copy Markdown
Contributor Author

jlebon commented Apr 23, 2020

Hmm, hard to tell what failed. I see:

1 feature passed, 0 failed, 0 skipped
42 scenarios passed, 0 failed, 0 skipped
168 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m9.261s
+ :
+ popd
/var/lib/jenkins/workspace/dnf-libdnf-test
[dnf-libdnf-test] $ python /tmp/jenkins2264749669589379953.py
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?

The last few runs of dnf-libdnf-test failed the same way, so I think it's unrelated to this PR?

Ahhh, I think it might be related to this:

Exception PermissionError: [Errno 13] Permission denied: '/junit/features'
Traceback (most recent call last):
  File "/usr/bin/behave", line 11, in <module>
    load_entry_point('behave==1.2.6', 'console_scripts', 'behave')()
  File "/usr/lib/python3.7/site-packages/behave/__main__.py", line 183, in main
    return run_behave(config)
  File "/usr/lib/python3.7/site-packages/behave/__main__.py", line 127, in run_behave
    failed = runner.run()
  File "/usr/lib/python3.7/site-packages/behave/runner.py", line 804, in run
    return self.run_with_paths()
  File "/usr/lib/python3.7/site-packages/behave/runner.py", line 824, in run_with_paths
    return self.run_model()
  File "/usr/lib/python3.7/site-packages/behave/runner.py", line 640, in run_model
    reporter.feature(feature)
  File "/usr/lib/python3.7/site-packages/behave/reporter/junit.py", line 264, in feature
    os.makedirs(self.config.junit_directory)
  File "/usr/lib64/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib64/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib64/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/junit/features'

@j-mracek
Copy link
Copy Markdown
Contributor

Lets try it again

@j-mracek
Copy link
Copy Markdown
Contributor

@rh-atomic-bot retry

@rh-atomic-bot
Copy link
Copy Markdown

⌛ Testing commit 83b1d62 with merge b6dac7b...

rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
Minimal wrappers around `SOLVER_FAVOR` and `SOLVER_DISFAVOR`. We'd like
to make use of these in rpm-ostree.

Closes: #937
Approved by: j-mracek
rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
This is the same thing we already have for e.g. `DnfReldepList`. These
helpers are really useful to keep C client code clean and make it harder
to leak resources.

Closes: #937
Approved by: j-mracek
@rh-atomic-bot
Copy link
Copy Markdown

💔 Test failed - status-papr

@m-blaha
Copy link
Copy Markdown
Member

m-blaha commented Apr 24, 2020

Sorry guys - misconfiguration in jenkins job. Should by fixed now.

@m-blaha
Copy link
Copy Markdown
Member

m-blaha commented Apr 24, 2020

@rh-atomic-bot retry

@rh-atomic-bot
Copy link
Copy Markdown

⌛ Testing commit 83b1d62 with merge 7ae9be8...

rh-atomic-bot pushed a commit that referenced this pull request Apr 24, 2020
This is the same thing we already have for e.g. `DnfReldepList`. These
helpers are really useful to keep C client code clean and make it harder
to leak resources.

Closes: #937
Approved by: j-mracek
@rh-atomic-bot
Copy link
Copy Markdown

☀️ Test successful - status-papr
Approved by: j-mracek
Pushing 7ae9be8 to dnf-4-master...

kontura added a commit to kontura/libdnf that referenced this pull request Apr 27, 2020
The problem was introduced by rpm-software-management#937
The PR added a new pkg with a require into the updates test repo
therefore their count increased.
rh-atomic-bot pushed a commit that referenced this pull request Apr 27, 2020
The problem was introduced by #937
The PR added a new pkg with a require into the updates test repo
therefore their count increased.

Closes: #947
Approved by: m-blaha
rh-atomic-bot pushed a commit that referenced this pull request Apr 27, 2020
The problem was introduced by #937
The PR added a new pkg with a require into the updates test repo
therefore their count increased.

Closes: #947
Approved by: m-blaha
rh-atomic-bot pushed a commit that referenced this pull request Apr 27, 2020
The problem was introduced by #937
The PR added a new pkg with a require into the updates test repo
therefore their count increased.

Closes: #947
Approved by: m-blaha
m-blaha pushed a commit that referenced this pull request Apr 27, 2020
The problem was introduced by #937
The PR added a new pkg with a require into the updates test repo
therefore their count increased.
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.

5 participants