Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Partially support for darwin-64 #64

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Jahrme
Copy link

@Jahrme Jahrme commented Apr 8, 2019

This is my initial work in getting GUB to build a darwin-64 (x86_64-apple-darwin) target in preparation for Apple discontinuing support for 32-bit binaries.

The next step in successfully building for darwin-64 is adjusting/fixing the Perl spec to compile on macOS.

Copy link
Collaborator

@jmander jmander left a comment

Choose a reason for hiding this comment

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

Sorry for the delay! With this change, binutils no longer builds in GUB on GNU/Linux, because of idiosyncrasies in GUB code for packaging which relied on that tar flag. Merging this change and keeping GUB able to build LilyPond on GNU/Linux requires cleaning up that, which I'll look into soon.

@Jahrme
Copy link
Author

Jahrme commented May 5, 2019

No worries! That’s good to know, I thought I had checked to make sure Linux still worked but I must have missed that.

I see two easy solutions and one hard solution:

  1. Add a simple if/else (similar to what was added to bzip2.py) to use the flag when building on GNU/Linux and to not use it on macOS (Darwin).
  2. Require the use of GNU tar on macOS either by checking for existence of common executable names (gtar from homebrew or gnutar from MacPorts) or by requiring the user to set a variable pointing to the proper version of GNU tar.
  3. (Outside of the current scope.) “Fix” GUB so that it does not rely on a non-portable flag that is not even mentioned (as far as I can tell) in the man pages for GNU tar.

Option 1 would be the easiest and would not add any additional dependencies for running GUB on macOS. Option 2 would probably make building on Linux vs Darwin more consistent, but also would be more involved to do correctly.

I can implement the change either way, so if you (or someone else) has a strong opinion on which solution would be better please speak up, otherwise I will probably use option 1 as it is the most straightforward.

@jmander
Copy link
Collaborator

jmander commented May 5, 2019

Today I dived into the packaging code to investigate on what you named Option 3, and I estimated this would mean rewriting the handling of GUP subpackages. This is not as hard as brain surgery, but given my available time it may take me 2 weeks before coming back with a patch.
In the meantime, I'll be happy to test a patch of you for Option 1.

@Jahrme
Copy link
Author

Jahrme commented May 5, 2019

@jmander, I just pushed a patch which restores the use of --ignore-failed on non-Darwin systems.

However, are you sure that this flag was the issue? When I specifically tested building binutils on both Darwin and Linux the problem I encountered was that GUB is attempting to download a .tar.gz archive while the GNU site only has .tar.bz2 archives available for the requested version.

As I have noticed this, I am going to submit a separate patch fixing this issue as well as (potentially) updating binutils provided that using a newer version does not break anything else. (Currently GUB is using 2.19.1 while the most recent release is 2.32 which was released back in February.)

@@ -341,9 +342,23 @@ def execute (self, logger):
globs.append ('no-globs-for-%(dest)s' % locals ())
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC it's because of this idiosyncracy that the --ignore-failed Tar flag is useful, maybe not only for linux-x86:binutils (this was the first package on which I got a consistent build failure without this flag).

@jmander
Copy link
Collaborator

jmander commented May 5, 2019

I just pushed a patch which restores the use of --ignore-failed on non-Darwin systems.

Thanks, with this patch (and also all changes of this PR) GUB build is going much further (though I'm afraid the recent GCC upgrade on my GNU/Linux distro from 7.x to 8.3 break something).

Copy link
Collaborator

@jmander jmander left a comment

Choose a reason for hiding this comment

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

Some OS-dependent casing should be added in GUB and/or the wrapping makefile to prevent this kind of error on GNU/Linux:

Traceback (most recent call last):
  File "test-lily/upload.py", line 277, in <module>
    main ()
  File "test-lily/upload.py", line 264, in main
    cmds = upload_binaries (repo, version_tup, version_db)
  File "test-lily/upload.py", line 108, in upload_binaries
    format = formats[platform]
KeyError: 'darwin-64'
make[1]: *** [lilypond.make:160: print-success] Error 1
make[1]: Leaving directory '/home/gub/gub'
make: *** [GNUmakefile:26: lilypond] Error 2

I got this error by running make lilypond.
I'll try finding time tomorrow to look into this.

@@ -32,6 +32,7 @@ def argv0_relocation ():
'linux-ppc',
'darwin-ppc',
'darwin-x86',
'darwin-64',
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Jahrme, as Darwin64 can't be built on GNU/Linux yet, what do you think about replacing this list with a dictionary with current list a keys and supported building host OS/architecture as values? I'd provide a patch, but I don't know which targets you can easily build on Darwin 64, is it everything listed here, or only Darwin 64, or something in between?

@marnen
Copy link

marnen commented Oct 16, 2019

I’m using some of this work in my attempt to get 64-bit builds working. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants