Skip to content

MPFR: fix patch checksum, add dependencies#15783

Merged
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:packages/mpfr
Apr 17, 2020
Merged

MPFR: fix patch checksum, add dependencies#15783
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:packages/mpfr

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart commented Mar 31, 2020

For the mpfr package, we use the aggregated allpatches patch for each version. Unfortunately, this patch is added to from time-to-time, so the checksum changed. This PR updates the checksum, and switches older patched to sha256. The older patches did not change, only the latest patch.

This PR also adds a dependency on autoconf-archive. Without this, mpfr fails during the build stage with the following error message:

configure:14208: error: possibly undefined macro: AX_PTHREAD
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make: *** [configure] Error 1
make: *** Waiting for unfinished jobs....

Depends on #15784

@michaelkuhn
Copy link
Copy Markdown
Member

FYI: It seems the hash has changed again. It is now 8f15fd27ab65341a60d724d594897d32f4597ddf642d0dc121995e2150181b0c.

@adamjstewart
Copy link
Copy Markdown
Member Author

Checksum has been updated. If we want to avoid this checksum issue, we could replace allpatches with the individual patches provided for each release, but past releases have had as many as 17 individual patches. The package would be more stable, but also more bloated. If anyone has any opinions on this left me know.

@michaelkuhn
Copy link
Copy Markdown
Member

If we want to avoid this checksum issue, we could replace allpatches with the individual patches provided for each release, but past releases have had as many as 17 individual patches. The package would be more stable, but also more bloated. If anyone has any opinions on this left me know.

At this point, I think I would prefer bloated over breaking all the time.

@adamjstewart
Copy link
Copy Markdown
Member Author

For comparison with other package managers, Homebrew gets around this problem by not applying any patches at all: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mpfr.rb

@adamjstewart adamjstewart merged commit def1d5e into spack:develop Apr 17, 2020
@adamjstewart adamjstewart deleted the packages/mpfr branch April 17, 2020 21:30
@hartzell
Copy link
Copy Markdown
Contributor

I'm unable to build mfpr. I'm stuck back at spack commit f912cce and/but have grabbed the mpfr package from the fix.

It dies because the macro, AX_PTHREAD is undefined.

[...]
autoreconf: running: /local_scratch/george.hartzell/spack-20200421025006/opt/spack/linux-centos7-skylake_avx512/gcc-8.4.0/autoconf-2.69-3zgzqh6ta32i53gyhfgfvlvr7tt5ptjj/bin/autoconf --include=/local_scratch/george.hartzell/spack-20200421025006/opt/spack/linux-centos7-skylake_avx512/gcc-8.4.0/pkgconf-1.6.3-6yq2xn77qpnncqeqycspsikmw4llkzdy/share/aclocal --force
configure:14193: error: possibly undefined macro: AX_PTHREAD
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /local_scratch/george.hartzell/spack-20200421025006/opt/spack/linux-centos7-skylake_avx512/gcc-8.4.0/autoconf-2.69-3zgzqh6ta32i53gyhfgfvlvr7tt5ptjj/bin/autoconf failed with exit status: 1
[...]

Supposedly depending on autoconf-archive should fix that. It's installed and in the spec for mpfr. I can see ax_pthread.m4 beneath the autoconf-archive install prefix.

I don't understand how the autotools invocation in mpfr is supposed to know to look over in Spack's autoconf-archive prefix to find the file. Is it a pkg-config thing, or??? Is something missing somewhere in the autoconf-archive install or?

:scratch:

@hartzell
Copy link
Copy Markdown
Contributor

hartzell commented Apr 26, 2020

[edit, fix version number in spec.satisfies: @0.4.2 -> @4.0.2]

Following a clue from this intel compiler bug fix, I decided that "someone" needed to copy the appropriate file into the mpfr source tree before reconfiguring.

This let's it build for me.

    @run_before('autoreconf')
    def copy_ax_pthread_m4(self):
        """Copy the ax_pthread.m4 file from autoconf_archive
        into the m4 directory.
        """

       if self.spec.satisfies('@4.0.2:'):
            install(join_path(self.spec['autoconf-archive'].prefix,
                              'share/aclocal/ax_pthread.m4'),
                    join_path(self.stage.source_path, "m4"))

I can't contribute code at the moment, if someone else wanted to base a PR on this, I'd be overjoyed! IF they improved on it, I'd be even happier!

@adamjstewart
Copy link
Copy Markdown
Member Author

I don't understand how the autotools invocation in mpfr is supposed to know to look over in Spack's autoconf-archive prefix to find the file.

See #15784 for how things are supposed to work.

@hartzell
Copy link
Copy Markdown
Contributor

So it boils down to me being stuck back behind that fix.

Thanks for the pointer, sorry for the wasted bandwidth.

@sethrj
Copy link
Copy Markdown
Contributor

sethrj commented Jun 3, 2020

@adamjstewart mpfr's patch file has changed again:

Expected 8f15fd27ab65341a60d724d594897d32f4597ddf642d0dc121995e2150181b0c but got 3f80b836948aa96f8d1cb9cc7f3f55973f19285482a96f9a4e1623d460bcccf0

I think the best bet might be to:

  1. Copy the official patch file into the spack repo, so that we can keep it under version control and actually figure out what the heck changes every time the checksum breaks (what if someone introduces a malicious change??). The constant updates to this file invalidate the whole point of checksums.
  2. Leave a note in the recipe that if MPFR seems to break for a configuration, check the upstream patch file and update the spack version if necessary.

ReinhardPrix pushed a commit to ReinhardPrix/spack that referenced this pull request Jun 5, 2020
* MPFR: fix patch checksum, add dependencies

* Update checksum again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

checksum Tarball checksum mismatches. dependencies patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants