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

Archi menu items are disabled on Mac OSX High Sierra #304

Closed
rctheinventor opened this issue Oct 26, 2017 · 35 comments
Closed

Archi menu items are disabled on Mac OSX High Sierra #304

rctheinventor opened this issue Oct 26, 2017 · 35 comments

Comments

@rctheinventor
Copy link

archi-log.txt

Version of Archi, Operating System

Archi 4.0.3, Mac OSX High Sierra 10.13.1 Beta (17B45a)

Expected Behaviour

Some of the Archi menu items should be enabled

Actual Behaviour

All Archi menu items are disabled

Steps to Reproduce the Behaviour

  1. Run Archi
  2. Open a menu from the menu bar
  3. Look at the enablement state of the menu items.

This is a known issue with Eclipse on the High Sierra betas, and there are known workarounds which work - eg remove non-English locales from Info.plist and/or run Eclipse in english. These workarounds work - I have applied these workarounds and my Eclipse menus are enabled as expected. These same workarounds don't work with Archi.

I also tried getting the code, putting that into my working Eclipse, and launching Archi from there, but the results were the same. Even thought the Eclipse menus worked, the Archi menus did not.

@Phillipus
Copy link
Member

I don't have access to the beta of High Sierra. Hopefully Apple will fix this for 10.13.1 final release. If not, then at this point I have no idea how to resolve this issue.

@Phillipus
Copy link
Member

@Phillipus
Copy link
Member

@rctheinventor
Copy link
Author

Hi Phil - those workarounds work for Eclipse, but they don't work for Archi for some reason. It's strange. Do you have any plans to upgrade the Eclipse version that Archi is using in the packaged app? It's a long shot but maybe that will help.

I tried to make my own by putting the Archi code into the latest Eclipse and then packaging/exporting Archi but I couldn't get the package/export process working.

@Phillipus
Copy link
Member

If the only fix is a backport to Eclipse 4.7.2 then I will have to think about using that for Archi (Archi uses Eclipse 4.6.3). Unfortunately, Eclipse 4.7.x breaks a number of other things on Mac, such as undo/redo and visualiser animations. It may break other stuff elsewhere too.

@rctheinventor
Copy link
Author

rctheinventor commented Oct 27, 2017

It's unfortunate that you have to juggle all these complexities between what does and doesn't work with various Eclipse version on the Mac. I'm no expert in this area at all - but I feel your pain.

It looks like the Eclipse fix is two-fold:

  1. Remove hardcoded local list from Info.plist
  2. Remove dependency on nib files (since Apple seems to be removing them from High Sierra).

It looks like the Eclipse fix will get backported into the next Eclipse 4.x release. I tried an Eclipse dev build (5.?) and it worked out of the box, so the fix addresses the Eclipse menu problem.

In the meantime, I had to do the following to get the latest Eclipse 4.x version working on my machine:

  1. Remove all locales except en from the Eclipse Info.plist CFBundleLocalizations array
  2. Update org.eclipse.swt.cocoa.macosx.x86_64_3.106.1.v20170926-0519.jar and org.eclipse.swt_3.106.1.v20170926-0519.jar in .p2/pool/plugins with patched jars taken from here http://karsten-becker.de/swt-fixed-3.106.1.v20170926-0519.zip, as described at the end of the comments in this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=520176

It's unclear at the moment whether Apple will change something between the current High Sierra beta build that I'm on - 10.13.1 Beta (17B45a) - and High Sierra GA. You would think they should - but I'm sure that there will be some changes required in Eclipse and in Eclipse-based applications like Archi (which is awesome btw, thanks).

What stresses me out more is that the same workarounds don't work with Archi, whether I run the Archi downloadable package, or I run the Archi code from my Eclipse IDE. So current evidence suggests that an Eclipse-only fix won't be enough to fix this in Archi as well.

In the meantime, my workaround is to set up a Linux VM to run Archi, because I've got an arch doc that's 75% complete that I need to get done.

I'm quite keen to have Archi work on High Sierra so if I can help with any testing or anything else, let me know.

@Phillipus
Copy link
Member

Thanks for the time put into researching this. Yes, Eclipse, Java and various OSs has always been painful. I need to understand what the issue is here. Where is the nib file?

I think the path and hacks work for Eclipse 4.7.x but perhaps not for 4.6.x which is Archi's Eclipse.

I also need to wait for 10.13.1 GA to be released officially, as I don't have the beta.

Googling this issue shows other Eclipse-based apps have the same problem.

@Phillipus
Copy link
Member

Are we clear that Archi does not have this issue on the present 10.13 GA with non-English languages? For example, see http://support.xmind.net/customer/portal/questions/17143619-no-menu-items-selectable-xmind-8-mac-os-high-sierra-gm

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

More testing on a 10.13 Mac

  • I set my 10.13 Mac to use French language and localisation.
  • Eclipse Neon (4.6.3) and Xmind (Eclipse based app) menus are disabled
  • If I remove the non-English localizations from the Info.plist file this fixes the issue
  • Archi 4.0.3 menus are not disabled, even when run from Eclipse

This is strange. Why should Archi menus be OK but not Eclipse.

But now you are saying that in 10.13.1 beta Archi 4.0.3 menus are disabled?

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

I'm wondering if it is ignoring all or part of Archi's Info.plist file for some reason. This might explain why editing it does not fix the issue in 10.13.1 beta

Edit - it's not ignoring the version number in the Info.plist file.

@Phillipus
Copy link
Member

Is it the case that Apple will be removing the nib files for 10.13.1? If so, then the Eclipse SWT nib fix will have to be applied, either from using Eclipse 4.7.2 for Archi or using the SWT files.

I still don't understand why Archi 4.0.3 menu items are OK on 10.13, but not OK on 10.13.1 beta if you edit the localisations in the Info.plist file.

@Phillipus
Copy link
Member

The latest version of XMind fixes the menu issue on 10.13. But I don't know how they fixed it, the Info.plist looks the same and still has the localisation keys, and the SWT file looks like an old one.

I'm confused.

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

I've produced an Archi.app bundle that has disabled menu items on 10.13 (French localisation). I had to move the contents around inside the Archi.app bundle to be the same as the Eclipse.app. Archi's bundle structure is different, so this may affect this bug. Also edited the file paths in Archi.ini and Info.plist to reflect this.

So at least I can reproduce it.

  • Archi 4.0.3 users on 10.13 will not be affected by the menu bug because of the way Archi is packaged
  • Archi 4.0.3 users on 10.13.1 beta are affected by the bug because of the missing nib files issue. Editing Archi's Info.plist file and/or using updated SWT files won't work because of the way Archi's app bundle is structured.

So, I think we should wait and see what happens with OS X 10.13.1 GM release. I suspect that the nib files will not be there.

I need to know how XMind fixed the issue on 10.13 without removing the localisation keys in Info.plist

@Phillipus
Copy link
Member

I need to know how XMind fixed the issue on 10.13 without removing the localisation keys in Info.plist

Answer - they ship the default english nib file with the XMind bundle. However, this is not a good solution as I don't think it works with 10.13.1

@Phillipus
Copy link
Member

Ref https://bugs.eclipse.org/bugs/show_bug.cgi?id=522690

It seems that if nib files are not going to be present in 10.13.1 then the proposed backport fix in Eclipse 4.7.2 will be required as well as an updated Info.plist file

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

I'm getting totally confused by Eclipse versions, nibs, Info.plist, etc etc....

I'll try to summarise the different permutations:

  1. Archi 4.0.3 on 10.13 is OK because Archi's bundle structure is different.
  2. Archi 4.0.3 on 10.13.1 is not OK because the nib files are missing. Replacing SWT files and/or editing the Info.plist file doesn't work because Archi's bundle structure is different.
  3. For Eclipse based apps that follow the expected bundle structure, you can either edit the Info.plist file or use the SWT files from Eclipse 4.7.1a
  4. (3) doesn't work on 10.13.1 because the nibs are missing. There will be a fix backported to Eclipse 4.7.2 for this.

Phew.

So it seems to me that Archi needs for 10.13.1 beta:

  1. To be built using Eclipse 4.7.2
  2. To use the conventional app bundle structure

@Phillipus
Copy link
Member

@rctheinventor Does this fit in with your findings?

@rctheinventor
Copy link
Author

rctheinventor commented Oct 27, 2017

Phew indeed - thanks for the research Phil.

Yes - this does fit with my findings. It makes sense that the different bundling structure is probably causing us pain, but I don't have any data/evidence to support that statement - I haven't tested other Eclipse-based applications to confirm point 3 in your last post, but I can confirm that editing the info.plist and changing the swt files doesn't fix the issue in Archi, although it fixes the issue in Eclipse.

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

@rctheinventor I've made a new Mac build that:

  1. Is built on Eclipse 4.7.1a (Oxygen)
  2. Uses a different internal bundle structure (like the one Eclipse.app uses)

It's here - https://www.archimatetool.com/dev/beta

Can you test this on the latest OS X 10.13.1 beta (I think it's beta 5 now)?

It's likely that the Archi menu items will be disabled. But you can try removing the localisation strings from the Info.plist and/or using the SWT files you mentioned earlier.

@rctheinventor
Copy link
Author

Hi Phil - sure, I can test that - I'm one beta behind latest so I need to do a backup/update first and then I'll try this and let you know how it goes.

@rctheinventor
Copy link
Author

Hi Phil - thanks for the new build - unfortunately I don't have great news. I tested this on my updated beta5 machine and I'm still seeing the same behaviour (screenshot here http://snpy.in/FlAzQb). This is after I removed the extra locals from Info.plist and verified that I'm using the patched SWT files. I also retested the following:

  1. running Eclipse - menus work
  2. running Archi from eclipse - menus don't work.

I can try running a new codebase from Eclipse if that would help - let me know if you have a branch you want me to try.

@Phillipus
Copy link
Member

Phillipus commented Oct 27, 2017

Thanks for trying it.

That's strange. The build follows the bundle folder structure of Eclipse and is built with Eclipse 4.7.1a. This means that it works OK on 10.13 but should not work on 10.13.1

  • Which version of Eclipse are you using?
  • Which language have you set OS X to?

Can you double check the patched SWT files are correct? If Eclipse is working maybe take them from its "plugins" folder

@Phillipus
Copy link
Member

Note - in the build you downloaded, the SWT jar files should be copied to:

Arch.app/Contents/Eclipse/plugins

@Phillipus
Copy link
Member

If they patched the SWT in Eclipse 4.8 recently, the SWT files will be found here:

https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/S-4.8M3-201710252000/eclipse-SDK-4.8M3-macosx-cocoa-x86_64.dmg

Files will be:

org.eclipse.swt_3.107.0.v20171025-1904.jar
org.eclipse.swt.cocoa.macosx.x86_64_3.107.0.v20171025-1904.jar

@Phillipus
Copy link
Member

One other thing to bear in mind is that Archi bundles its own Java Runtime in a "jre" folder inside Archi.app. The Archi.ini file contains a -vm setting pointing to it.

@rctheinventor
Copy link
Author

Hi Phil - good news - I removed everything and retested from scratch and now the menus are working on the latest High Sierra beta with the latest Archi beta.

I think the step that I might have missed in my initial testing was to copy the patched SWT files into the Archi.app/Contents/Eclipse/plugins folder. This is the critical step - once I did this, Archi menus worked in English, whether I modified the Info.plist file or not. I haven't tested in other languages - based on my research I think the Info.plist change will be critical for non-English. I'll try that later and let you know how it goes.

This is awesome, thanks.

@Phillipus
Copy link
Member

Thanks Ryan.

This beta build of Archi addresses the following issues

  • Uses the standard bundle structure in Archi.app
  • Uses Eclipse 4.7.1a that contains the fix for Mac OS X 10.13 (use different nib)

What is doesn't do is address the problem of no nibs. The patch will be back-ported to Eclipse 4.7.2 and should coincide with the GM of OS X 10.13.1. Once this is done I can release Archi 4.1 and this should be all sorted.

@Phillipus
Copy link
Member

MacOs 10.13.1 GA has been released today. I tried setting my OS language to French and all menu items in Eclipse and Archi are enabled. Nib files are present. @rctheinventor can you check?

@rctheinventor
Copy link
Author

Hi Phil - sure, will do. Once I've done my backup/upgrade/retest I'll let you know the results.

@rctheinventor
Copy link
Author

Hi Phil,

I tested today with Mac OS 10.13.1 GA and with the latest Archi beta. All the menu items were enabled as expected in English. I switched my system language to French and the menu items were still enabled, but for some reason, the Archi menus were showing up in English, although all other app and OS menus were showing up in French. That was unexpected.

I can retest to see if I can recreate - when you tested, did your Archi menu items show up in the expected language?

@Phillipus
Copy link
Member

Thanks for testing, Ryan.

The reason the Archi menu items are in English is you don't have a French translation pack. Someone would have to translate all strings and install this. See https://www.archimatetool.com/dev/translate-archi

@rctheinventor
Copy link
Author

Ok makes sense - I always work in English so I'm fine without the language pack, but it's good to understand how that works.

@Phillipus
Copy link
Member

Phillipus commented Nov 1, 2017

Shall we close this bug now? I think even Archi 4.0.3 is OK on 10.13.1.

@rctheinventor
Copy link
Author

Sure, we can close this, I would consider this "resolved - tested with latest Mac OS and Archi beta".

@Phillipus
Copy link
Member

It turns out that Apple reverted the problem and shipped the nib files in 10.13.1 GA after all. Nevertheless, it moved me onto using Eclipse Oxygen and making changes to the file structure of the Archi.app bundle on Mac,

Thanks for your help and reporting the issues, Ryan. Good job. :-)

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

No branches or pull requests

2 participants