Opened 3 years ago

Last modified 6 weeks ago

#67209 reopened defect

vim @9.0.1276: builds fail for macOS releases 10.10 and earlier: os_macosx.m

Reported by: 0xdd-co Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mascguy (Christopher Nielsen), Cebtenzzre, haihige
Port: vim, MacVim

Description

Unable to build vim on Mountain Lion. See attached main.log. Also had warnings during config:

--->  Fetching distfiles for vim
--->  Verifying checksums for vim
--->  Extracting vim
--->  Configuring vim
Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  statacl: found in vim-9.0.1276/src/auto/config.log
  timer_create: found in vim-9.0.1276/src/auto/config.log
--->  Building vim
Error: Failed to build vim: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_vim/vim/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port vim failed

Attachments (1)

main.log (57.3 KB) - added by 0xdd-co 3 years ago.
main.log

Download all attachments as: .zip

Change History (32)

Changed 3 years ago by 0xdd-co

Attachment: main.log added

main.log

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to raimue
Port: vim added
Status: newassigned

comment:2 Changed 3 years ago by evanmiller (Evan Miller)

It looks like the Objective-C compiler or standard library does not support generic dictionaries.

:info:build os_macosx.m:389:36: error: expected '>'
755	:info:build static NSMutableDictionary<NSNumber*, NSSound*> *sounds_list = nil;
756	:info:build                                    ^
757	:info:build os_macosx.m:389:37: error: expected identifier or '('
758	:info:build static NSMutableDictionary<NSNumber*, NSSound*> *sounds_list = nil;
759	:info:build                                     ^

comment:3 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

Summary: vim @9.0.1276 build failure on Mac OS X 10.8.5 - os_macosx.mvim @9.0.1276: builds fail for macOS releases 10.11 and earlier: os_macosx.m

This is affecting a range of macOS releases, 10.10 and earlier; updated the summary to reflect that.

https://ports.macports.org/port/vim/details/

Last edited 3 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:5 Changed 3 years ago by mascguy (Christopher Nielsen)

Summary: vim @9.0.1276: builds fail for macOS releases 10.11 and earlier: os_macosx.mvim @9.0.1276: builds fail for macOS releases 10.10 and earlier: os_macosx.m

comment:6 Changed 3 years ago by Cebtenzzre

Cc: Cebtenzzre added

comment:7 Changed 3 years ago by Christopher Nielsen <mascguy@…>

In 42d8abd52fbd0d13e478aea1835dc9652c5d946f/macports-ports (master):

vim: fallback to previous version, for 10.10 and earlier
See: #67209

comment:8 Changed 3 years ago by raimue (Rainer Müller)

Port: MacVim added

The reason must be this upstream change: https://github.com/vim/vim/commit/4314e4f7da4db5d85f63cdf43b73be3689502c93 (9.0.0694)

MacVim must be affected the same way as this change is also part of @9.0.release176.

comment:9 in reply to:  8 Changed 3 years ago by mascguy (Christopher Nielsen)

Replying to raimue:

The reason must be this upstream change: https://github.com/vim/vim/commit/4314e4f7da4db5d85f63cdf43b73be3689502c93 (9.0.0694)

MacVim must be affected the same way as this change is also part of @9.0.release176.

It looks like MacVim has been broken for 10.11 since 2022-08. For 10.10 and earlier, it's been broken since at least 2019. (And perhaps longer, but that's as far back as the build history goes.)

Version-wise, the first update to 9.x broke 10.11. As for 10.10 and earlier, it's been broken since at least version 8.x.

Since all of the build logs have aged out, I requeued builds for it. We can take a look at the details once the buildbots catch up with their current backlog.

comment:10 Changed 2 years ago by sevan (Sevan Janiyan)

v9.0.1910 guards off enabling sound support to El Capitan & newer. I've managed to build (not via macport) the huge feature set fine on 10.4 ppc, 10.6 x86, and 10.11 without issue.

Last edited 2 years ago by sevan (Sevan Janiyan) (previous) (diff)

comment:11 Changed 2 years ago by fhgwright (Fred Wright)

Although not directly related to this ticket, I see that vim fails to declare a library dependency on libsodium, causing the existing 9.0.0472 install to break with the recent libsodium update. I see many references to libsodium in the sources, so this is a missing direct dependency.

comment:12 in reply to:  11 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to fhgwright:

Although not directly related to this ticket, I see that vim fails to declare a library dependency on libsodium, causing the existing 9.0.0472 install to break with the recent libsodium update. I see many references to libsodium in the sources, so this is a missing direct dependency.

That will be taken care of with this PR:

PR 20541 - vim,MacVim: avoid opportunistic linking with libsodium

comment:13 in reply to:  10 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to sevan:

v9.0.1910 guards off enabling sound support to El Capitan & newer. I've managed to build (not via macport) the huge feature set fine on 10.4 ppc, 10.6 x86, and 10.11 without issue.

Awesome, looking forward to being able to use the latest version of vim on older macOS releases. Thank you so much!

comment:14 Changed 2 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

comment:15 in reply to:  14 Changed 2 years ago by sevan (Sevan Janiyan)

Replying to raimue:

This was fixed by now with https://github.com/macports/macports-ports/pull/20541.

That pull request is for fixing the libsodium issue. The ticket is regarding enabling sound support on macos versions before el capitan. The fix for that is to drop the block which holds versions back to patch level 0472, as the issue has been fixed upstream so that sound support is only enabled when building with a recent enough toolchain. https://github.com/macports/macports-ports/blob/b89316123a4a60af3ba1e645842b91bd5e069929/editors/vim/Portfile#L11

comment:16 Changed 2 years ago by sevan (Sevan Janiyan)

Resolution: fixed
Status: closedreopened

comment:17 Changed 2 years ago by raimue (Rainer Müller)

Thanks for reopening the issue. Therefore the issue is not fixed until we reach vim @9.0.1910.

comment:18 Changed 2 years ago by sevan (Sevan Janiyan)

Correct, but there's no longer a need to have a distinction between macos versions and packaging different versions of vim, you should be able to build and install the latest version of vim from Tiger & beyond.

comment:19 Changed 2 years ago by raimue (Rainer Müller)

The vim port follows the vim version used in the MacVim port. Both will be updated at the same time. That is because both use the same configuration files and a mismatch in those can cause problems for users to get it working with both at the same time. Therefore the vim port is currently still at 9.0.1897 even though upstream has already released a newer patch.

comment:20 Changed 2 years ago by sevan (Sevan Janiyan)

Ah, understood. I was thinking of the block which holds things back to 9.0.0472 for the older macOS versions.

if {${os.platform} eq "darwin" && ${os.major} <= 14} {
    # Fallback to previous port version, for 10.10 and earlier
    # https://trac.macports.org/ticket/67209
    set vim_patchlevel 0472
    set port_revision  1

    checksums       rmd160  ee809eb300deaf735c86b6e5b7f4bc4a8fe79a41 \
                    sha256  7185577d6cd3708b62b2079b69a29215bb6a6048070d34e960d2d565c18b8a9b \
                    size    16851486
} else {

Hadn't noticed that you'd not reached 9.0.1910 yet. :)

comment:21 Changed 23 months ago by Thomas Nyman <thomas.nyman@…>

In 7eaf80b7b19b1b4d5b590f0854329b54c4ec6bd9/macports-ports (master):

vim, MacVim: update to vim version 9.1.0000

  • update Vim to v9.1.0000
  • update MacVim to release-179
  • remove fallback version for macOS 10.10 and earlier (#67209)

comment:22 Changed 5 months ago by i3roly

this ticket should be closed, shouldn't it?

in any case, i noticed that vim doesn't build on 10.6 so i'll try to look into it later.

it's something to do with this:

make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_vim/vim/work/vim-9.1.1128/src/po'
os_macosx.m:389:8: error: type arguments cannot be applied to non-parameterized class 'NSMutableDictionary'
static NSMutableDictionary<NSNumber*, NSSound*> *sounds_list = nil;
       ^                  ~~~~~~~~~~~~~~~~~~~~~
os_macosx.m:466:22: error: type arguments cannot be applied to non-parameterized class 'NSMutableDictionary'
            sounds_list = [[NSMutableDictionary<NSNumber*, NSSound*> alloc] init];
                            ^                  ~~~~~~~~~~~~~~~~~~~~~
os_macosx.m:468:2: error: expected method to write dictionary element not found on object of type 'NSMutableDictionary *'
        sounds_list[[NSNumber numberWithLong:sound_id]] = sound;
        ^
os_macosx.m:485:19: error: expected method to read dictionary element not found on object of type 'NSMutableDictionary *'
        NSSound *sound = sounds_list[[NSNumber numberWithLong:sound_id]];
                         ^
4 errors generated.
make[1]: *** [objects/os_macosx.o] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_editors_vim/vim/work/vim-9.1.1128/src'

comment:23 in reply to:  22 Changed 5 months ago by sevan (Sevan Janiyan)

Replying to i3roly:

this ticket should be closed, shouldn't it?

Yes.

in any case, i noticed that vim doesn't build on 10.6 so i'll try to look into it later.

it's something to do with this:

That's strange as sound support should only be enabled if you're building on 10.11 with a deployment target of 10.6 or up. Otherwise it should build without sound support. I confirmed at the time it built out of the box in 10.4 to 10.6. https://github.com/vim/vim/blob/7a734b714895df25ba7ca9996fe0cd36460923a3/src/vim.h#L182

comment:24 Changed 5 months ago by i3roly

i could build the source manually using the Xcode clang without issues.

i dunno why clang-mp-11 causes problems. i should note none of this happens on 10.7.

possibly to do with clang-mp-11 using libc++ as opposed to libstdc++ or something?

comment:25 in reply to:  24 Changed 5 months ago by sevan (Sevan Janiyan)

Replying to i3roly:

i dunno why clang-mp-11 causes problems. i should note none of this happens on 10.7.

possibly to do with clang-mp-11 using libc++ as opposed to libstdc++ or something?

The sound functionality works on 10.6 or newer but only if you're building on 10.10 (maybe 10.11) or newer. The guard assumes that you're using the native native toolchain shipped with its Xcode and states clang version 7 or newer, using clang 11 on 10.7 sort of trips that up, which is why you're having build issues.

comment:26 Changed 7 weeks ago by haihige

Cc: haihige added

comment:27 Changed 6 weeks ago by haihige

This should just be closed, since the original issue was resolved with a new release of vim.

For the Snow Leopard build error, I am going to open a pull request with vim to fix that. In the mean time, to build vim on 10.6: install the big variant instead of huge.

comment:28 in reply to:  27 ; Changed 6 weeks ago by sevan (Sevan Janiyan)

Replying to haihige:

For the Snow Leopard build error, I am going to open a pull request with vim to fix that.

The issue is not in the upstream code though, right? (it works using the stock toolchain which shipped with the xcode for the version of OS).

comment:29 in reply to:  28 ; Changed 6 weeks ago by haihige

Replying to sevan:

The issue is not in the upstream code though, right? (it works using the stock toolchain which shipped with the xcode for the version of OS).

They have discussed this in an issue: https://github.com/vim/vim/issues/17678

But it doesn't seem like anything came of it. Building with stock clang works, because it fails that check for __clang_major__ >= 7 and thus doesn't build sound.

I'm not sure why clang-11 (or clang-11 with libstdcxx, or even clang-14) from MacPorts fails, but if os_macosx.m is altered to use older syntax when building on 10.6, instead of generics and subscripting, it builds huge with sound. Alternatively, the MAC_OS_X_VERSION_MIN_REQUIRED could be increased to 1070 (as mentioned in that issue), but that would cause Snow Leopard to build without sound again.

comment:30 in reply to:  29 Changed 6 weeks ago by sevan (Sevan Janiyan)

Replying to haihige:

I'm not sure why clang-11 (or clang-11 with libstdcxx, or even clang-14) from MacPorts fails, but if os_macosx.m is altered to use older syntax when building on 10.6, instead of generics and subscripting, it builds huge with sound. Alternatively, the MAC_OS_X_VERSION_MIN_REQUIRED could be increased to 1070 (as mentioned in that issue), but that would cause Snow Leopard to build without sound again.

minimum requirement wasn't increased at the time because it is possible to target 10.6 if you are building on a new version of OS X with the native toolchain. I think it's used in the build of macvim targetting older systems.

comment:31 Changed 6 weeks ago by haihige

Here is the pull request: https://github.com/vim/vim/pull/18681

Note: See TracTickets for help on using tickets.