#1335 Call _get_base_module_stream_overrides when the module is not the input module
Merged 4 years ago by jkaluza. Opened 4 years ago by mprahl.

@@ -306,8 +306,6 @@ 

              for dep in mmd.get_dependencies()

          ]

  

-         base_module_stream_overrides = self._get_base_module_stream_overrides(mmd)

- 

          # Each solvable object has name, version, architecture and list of

          # provides/requires/conflicts which defines its relations with other solvables.

          # You can imagine solvable as a single RPM.
@@ -340,6 +338,7 @@ 

  

              self._add_base_module_provides(solvable, mmd)

  

+             base_module_stream_overrides = self._get_base_module_stream_overrides(mmd)

              # Fill in the "Requires" of this module, so we can track its dependencies

              # on other modules.

              requires = self._deps2reqs(
@@ -403,7 +402,7 @@ 

                  solvable.evr = str(v)

                  solvable.arch = "src"

  

-                 requires = self._deps2reqs([normalized_deps[c]], base_module_stream_overrides)

+                 requires = self._deps2reqs([normalized_deps[c]])

                  log.debug("Adding module %s with requires: %r", solvable.name, requires)

                  solvable.add_deparray(solv.SOLVABLE_REQUIRES, requires)

  

file modified
+10 -16
@@ -194,12 +194,11 @@ 

          assert expanded == expected

  

      @pytest.mark.parametrize(

-         "buildrequires, xmd_buildrequires, expected",

+         "buildrequires, expected",

          (

              # BR all platform streams -> build for all platform streams.

              (

                  {"platform": []},

-                 {},

                  [

                      [

                          ["platform:el8.2.0.z:0:c0:x86_64"],
@@ -212,7 +211,6 @@ 

              # BR "el8" platform stream -> build for all el8 platform streams.

              (

                  {"platform": ["el8"]},

-                 {},

                  [

                      [

                          ["platform:el8.2.0.z:0:c0:x86_64"],
@@ -221,21 +219,19 @@ 

                      ]

                  ],

              ),

-             # BR "el8.1.0" platfrom stream -> build just for el8.1.0.

-             ({"platform": ["el8"]}, ["platform:el8.1.0"], [[["platform:el8.1.0:0:c0:x86_64"]]]),

+             # BR "el8.1.0" platform stream -> build just for el8.1.0.

+             ({"platform": ["el8.1.0"]}, [[["platform:el8.1.0:0:c0:x86_64"]]]),

              # BR platform:el8.1.0 and gtk:3, which is not built against el8.1.0,

              # but it is built only against el8.0.0 -> cherry-pick gtk:3 from el8.0.0

              # and build once against platform:el8.1.0.

              (

-                 {"platform": ["el8"], "gtk": ["3"]},

-                 ["platform:el8.1.0"],

+                 {"platform": ["el8.1.0"], "gtk": ["3"]},

                  [[["platform:el8.1.0:0:c0:x86_64", "gtk:3:0:c8:x86_64"]]],

              ),

              # BR platform:el8.2.0 and gtk:3, this time gtk:3 build against el8.2.0 exists

              # -> use both platform and gtk from el8.2.0 and build once.

              (

-                 {"platform": ["el8"], "gtk": ["3"]},

-                 ["platform:el8.2.0.z"],

+                 {"platform": ["el8.2.0.z"], "gtk": ["3"]},

                  [[["platform:el8.2.0.z:0:c0:x86_64", "gtk:3:1:c8:x86_64"]]],

              ),

              # BR platform:el8.2.0 and mess:1 which is built against platform:el8.1.0 and
@@ -244,8 +240,7 @@ 

              # -> cherry-pick mess:1 from el8.1.0 and

              # -> use gtk:3:1 from el8.2.0.

              (

-                 {"platform": ["el8"], "mess": ["1"]},

-                 ["platform:el8.2.0.z"],

+                 {"platform": ["el8.2.0.z"], "mess": ["1"]},

                  [[["platform:el8.2.0.z:0:c0:x86_64", "mess:1:0:c0:x86_64", "gtk:3:1:c8:x86_64"]]],

              ),

              # BR platform:el8.1.0 and mess:1 which is built against platform:el8.1.0 and
@@ -254,14 +249,13 @@ 

              # -> Used mess:1 from el8.1.0 and

              # -> cherry-pick gtk:3:0 from el8.0.0.

              (

-                 {"platform": ["el8"], "mess": ["1"]},

-                 ["platform:el8.1.0"],

+                 {"platform": ["el8.1.0"], "mess": ["1"]},

                  [[["platform:el8.1.0:0:c0:x86_64", "mess:1:0:c0:x86_64", "gtk:3:0:c8:x86_64"]]],

              ),

              # BR platform:el8.0.0 and mess:1 which is built against platform:el8.1.0 and

              # requires gtk:3 which is built against platform:el8.2.0 and platform:el8.0.0

              # -> No valid combination, because mess:1 is only available in el8.1.0 and later.

-             ({"platform": ["el8"], "mess": ["1"]}, ["platform:el8.0.0"], []),

+             ({"platform": ["el8.0.0"], "mess": ["1"]}, []),

              # This is undefined... it might build just once against latest platform or

              # against all the platforms... we don't know

              # ({"platform": ["el8"], "gtk": ["3"]}, {}, [
@@ -269,7 +263,7 @@ 

              # ]),

          ),

      )

-     def test_solve_virtual_streams(self, buildrequires, xmd_buildrequires, expected):

+     def test_solve_virtual_streams(self, buildrequires, expected):

          modules = (

              # (nsvc, buildrequires, expanded_buildrequires, virtual_streams)

              ("platform:el8.0.0:0:c0", {}, {}, ["el8"]),
@@ -283,7 +277,7 @@ 

          for n, req, xmd_br, virtual_streams in modules:

              self.mmd_resolver.add_modules(self._make_mmd(n, req, xmd_br, virtual_streams))

  

-         app = self._make_mmd("app:1:0", buildrequires, xmd_buildrequires)

+         app = self._make_mmd("app:1:0", buildrequires)

          if not expected:

              with pytest.raises(RuntimeError):

                  self.mmd_resolver.solve(app)

This just simplifies the code. It doesn't change the functionality at all. The tests had to be changed because it assumed that the xmd.mbs.buildrequires section would be filled out for the input module which isn't true.

Build #245 failed (commit: 68305b780a96ef5283b4d17a901b71b26ec6d907).
Rebase or make new commits to rebuild.

pretty please pagure-ci rebuild

4 years ago

rebased onto 790ab325f155f96d4fd0ff057270f4e2a420f242

4 years ago

pretty please pagure-ci rebuild

4 years ago

rebased onto 038e285cc447ff671ab1565a2637d5184621ca4c

4 years ago

rebased onto 57219bbb6c2668a12d9e8dd16ddc783289352c61

4 years ago

rebased onto 0466ac3

4 years ago

Thanks for the review @cqi. I finally got the tests to pass now.

@jkaluza could you please review since this touches code you've written?

Commit 1c76f12 fixes this pull-request

Pull-Request has been merged by jkaluza

4 years ago

Pull-Request has been merged by jkaluza

4 years ago