Skip to content

Dependency patch being applied to dependent #8475

@adamjstewart

Description

@adamjstewart

In #8263, I added a patch for JasPer needed to build GDAL:

depends_on('[email protected]', patches=patch('uuid.patch'), when='+jasper')

However, it seems like Spack is trying to apply this patch to GDAL itself:

$ spack install gdal~jasper
...
==> Installing gdal
==> Using cached archive: /Users/Adam/spack/var/spack/cache/gdal/gdal-2.3.0.tar.xz
==> Staging archive: /Users/Adam/spack/var/spack/stage/gdal-2.3.0-wagxrqcruikkh4yi32oziad4ucvyj4pe/gdal-2.3.0.tar.xz
==> Created stage in /Users/Adam/spack/var/spack/stage/gdal-2.3.0-wagxrqcruikkh4yi32oziad4ucvyj4pe
The text leading up to this was:
--------------------------
|diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_cod.c jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.c
|--- jasper-1.900.1/src/libjasper/jp2/jp2_cod.c	2007-01-19 15:43:05.000000000 -0600
|+++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.c	2007-03-06 07:49:58.000000000 -0600
--------------------------
File to patch: 
Skip this patch? [y] 
5 out of 5 hunks ignored
The text leading up to this was:
--------------------------
|diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_cod.h jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.h
|--- jasper-1.900.1/src/libjasper/jp2/jp2_cod.h	2007-01-19 15:43:05.000000000 -0600
|+++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_cod.h	2007-03-06 07:49:58.000000000 -0600
--------------------------
File to patch: 
Skip this patch? [y] 
3 out of 3 hunks ignored
The text leading up to this was:
--------------------------
|diff -Naur jasper-1.900.1/src/libjasper/jp2/jp2_enc.c jasper-1.900.1.uuid/src/libjasper/jp2/jp2_enc.c
|--- jasper-1.900.1/src/libjasper/jp2/jp2_enc.c	2007-01-19 15:43:05.000000000 -0600
|+++ jasper-1.900.1.uuid/src/libjasper/jp2/jp2_enc.c	2007-03-06 07:49:58.000000000 -0600
--------------------------
File to patch: 
Skip this patch? [y] 
5 out of 5 hunks ignored
==> Patch uuid.patch failed.
==> Error: ProcessError: Command exited with status 1:
    '/usr/bin/patch' '-s' '-p' '1' '-i' '/Users/Adam/spack/var/spack/repos/builtin/packages/gdal/uuid.patch' '-d' '.'
==> Error: [Errno 2] No such file or directory: '/Users/Adam/spack/var/spack/stage/gdal-2.3.0-wagxrqcruikkh4yi32oziad4ucvyj4pe/gdal-2.3.0/spack-build.out'

This patch should be applied to jasper, not to gdal. In fact, it shouldn't be applied at all since I'm explicitly disabling the jasper variant.

@scheibelp Can you take a look at this? I checked out the commits before and after #8272 but it didn't seem to be the cause of this bug. I swear I didn't have this problem when I wrote #8263 (because the patch wasn't being applied, to gdal or to jasper).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions