Consistent patch ordering (#10879)
* preserve the order in which patches are applied by packages (in spite of grouping them by 'when') * add tests confirming patch order
This commit is contained in:

committed by
Greg Becker

parent
99f35c3338
commit
a6511fbafc
@@ -0,0 +1 @@
|
||||
mid1
|
@@ -0,0 +1,30 @@
|
||||
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class DepDiamondPatchMid1(Package):
|
||||
r"""Package that requires a patch on a dependency
|
||||
|
||||
W
|
||||
/ \
|
||||
X Y
|
||||
\ /
|
||||
Z
|
||||
|
||||
This is package X
|
||||
"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
# single patch file in repo
|
||||
depends_on('patch', patches='mid1.patch')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
pass
|
@@ -0,0 +1,33 @@
|
||||
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class DepDiamondPatchMid2(Package):
|
||||
r"""Package that requires a patch on a dependency
|
||||
|
||||
W
|
||||
/ \
|
||||
X Y
|
||||
\ /
|
||||
Z
|
||||
|
||||
This is package Y
|
||||
"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
# single patch file in repo
|
||||
depends_on('patch', patches=[
|
||||
patch('http://example.com/urlpatch.patch',
|
||||
sha256='mid21234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234'), # noqa: E501
|
||||
])
|
||||
|
||||
def install(self, spec, prefix):
|
||||
pass
|
@@ -0,0 +1,32 @@
|
||||
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
class DepDiamondPatchTop(Package):
|
||||
r"""Package that requires a patch on a dependency
|
||||
|
||||
W
|
||||
/ \
|
||||
X Y
|
||||
\ /
|
||||
Z
|
||||
|
||||
This is package W
|
||||
"""
|
||||
|
||||
homepage = "http://www.example.com"
|
||||
url = "http://www.example.com/patch-a-dependency-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
# single patch file in repo
|
||||
depends_on('patch', patches='top.patch')
|
||||
depends_on('dep-diamond-patch-mid1')
|
||||
depends_on('dep-diamond-patch-mid2')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
pass
|
@@ -0,0 +1 @@
|
||||
top
|
@@ -13,9 +13,10 @@ class Patch(Package):
|
||||
url = "http://www.example.com/patch-1.0.tar.gz"
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
version('2.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
patch('foo.patch')
|
||||
patch('bar.patch')
|
||||
patch('bar.patch', when='@2:')
|
||||
patch('baz.patch')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
Reference in New Issue
Block a user