Opened 4 years ago

Closed 3 years ago

#60781 closed defect (fixed)

llvm-3.4: SyntaxError: invalid syntax

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: tiger Cc: larryv (Lawrence Velázquez), jeremyhu (Jeremy Huddleston Sequoia)
Port: llvm-3.4

Description

llvm-3.4 fails to build on Tiger because it uses python but the system's python 2.3.5 is too old:

:info:build Traceback (most recent call last):
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-3.4/llvm-3.4/work/llvm-3.4.2.src/utils/llvm-build/llvm-build", line 3, in ?
:info:build     import llvmbuild
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-3.4/llvm-3.4/work/llvm-3.4.2.src/utils/llvm-build/llvmbuild/__init__.py", line 1, in ?
:info:build     from llvmbuild.main import main
:info:build   File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-3.4/llvm-3.4/work/llvm-3.4.2.src/utils/llvm-build/llvmbuild/main.py", line 65
:info:build     @staticmethod
:info:build     ^
:info:build SyntaxError: invalid syntax

Presumably other versions of llvm would be affected too.

clang-3.4 already uses python27 (or python27-bootstrap); maybe that can be extended to apply to the llvm-3.4 part as well.

Attachments (1)

main.log.bz2 (56.2 KB) - added by ryandesign (Ryan Carsten Schmidt) 4 years ago.

Download all attachments as: .zip

Change History (22)

Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log.bz2 added

comment:1 Changed 4 years ago by kencu (Ken)

In here <https://github.com/kencu/TigerPorts/tree/master/lang> I have all the way up to llvm-7.0/clang-7.0 working on Tiger, with libc++, and -- although I don't see that particular error fixed on immediate glance, I have fixed it before <https://github.com/macports/macports-ports/commit/5747168bf3803c322e279791ba4833a402a5dd80#diff-44f1dc3f531b1f925b6c463781df53a0> in llvm-3.3.

There are -- several dozen more - Tiger fixes in there.

If there is appetite, I can start moving these into the MacPorts tree. I have not done so to date for reasons of avoiding confusion.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:2 Changed 4 years ago by kencu (Ken)

Welcome to Darwin!
MacMini:~$ port -v installed | grep clang
  clang-3.4 @3.4.2_13 (active) platform='darwin 8' archs='i386' date='2020-03-10T15:13:46-0700'
  clang-3.7 @3.7.1_6 (active) platform='darwin 8' archs='i386' date='2020-03-20T22:12:13-0700'
  clang-3.8 @3.8.1_9+libstdcxx (active) platform='darwin 8' archs='i386' date='2020-03-14T23:15:45-0700'
  clang-5.0 @5.0.2_4+emulated_tls+libstdcxx platform='darwin 8' archs='i386' date='2020-03-22T20:49:17-0700'
  clang-7.0 @7.1.0_0+emulated_tls+libstdcxx platform='darwin 8' archs='i386' date='2020-03-24T15:21:13-0700'
  clang_select @2.2_0 (active) platform='darwin 8' archs='noarch' date='2020-03-10T08:07:41-0700'
MacMini:~$ port -v installed | grep llvm
  llvm-3.4 @3.4.2_12 (active) platform='darwin 8' archs='i386' date='2020-03-10T13:32:13-0700'
  llvm-3.7 @3.7.1_4 (active) platform='darwin 8' archs='i386' date='2020-03-16T22:51:55-0700'
  llvm-3.8 @3.8.1_3 (active) platform='darwin 8' archs='i386' date='2020-03-14T19:15:06-0700'
  llvm-5.0 @5.0.2_1 (active) platform='darwin 8' archs='i386' date='2020-03-22T11:09:10-0700'
  llvm-7.0 @7.1.0_0+emulated_tls (active) platform='darwin 8' archs='i386' date='2020-03-24T11:26:32-0700'
  llvm_select @2_0 (active) platform='darwin 8' archs='noarch' date='2020-03-10T08:08:41-0700'
MacMini:~$ port -v installed | grep libcxx
  libcxx @5.0.1_4 platform='darwin 8' archs='i386' date='2020-03-16T18:37:39-0700'
  libcxx @5.0.1_4+emulated_tls (active) platform='darwin 8' archs='i386' date='2020-03-21T22:35:42-0700'
Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:3 Changed 4 years ago by kencu (Ken)

That was one week of coronavirus boredom , BTW...

comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Right, thank you for the work figuring things out in your TigerPorts repository but I would like any fixes to be brought into the main repository. I would like users to be able to install the ports we provide without having to go to third-party ports trees.

comment:5 Changed 4 years ago by kencu (Ken)

So that is permission then to start moving these fixes in?

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I haven't looked at what you've done in that repository, but you should certainly submit pull requests for changes that are appropriate for the main ports tree.

comment:7 Changed 4 years ago by kencu (Ken)

Cc: jeremyhu added; kencu removed
Owner: changed from jeremyhu to kencu

comment:8 Changed 4 years ago by kencu (Ken)

Oh -- btw -- I just stopped at llvm/clang-7.0 because I had other things to do. There was no particular issue I found with the newer ones, I just didn't get to them.

comment:9 in reply to:  description Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

clang-3.4 already uses python27 (or python27-bootstrap); maybe that can be extended to apply to the llvm-3.4 part as well.

llvm-3.4 does build fine after sudo port select python python27, suggesting that the above is all that's needed to fix it.

comment:11 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, but don't forget to check os.platform before checking os.major. And what about the libc++ bootstrap issue?

comment:12 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I guess there is no libc++ on 10.4

comment:13 Changed 4 years ago by kencu (Ken)

there will be in a day or two

comment:14 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Oh great. Well then don't you just want to take the existing python27 stuff out of the clang-3.4 subport and into the main part of the port?

comment:15 Changed 4 years ago by kencu (Ken)

not quite that simple with python and llvm-3.4 <https://github.com/macports/macports-ports/blob/8ab1ef8c8ab9892b581c13382407709c33a381ba/lang/llvm-3.4/Portfile#L83>.

I am tempted to just use python27-bootstrap all the time, but that is not super-clean; alternatively more Portfile spaghetti to straighten out what we want for every possible permutation....

comment:16 in reply to:  15 ; Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

not quite that simple with python and llvm-3.4 <https://github.com/macports/macports-ports/blob/8ab1ef8c8ab9892b581c13382407709c33a381ba/lang/llvm-3.4/Portfile#L83>.

What are you showing me by pointing me to that code?

What I am getting at is that the clang-3.4 subport declares a dependency on python27. The code you showed me above replaces that with python27-bootstrap in the cases where it is necessary. The llvm-3.4 subport does not declare a dependency on python27 so the code you showed me above has no effect in that subport. I am suggesting that the llvm-3.4 subport should have a python27 dependency (replaced by python27-bootstrap by the above code when needed) just like clang-3.4.

I am tempted to just use python27-bootstrap all the time, but that is not super-clean; alternatively more Portfile spaghetti to straighten out what we want for every possible permutation....

If by all the time you mean on all OS versions, you certainly cannot, because it requires libstdc++ which does not exist on Mojave and later. We should only use the libstdc++-using bootstrap ports on systems trying to bootstrap their way to installing libc++, which is what we already do.

comment:17 in reply to:  16 Changed 4 years ago by kencu (Ken)

Replying to ryandesign:

Replying to kencu:

not quite that simple with python and llvm-3.4 <https://github.com/macports/macports-ports/blob/8ab1ef8c8ab9892b581c13382407709c33a381ba/lang/llvm-3.4/Portfile#L83>.

What are you showing me by pointing me to that code?

Nothing - this is my port - I'm putting my thoughts down about how I am going to manage it.

I am tempted to just use python27-bootstrap all the time, but that is not super-clean; alternatively more Portfile spaghetti to straighten out what we want for every possible permutation....

If by all the time you mean on all OS versions, you certainly cannot, because it requires libstdc++ which does not exist on Mojave and later. We should only use the libstdc++-using bootstrap ports on systems trying to bootstrap their way to installing libc++, which is what we already do.

I guess as the maintainer of this port I would be pretty stupid if that all were not totally obvious.

comment:18 Changed 4 years ago by Wowfunhappy (Jonathan)

Just confirming that sudo port select python python27 was sufficient to fix this for me on Intel Tiger!

comment:19 Changed 4 years ago by kencu (Ken)

yeah, I was going to fix this in MacPorts (I have it fixed in my own TigerPorts repos) but haven't yet.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:20 Changed 4 years ago by kencu (Ken)

BTW, if you don't know about my TigerPorts repos (and LeopardPorts, SnowLeoopardPorts, and LionPorts) you certainly should look at them, as there are many many fixes in there for certain things like this, relevant to older systems.

comment:21 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 3ec3a152bbcd9709dac33b03707f09d3abb2cc42/macports-ports (master):

llvm-3.4: use a newer python on Tiger

closes: #60781

Note: See TracTickets for help on using tickets.