Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmake: fix compile error and update version #17956

Merged
merged 3 commits into from
Aug 14, 2020
Merged

Conversation

darmac
Copy link
Contributor

@darmac darmac commented Aug 8, 2020

No description provided.

Copy link
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.

Could you please give more details on the compiler error you are facing and how this PR solves the issue? Also can you remove commented code from the recipe?

@@ -6,29 +6,42 @@
from spack import *


class Bmake(Package):
class Bmake(AutotoolsPackage):
Copy link
Member

Choose a reason for hiding this comment

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

The reason that this originally used Package instead of AutotoolsPackage is that by bootstrapping the program, we can build make without relying on a previously existing make on the system. I'm not sure if anyone has actually used it for that purpose, but this change makes it impossible to bootstrap make without an external make command.

Copy link
Contributor Author

@darmac darmac Aug 10, 2020

Choose a reason for hiding this comment

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

Got it.
How about this one? 75467cd

@darmac
Copy link
Contributor Author

darmac commented Aug 10, 2020

Could you please give more details on the compiler error you are facing and how this PR solves the issue? Also can you remove commented code from the recipe?

Error log as below:

[root@Estuary-CentOS8 packages]# spack install -v bmake@20171207
==> Installing bmake
==> No binary for bmake found: installing from source
==> bmake: Executing phase: 'configure'
==> [2020-08-10-19:08:46.631537] '/usr/bin/sh' 'boot-strap' 'op=configure'
NOTE: default prefix=/usr/local
Usage:
boot-strap [--<configure_arg> ...][<prefix>][--install]
==> Error: ProcessError: Command exited with status 1:
    '/usr/bin/sh' 'boot-strap' 'op=configure'
See build log for details:
  /tmp/root/spack-stage/spack-stage-bmake-20171207-widv4b5muq4464xqbyp73hsrolirpf7c/spack-build-out.txt

@adamjstewart
Copy link
Member

Okay, I'm taking a closer look into this. When I wrote #8221 those commands worked just fine. They still work fine when run from the command-line, but fail for some reason when run via Spack. According to the README, the way we had it is the recommended installation method:

The preferred way to bootstrap bmake is::

        ./bmake/boot-strap

there are a number of args - most of which get passed to configure,
eg.
::

        ./bmake/boot-strap --prefix=/opt

see the boot-strap script for details.

For folk that hate to read anything, since 20121212 you can also use
the GNU standard process of::

        ./configure; make; make install

@adamjstewart
Copy link
Member

Figured it out. At some point, the way in which we staged the package changed. If you extract the tarball, it creates a directory bmake, and things run fine. But Spack creates a directory spack-src, and things won't build anymore.

I think there are a couple of possible solutions here. We could patch boot-strap to work in spack-src, or we could undo the commit that renames the extracted directory to spack-src.

@adamjstewart
Copy link
Member

@tldahlgren it looks like #11528 broke the bmake package. Can you investigate this?

bmake builds fine if the tarball is extracted into a bmake directory, but fails when extracted into a spack-src directory. It looks like the bmake directory is hard-coded into the boot-strap script.

@adamjstewart
Copy link
Member

@darmac this fixed the package for me:

diff --git a/var/spack/repos/builtin/packages/bmake/package.py b/var/spack/repos/builtin/packages/bmake/package.py
index 8d103513f5..142f7ba136 100644
--- a/var/spack/repos/builtin/packages/bmake/package.py
+++ b/var/spack/repos/builtin/packages/bmake/package.py
@@ -20,6 +20,9 @@ class Bmake(Package):
     def patch(self):
         # Do not pre-roff cat pages
         filter_file('MANTARGET?', 'MANTARGET', 'mk/man.mk', string=True)
+        # boot-strap hardcodes the directory it expects to be extracted to
+        filter_file('GetDir /bmake', 'GetDir ' + self.stage.source_path,
+                    'boot-strap', string=True)
 
     def configure(self, spec, prefix):
         sh = which('sh')

Just make sure it applies to all versions of the package and I think this solution should be best.

@darmac
Copy link
Contributor Author

darmac commented Aug 13, 2020

Just make sure it applies to all versions of the package and I think this solution should be best.

OK, I tried your patch with bmake@20180512 and bmake@20200710,
They can both build pass.
c2ff2a7

@alalazo alalazo merged commit f901947 into spack:develop Aug 14, 2020
@darmac darmac deleted the bmake branch September 1, 2020 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants