Skip to content

fixing target conversion to string#12914

Merged
tgamblin merged 10 commits intospack:developfrom
mdorier:fix-target-to-lower
Sep 25, 2019
Merged

fixing target conversion to string#12914
tgamblin merged 10 commits intospack:developfrom
mdorier:fix-target-to-lower

Conversation

@mdorier
Copy link
Copy Markdown
Contributor

@mdorier mdorier commented Sep 23, 2019

Fixes #12931.

I suppose the recent introduction of a Target object broke a number of packages that assumed spec.architecture.target to be a string. Here is a fix for the llvm and mesa packages.

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

LGTM if the check are changed in the form:

if spec.target.family == 'x86_64':
    ....

@mdorier
Copy link
Copy Markdown
Contributor Author

mdorier commented Sep 24, 2019

Ok I changed according to the above comments.

Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

Using the == operator is needed to check that a microarchitecture is equal to another. The __contains__ semantic is instead of looking for features in the given microarchitecture. See the suggestions given in the first reviews.

@alalazo alalazo added bugfix Something wasn't working, here's a fix don't-merge-yet labels Sep 25, 2019
@mdorier

This comment has been minimized.

@alalazo

This comment has been minimized.

@mdorier

This comment has been minimized.

@alalazo alalazo dismissed tgamblin’s stale review September 25, 2019 21:04

The required changes have been implemented

@tgamblin tgamblin merged commit e6cae97 into spack:develop Sep 25, 2019
sethrj added a commit to sethrj/spack that referenced this pull request Sep 26, 2019
Since spack#3206, 'spec.architecture.target' returned the microarchitecture
target rather than the architecture family. This causes QT 4 to fail to
build because it's expecting something like 'x86_64' rather than
'broadwell'.

See spack#12914

Erorr message:
```
==> [2019-09-26-09:37:33.834286] './configure' '-prefix' '/rnsdhpc/code/spack/opt/spack/clang/qt/aguusfi' '-v' '-opensource' '-no-opengl' '-release' '-confirm-license' '-optimized-qmake' '-no-pch' '-no-freetype' '-no-openssl' '-no-sql-db2' '-no-sql-ibase' '-no-sql-oci' '-no-sql-tds' '-no-sql-mysql' '-no-sql-odbc' '-no-sql-psql' '-no-sql-sqlite' '-no-sql-sqlite2' '-shared' '-no-openvg' '-no-nis' '-nomake' 'examples' '-nomake' 'tools' '-no-dbus' '-no-framework' '-fast' '-no-declarative-debug' '-no-gtkstyle' '-no-webkit' '-no-phonon' '-arch' 'broadwell' '-nomake' 'demos' '-cocoa' '-platform' 'unsupported/macx-clang-libc++' '-sdk' '/var/folders/gy/mrg1ffts2h945qj9k29s1l1dvvmbqb/T/s3j/spack-stage/xcode-select/clang/10.0.1-apple/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
Determining system architecture... (Darwin:18.7.0:x86_64)
    'macosx' is supported
System architecture: 'macosx'
Unknown architecture: "broadwell". Supported architectures: x86[i386] ppc x86_64 ppc64 arm armv6 armv7
```
sethrj added a commit to sethrj/spack that referenced this pull request Sep 26, 2019
Since spack#3206, 'spec.architecture.target' returned the microarchitecture
target rather than the architecture family. This causes QT 4 to fail to
build because it's expecting something like 'x86_64' rather than
'broadwell'.

See spack#12914

Erorr message:
```
==> [2019-09-26-09:37:33.834286] './configure' '-prefix' '/rnsdhpc/code/spack/opt/spack/clang/qt/aguusfi' '-v' '-opensource' '-no-opengl' '-release' '-confirm-license' '-optimized-qmake' '-no-pch' '-no-freetype' '-no-openssl' '-no-sql-db2' '-no-sql-ibase' '-no-sql-oci' '-no-sql-tds' '-no-sql-mysql' '-no-sql-odbc' '-no-sql-psql' '-no-sql-sqlite' '-no-sql-sqlite2' '-shared' '-no-openvg' '-no-nis' '-nomake' 'examples' '-nomake' 'tools' '-no-dbus' '-no-framework' '-fast' '-no-declarative-debug' '-no-gtkstyle' '-no-webkit' '-no-phonon' '-arch' 'broadwell' '-nomake' 'demos' '-cocoa' '-platform' 'unsupported/macx-clang-libc++' '-sdk' '/var/folders/gy/mrg1ffts2h945qj9k29s1l1dvvmbqb/T/s3j/spack-stage/xcode-select/clang/10.0.1-apple/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk'
Determining system architecture... (Darwin:18.7.0:x86_64)
    'macosx' is supported
System architecture: 'macosx'
Unknown architecture: "broadwell". Supported architectures: x86[i386] ppc x86_64 ppc64 arm armv6 armv7
```
@odoublewen
Copy link
Copy Markdown
Contributor

odoublewen commented Sep 26, 2019

Edit: for the record, the side-effect issue reported below will be addressed by #12958

Since this merge, when trying to install mesa, I'm now seeing: Error: ValueError: "arm" is not a valid target name

Here's the traceback:

==> Installing mesa
==> Searching for binary cache of mesa
==> Finding buildcaches in /bifx/apps/spack/mirror/build_cache
==> No binary for mesa found: installing from source
==> Fetching file:///bifx/apps/spack/mirror/mesa/mesa-18.3.6.tar.gz
######################################################################## 100.0%
==> Warning: Fetching from mirror without a checksum!
  This package is normally checked out from a version control system, but it has been archived on a spack mirror.  This means we cannot know a checksum for the tarball in advance. Be sure that your connection to this mirror is secure!
==> Staging archive: /tmp/osolberg/spack-stage/mesa-18.3.6-exmtsp4bm6mspj7nmhknqnu5wb6qc6qf/mesa-18.3.6.tar.gz
==> Created stage in /tmp/osolberg/spack-stage/mesa-18.3.6-exmtsp4bm6mspj7nmhknqnu5wb6qc6qf
==> Applied patch /home/osolberg/temp/spack/var/spack/repos/builtin/packages/mesa/autotools-x11-nodri.patch
==> Building mesa [AutotoolsPackage]
==> Executing phase: 'autoreconf'
==> Executing phase: 'configure'
==> Error: ValueError: "arm" is not a valid target name

/home/osolberg/temp/spack/var/spack/repos/builtin/packages/mesa/package.py:104, in configure_args:
        101        args_gallium_drivers = ['swrast']
        102        args_dri_drivers = []
        103
  >>    104        if spec.target.family == 'arm':
        105            args.append('--disable-libunwind')
        106
        107        num_frontends = 0

See build log for details:
  /tmp/odoublewen/spack-stage/mesa-18.3.6-exmtsp4bm6mspj7nmhknqnu5wb6qc6qf/spack-build-out.txt

Here's the spec:

$ ./bin/spack spec mesa
Input spec
--------------------------------
mesa

Concretized
--------------------------------
[email protected]%[email protected]+glx~llvm+opengl~opengles+osmesa patches=55a5611ca9fcbe8324c4d68a07b338134954ff12c5b122dc78ff376f012a1414 swr=none arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 +sigsegv arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected]+cpanm patches=0eac10ed90aeb0459ad8851f88081d439a4e41978e586ec743069e8b059370ac +shared+threads arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                    ^[email protected]%[email protected]~symlinks~termlib arch=linux-centos7-skylake_avx512
                        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected]+gold~headers~libiberty+nls~plugins arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected]+bzip2+curses+git~libunistring+libxml2 patches=9acdb4e73f67c241b5ef32505c9ddf7cf6884ca8ea661692f21dca28483b04b8 +tar+xz arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected]+shared arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected]~python arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected]+optimize+pic+shared arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected]+libbsd arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected]+lex patches=09c22e5c6fef327d3e48eb23f0d610dcd3a35ab9207f12e0f875701c677978d3 arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
        ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
            ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                ^[email protected]%[email protected]+bz2+ctypes+dbm+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4~uuid+zlib arch=linux-centos7-skylake_avx512
                    ^[email protected]%[email protected] arch=linux-centos7-skylake_avx512
                    ^[email protected]%[email protected]+systemcerts arch=linux-centos7-skylake_avx512
                    ^[email protected]%[email protected]~column_metadata+fts~functions~rtree arch=linux-centos7-skylake_avx512

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Sep 26, 2019

@odoublewen Working on a fix right now.

@pat-s
Copy link
Copy Markdown
Contributor

pat-s commented Oct 1, 2019

FYI: mesa install error is resolved for me.

@mdorier mdorier deleted the fix-target-to-lower branch October 1, 2019 09:40
tldahlgren pushed a commit to tldahlgren/spack that referenced this pull request Oct 11, 2019
* llvm: fixed issues with syntax and formatting
  * use spec.architecture.target.family
  * use spec.target instead of spec.architecture.target
* mesa: use == instead of __contains__
jrmadsen pushed a commit to jrmadsen/spack that referenced this pull request Oct 30, 2019
* llvm: fixed issues with syntax and formatting
  * use spec.architecture.target.family
  * use spec.target instead of spec.architecture.target
* mesa: use == instead of __contains__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something wasn't working, here's a fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'Target' object has no attribute 'lower'

5 participants