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

Mac build #289

Closed
dangayle opened this issue May 8, 2015 · 50 comments
Closed

Mac build #289

dangayle opened this issue May 8, 2015 · 50 comments
Labels
macOS Mac-specific issue

Comments

@dangayle
Copy link

dangayle commented May 8, 2015

Hi. I'm a python developer on a mac. Might not be too helpful in developing out the whole shebang, but I'd be willing to help out with your build stuff. Let me know what I can do.

@DarkFenX
Copy link
Member

Sorry for MIAing (was busy with various IRL activities, which can devour me again).

I will redirect to this issue other people trying to help with mac skeleton (with the hope at least one will succeed :] )

First off, you need to be able to run pyfa from source. Use following:

As source - wx3 branch of https://github.com/DarkFenX/Pyfa.git
As environment:

  • Python 2.7.9 (if differs, tell me which one do you have - IIRC macs come with py2.7 bundled with OS)
  • wxPython 3.0.2.0 (wxPython3.0-osx-cocoa-py2.7 at http://www.wxpython.org/download.php#osx)
  • Latest stable sqlalchemy (1.0.3 atm)
  • dateutil
  • Matplotlib with dependencies

wxPython is installed via linked distribution, other libs - either via pip (howto here https://docs.python.org/2.7/installing/) or via downloading source and running python setup.py install. Once you get it running, we'll try to make binary distributive. If you run into any issues - write here, most likely me or someone else will be able to help.

@Kukkimonsuta
Copy link

Aside from some graphical glitches, things seem to work (python 2.7.6)

screenshot 2015-05-18 11 18 43

@DarkFenX
Copy link
Member

Can you upload same screenshot, made with master branch? I want to see how graphics/fons/paddings changed.

Just use latest stable build for it.

@Kukkimonsuta
Copy link

screenshot 2015-05-18 11 35 20

@DarkFenX
Copy link
Member

Looks buggy, but i assume these fixes should be made on pyfa side rather than mac skeleton (i'd prefer to wait for Blitzmann to work with these), so we can proceed.

Install latest cx_Freeze (http://cx-freeze.sourceforge.net/). I am unsure how exactly i've been installing it, via pip or source code. Using python 2.7.9 and newer, you might try python -m pip install cx_Freeze. If it fails, do regular python setup.py install from source.

After you install it, try executing following (wx3 branch, pyfa root folder):
python setup.py build
python setup.py bdist_mac
python setup.py bdist_dmg

I want to know which of these succeeds, and which actually work from build folder (or wherever you place the build).

@DarkFenX
Copy link
Member

Does 1st build launch (if you have 2nd mac without pyfa's environment inbstalled - use it)?

Upload it somewhere too, please.

I'll try work around issues for 2nd and 3rd later this week.

@Kukkimonsuta
Copy link

Doesn't run on my machine, don't have another available.

https://dl.dropboxusercontent.com/u/1799304/pyfa/exe.macosx-10.10-intel-2.7.zip

@blitzmann
Copy link
Collaborator

@Kukkimonsuta I love you. It's so nice to have a mac guy that knows their way around. =)

I'm still away on holiday, so I will not be able to look into this atm. Even so, I run os x on a slow VM, so it's difficult to do any real work on it.

The black graphical glitch has been known, and I believe it's occurred on wx2.8 on windows 7 or 8 for at least one person. I remember linux having the issue for wx3 (but not windows, unsure about mac), and I remember fixing it like a year ago but lost that repo without ever pushing it to remote. It was a simple fix such as adding 24 as a bitmask to bitmaps that were created, I'll have to look into it again. commit 7db13bd seems to have fixed some error with chrome tabs, but I'm not sure what the before / after is.

@DarkFenX
Copy link
Member

Try launching from terminal (http://macosx.com/threads/how-to-launch-application-from-terminal.29520/ open /path/to/some.app), is anything printed to it on failing run?

@Kukkimonsuta
Copy link

LSOpenURLsWithRole() failed with error -10810 for the file /Users/lukas/Documents/Projects/pyfa/build/pyfa.app.

@blitzmann
Copy link
Collaborator

@Kukkimonsuta
Copy link

Tried chmod +x - no change.

Running pyfa.app/Contents/MacOS/pyfa works however.

The bundle: https://dl.dropboxusercontent.com/u/1799304/pyfa/pyfa.zip

@blitzmann
Copy link
Collaborator

@dangayle @Kukkimonsuta :

Can you try the latest wx3 branch and confirm some things? I'm still trying to figure out the black tabs, but I want you to try some of the stuff mentioned here: #306

@dangayle
Copy link
Author

I tried getting wx3 installed on my machine, ran into a glut of problems.

On Thu, Jun 25, 2015 at 2:41 PM, Ryan Holmes notifications@github.com
wrote:

@dangayle https://github.com/dangayle @Kukkimonsuta
https://github.com/Kukkimonsuta :

Can you try the latest wx3 branch and confirm some things? I'm still
trying to figure out the black tabs, but I want you to try some of the
stuff mentioned here: #306 #306


Reply to this email directly or view it on GitHub
#289 (comment).

@blitzmann
Copy link
Collaborator

I was able to just download the package from wxpython.org and it seemed to install and run correctly. I do hope that you get it to work.

I'm currently in the process of installing Yosemite on a VM - maybe I can install it on a secondary partition to ease development (development currently slowed by low resolution in virtualbox and sluggishness of OS, both due to virtualization)

@blitzmann
Copy link
Collaborator

Can you guys take a look at #316? Try to run python from the interpreter. My VM is being slow and buggy and I don't trust it.

@blitzmann
Copy link
Collaborator

@dangayle @Kukkimonsuta it seems we are now using a sqlalchemy feature that isn't part of the current skeleton that we package with, and it's causing v1.13 to crash. Can you look into a way to package pyfa for the mac? It doesn't have to include wx3, we just need a new way to do it asap

@blitzmann blitzmann mentioned this issue Jul 9, 2015
@Kukkimonsuta
Copy link

@blitzmann Tried latest wx3 branch, just ran from command line python ./pyfa.py. Application starts and works right until it checks for updates as far as I can test. Then the "update available" windows shows up and the app acts like modal is open even though I close the update window (can't select anything, on click I get the "blocked" sound, hover effects surprisingly work though.)

@blitzmann
Copy link
Collaborator

I finally got a proper mackintosh going running Yosemite on a different drive. Can finally use more than 1024x768. still have to install needed software, but this makes it much easier debugging os x

@blitzmann
Copy link
Collaborator

@Kukkimonsuta @dangayle

I believe I have fixed most OS X issues, the most recent being modal dialogs hanging the entire program. It should run without issues with wxPython 3.0. Please update your repo to the latest master and test. Also test with -w which will force it down to wxPython 2.8.

It would also be great if someone could continue trying to get a working build going for wxPython 3.0, one that does not package pyfa into a single executable. @Kukkimonsuta, the package that you made #289 (comment) seems like it would work well if it was updated to wxPython 3.0 and once we figure out how to get it to run properly without explicitly running the executible.

edit: to get the setup script to work, you may have to add 'imgs' to the packages list to include the icons directory (or simply copy it over later).

@blitzmann
Copy link
Collaborator

I have a working mac package now and have updated the pyfa-skel repo as well as the dist.py script to support it \o/. Gonna close this issue

@blitzmann
Copy link
Collaborator

Gonna reopen this to use as a mailing list for those that want to test new builds on osx. Also, some problems have been reported on the new wx3 build, so this would be a good place to continue them.

@blitzmann blitzmann reopened this Nov 5, 2015
@noenedrops
Copy link

Subscribing to future notifications. o7

@dangayle
Copy link
Author

dangayle commented Nov 5, 2015

Man, I'd love to build this, but every time I try to install wxPython I end up with either this bug:
or this nice bug:

I can't win.

@blitzmann
Copy link
Collaborator

@dangayle I remember having the first issue of the package being corrupted, it has to do with the way it's packaged. I don't remember exactly how I fixed it, but take a look here:

http://stackoverflow.com/questions/21223717/install-wxpython-on-mac-os-mavericks

http://stackoverflow.com/questions/16638977/trying-to-install-wxpython-on-mac-osx

Please report back and let me know how it works

@thorr18
Copy link

thorr18 commented Nov 10, 2015

o7

I had trouble running it on some IDEs, but eventually tried it on PyCharm and was able to run.

I added 'Requests' to the Wiki list of modules, but I think CX-freeze should be there too.

Successfully was able to run setup.py build.

Not able to run setup.py bdist_dmg:
error: error in setup script: command 'bdist_dmg' has no such option 'applications-shortcut'

Successfully able to run setup.py bdist_mac
However, I might have some kind of permission problems or something with the package it produces because it doesn't run.
Also, there is not an info.py in the root of the built package, which is present in the downloaded package.
The rest of the package contents are different than the downloaded package also, so I'm unsure how I'm supposed to be generating something to match the standard release.

@blitzmann
Copy link
Collaborator

Ah, I should have mentioned this a while ago. I ditched cx_Freeze on mac because I couldn't get it to compile right (as you stated, I figured it was permissions problems as well). I'm currently using py2app which is how the old binaries were packaged. I need to fix up the setup.py and add it to the repo

The info.py is a file that we add just to help out with the release building script. It's not needed by pyfa proper nor is it created by the freezing app.

@thorr18
Copy link

thorr18 commented Nov 12, 2015

Thanks for clearing that up. I look forward to trying the build after the repo is updated.

@blitzmann
Copy link
Collaborator

Can other mac guys take a look here and see if prices are updating for you all? #410

@thorr18
Copy link

thorr18 commented Nov 17, 2015

I wonder if it matters what version py2app is run on to produce some of these discrepancies. You shouldn't have to go back and build under 10.9 just to discover missing imports and such for people trying to run on that platform,...right?

@blitzmann
Copy link
Collaborator

Well, I have been reading a few things that concern me, specifically from the pyinstaller documents (which we don't use, but I may look into it further): https://pythonhosted.org/PyInstaller/#making-mac-os-x-apps-forward-compatible

Basically, if I build on 10.10, there's no guarantee it will work on versions earlier than that, which is something I did not think about. I believe the original mac build was build on either 10.6 or 10.7 (back in July 2010). It shows here that we have a lot of users still on 10.7, so I'm hoping to figure out a way to install that version and rebuild. It will take some time though, considering how much of a bitch it was to get my current setup going.

@simonszu
Copy link

o7 to subscribe to this thread. I own an iMac and a MacBook running El Capitan. I am no pythonista, since i chose Ruby back then, but i think i can figure out a way to test stuff - shouldn't be too hard.

@blitzmann
Copy link
Collaborator

I have a working 10.7.3 VM now.

My plan of action is to get a dev environment going on 10.7 and hopefully build new binaries on this version. From what I've read previously, builds should be forward compatible, just not backwards compatible (which explains a lot of our issues with 10.7 and 10.9 considering I built wx3 build on 10.10). I will also try to find 10.8 and 10.9 to install to VMs for testing builds as well, but will also need to depend on you guys to help once I get an updated build. =)

@blitzmann
Copy link
Collaborator

Hi guys,

I have a new build ready for testing: http://eve-files.com/dl/275948

It was built in 10.7.5, and it works so far with the little testing I have given it on 10.7 and 10.10. I need anyone with a mac to post current OSX version and test result - does pyfa start? Do you notice any crashes? (there is a known crash with right click menu: #424) Do you notice any slowdown? I'm specifically looking to solve #437 (seems to affect 10.7 users) and #395 (seems to affect 10.9 users) with this build, but I would enjoy feedback from all our mac users about potential problems.

If you are experiencing crashes, please check the console output. You can also run with debug messaging with pyfa.app/Contents/MacOS/pyfa -d.


Notes on testing results with this build:

  • 10.7 - Runs
    • CoreGraphics error prevents startup - OSX 10.7 #437 fixed by this build (startup is no longer prevented by linking crash)
    • Verified working on blitzmann's VM and @SuperiorMonkey. Graphing window is slow to initially load. Possible bug with GUI drawing causing some elements to stretch out of place (I have not been able to reproduce)
  • 10.8 - Currently unknown
  • 10.9 - Runs
  • 10.10 - Runs
    • Verified by blitzmann's 10.10 dev Hackintosh and @thorr18
  • 10.11 - Currently unknown

@SuperiorMonkey
Copy link

#437 is my ticket, which is specifically a problem with the CoreGraphics framework being in a different location for 10.7 than for 10.8 and higher. Supposedly fixable with options to the compiler telling it to look in both locations for the framework, so it should not be necessary for the final release to have a separate version to fix it.

I downloaded the test build linked above, and it works! And there was much rejoicing.
Two minor complaints though. The first is that upon first startup, the rightmost column draws improperly. The stuff on the right side, like EHP numbers and hull repair speed, is pushed out of the window and inaccessible. Easy enough workaround though, resizing the window causes it to reset into its space properly. The other complaint is that it doesn't appear to be remembering the screen location upon restart, it spawns with the tricolor buttons about 100 pixels down and 150 to the right of where I placed it before (upper left corner). I have not tested the Crest linkage, but my fits and character stuff is all updating normally.

@SuperiorMonkey
Copy link

Also there is one odd slowdown I noticed. When I first opened the Graph window, it took a long time to load. Over 15 seconds at least, and the whole time it was hammering the drive. Would be nice if that could be trimmed down… I mean my Eve client loads almost as fast as that.

@thorr18
Copy link

thorr18 commented Nov 22, 2015

Launched on 10.11.1 Didn't see new crashes or issues yet. Crest stuff is working.

  • Opens hidden, until relaunched (non-wx3 build does not have this issue)
  • Slow choppy animation of the metric bars. (Non-wx3 animates fast. )
  • Not having any issue with price loading. Able to reset price cache. (Usually I have to open non-Wx3 to get any prices)
  • The 2nd-right-click crash is still present.
  • Slow tooltips. (Non-wx3 tooltips pop up fast.)
  • Still forgets window position (Non-wx3 preserves position, unless maximized. )
  • Has the beautiful module name font that some find too small (not the ugly non-wx3 module name font)
  • Didn't see any slow-down opening the graph window. Takes about a half second.

@blitzmann
Copy link
Collaborator

@SuperiorMonkey can you list off some references that you found about the compiler options? I am not sure where this comes into play, as py2app should do everything automatically.

But the fact that it more or less works is great. Screenshots would be helpful for the graphical glitches you are experiencing, and I can't think off the top of my head what the problem may be.

Also, if this build works with all versions, I won't have a separate download or anything. I'll just use this build in the future.

Also, I did not test the graphs at all. Thanks for the info.

@blitzmann
Copy link
Collaborator

Also, here's the setup file that I use to build the binaries. Note that this isn't what is used to generate the regular distributable, but rather what is used to generate the binaries. But there's only minor differences. py2app is required:

https://gist.github.com/blitzmann/7e9fc1da767431bc108d

@unpoetical
Copy link

Could you walk me through the steps to create a mac redistributable release? I'd like to look into the issues with compiled builds as reported in #456 and #481. FYI, just launching the app from a terminal window instead of the finder fixes the hanging import issue.

I've done the python ./setup-osx.py py2app mentioned in the last post - and now I have some .pyc files. Then maybe python setup.py bdist_mac, but I think this rebuilds things. It also generates an app that crashes, with a lot of errors like these. I'm not sure why 3.0.0.2.0 and 3.0 are thought of as different libraries, on my system they're file copies not soft or hard links.

 objc[57060]: Class wxNSWindow is implemented in both ./build/pyfa.app/Contents/MacOS/./libwx_osx_cocoau_core-3.0.0.2.0.dylib and ./build/pyfa.app/Contents/MacOS/./libwx_osx_cocoau_core-3.0.dylib. One of the two will be used. Which one is undefined.

@unpoetical
Copy link

FYI, movie of slow/choppy animation reported by @thorr18. Takes 17s to complete animation clicking on two ship names.

QT slow-animations.mov.zip

UPDATE: Toggling the resistances pane closed makes the power/cpu animation run at a reasonable speed.

@blitzmann
Copy link
Collaborator

@unpoetical which version of OSX are you using?

The problem with building the mac distributives is that it's very finicky. I've learned that they are not backward compatible, so any build made for the masses must be built on an older OSX version (the builds that I have been making are on 10.7.5). See previous comments in this thread, #437, and #395 for references.

That being said, on my 10.7.5 dev environment I'm able to run python setup-osx.py py2app and get an app in the dist directory that works out of the box. I have not tried recently with a more modern OSX version, so YMMV. Don't worry about setup.py even though it has mac options in it - they don't work.

Does the choppy and slow animation happen when running via terminal as well? This is something that has so fark only been reported for 10.11, which I do not have to test with.

@blitzmann
Copy link
Collaborator

I have also been thinking about downgrading my py2app version to what pyfa used before, as I am thinking that some of the problems (specifically when launched via app launcher vs terminal) are related to py2app bugs (but these could also be upgraded wxPython bugs). Who knows. I'm honestly afraid of touching my dev machine for fear that everything will break, hence why I haven't made progress on that front lol

@SuperiorMonkey
Copy link

1.17.1, the misdrawn right-hand column issue is still around. This time I got a screenshot.
http://i.imgur.com/ISANdoK.png
Slightly different this time though, the screen was drawn correctly with the Resources section closed. The sizing error occurred when I opened that section.
Oh, and I looked around for information on how to set multiple library paths in python, but couldn't get anything very specific. Python seems to have multiple places that control various path locations, like sys.path, pythonpath, etc. All I can suggest there is asking someplace that's frequented by Mac python professionals, it does seem like a library path location should be something that python can handle. A thing called "install name tool"? I've never touched python, sorry. :|

Oh, one little detail that might be coming into play with the py2app and binary issues. Found references to binary builds using something called "readline" versus "editline". Possible you've hit an edge case there.

@unpoetical
Copy link

The animation slowness is there even when running from the command line without explicitly precompiling (i.e. no py2app effects). I'm running straight from git sources [8e28925] on OSX 10.11.2. My wx (3.0.2.0) & python (2.7.1) are the current packages from homebrew. Other stuff is whatever version pip found.

p.s. I had to pip install EVE pycrest to compile and run. These dependencies weren't mentioned in any of the dev wiki pages or README.md and they should be. Maybe only pycrest is required?

@unpoetical
Copy link

I missed the ./dist dir where the app gets built. In that directory there is a pyfa.app that I can launch from the finder or terminal. Launching either way, I can import the xml fitting files fine. I used py2app 0.9 to create the app.

@blitzmann
Copy link
Collaborator

@SuperiorMonkey Please open an issue with the drawing bug. Include picture, and if you can figure out reproduction steps for it.

@unpoetical pyfa uses a modified pycrest that is included with the pyfa source, so you shouldn't have to install pycrest through pip. perhaps you were simply missing a dependency that the pycrest package pulls in when you install it separately? I dunno...

@blitzmann
Copy link
Collaborator

Can I get anyone using 10.11 to confirm this issue: #453? I cannot reproduce on 10.10

@blitzmann blitzmann added the macOS Mac-specific issue label Sep 23, 2016
@blitzmann
Copy link
Collaborator

Closing this thread due to inactivity. Thanks to everyone who helped out with testing the wx3 builds!

With pyfa 2.x, we've moved to wxPython 4.0, exciting! If you have any concerns with the current builds, please open a new issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Mac-specific issue
Projects
None yet
Development

No branches or pull requests

9 participants