Mac pre-release download way behind Windows version

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Mac pre-release download way behind Windows version

Postby blacey » Mon Dec 14, 2015 10:17 pm

brusk wrote: Cool, I didn't have that problem though. My problem was that NavigationToolbar2QTAgg is renamed to NavigationToolbar2Q in the latest matplotlib. Don't you get an error if you

Code: Select all

import Plot
Plot.figure("TrigonometricTest")
in FreeCAD's Python Console?
You are correct! My first approach was to install matplotlib in a virtualenv and that seemed to work but not in my local non-ve environment - I would get an error referencing a TK library in /System/Library that didn't exist. This is what now works locally, although I did not encounter the NavigationTool2QTAgg rename issue you mentioned above...

Code: Select all

pip install --install-option="--prefix=$(brew --prefix)" matplotlib==1.4.3
For libarea, I found a more recent repo on github and am building as follows:

Code: Select all

mkdir src && cd src
git clone https://github.com/Heeks/libarea.git
cd libarea
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(brew --prefix)/usr/ -DPYTHON_DIR=$(python-config --exec-prefix)/bin/ ../
make install
When I mention "local" builds - I install home-brew on a separate empty volume (e.g. 5GB RAM disk or read/write disk image), set my process search path to just use home-brew followed by /bin and /usr/bin... This allows me to tightly control the build environment, avoid polluting my system drive with home-brew and packages that I don't need for anything other than FreeCAD and finally, I can build it wall without escalated privileges (i.e. sudo).

I have modified @peterl94's travis-ci configuration file to install the proper matplotlib and also build libarea as described above but now we are fighting with a reference to a /usr/local/lib/libspatialite.5.dylib by one of the compiled objects that causes a failure when trying to make the application bundle relocatable.

Here are the specs for my latest "local" build.

Code: Select all

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6053 (Git)
Build type: Debug
Branch: master
Hash: acf3b3471135cb882ea47deda7b0b3650552826f
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
That said, the BSpline bug now blocking me... I built a debug version of FreeCAD so the symbols aren't stripped and quickly single-stepped the code to see if I can see which entity is causing the segmentation violation but I am not familiar with the code base at all so it is slow going... Perhaps one of the devs here will see something obvious in the debugger below:

Cheers,
Bruce
Attachments
FreeCADlldb.jpg
lldb debug session
FreeCADlldb.jpg (862.58 KiB) Viewed 1408 times
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Mac pre-release download way behind Windows version

Postby peterl94 » Tue Dec 15, 2015 12:05 am

I forgot to mention it in this thread. Have a look at issue #0002357. You either have compile occ with an older xcode (you can get them from the apple developer downloads), or compile the master branch. Which would probably be easier.
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: Mac pre-release download way behind Windows version

Postby sgrogan » Tue Dec 15, 2015 12:14 am

Thanks Peter and Ian :D
"fight the good fight"
User avatar
brusk
Posts: 52
Joined: Wed Feb 18, 2015 4:33 pm

Re: Mac pre-release download way behind Windows version

Postby brusk » Tue Dec 15, 2015 11:18 am

peterl94 wrote:I forgot to mention it in this thread. Have a look at issue #0002357. You either have compile occ with an older xcode (you can get them from the apple developer downloads), or compile the master branch. Which would probably be easier.
The master branch of occ, the 7.0.0 one, right?

If you did that: Did the whole self test run successfully then?

@blacey: Great work :) . So cool that we are moving closer to travis-ci builds as well :D .
jmaustpc
Posts: 10383
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Mac pre-release download way behind Windows version

Postby jmaustpc » Tue Dec 15, 2015 1:23 pm

Hi all
brusk wrote:
peterl94 wrote:I forgot to mention it in this thread. Have a look at issue #0002357. You either have compile occ with an older xcode (you can get them from the apple developer downloads), or compile the master branch. Which would probably be easier.
The master branch of occ, the 7.0.0 one, right?
I thought perhaps this topic from September on the OCE forum might be relevant

https://groups.google.com/forum/#!topic ... ekud27HPzM

they are talking about a compile problem with OCE on OSX, it seems that it compiled better in debug mode that release and then another one of them replies
24 Sep
The problem is not in OS X but in CLang compiler shipped with latest XCode
A work around is suggested.

Jim
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Mac pre-release download way behind Windows version

Postby peterl94 » Wed Dec 16, 2015 12:47 am

Yeah, that is how I found the issue on the OCC tracker. A workaround was suggested at first, but they did actually fix it by changing the references to pointers.
brusk wrote:The master branch of occ, the 7.0.0 one, right?
Yes. I admit I haven't actually tried this myself, but I'm almost certain it would work.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Mac pre-release download way behind Windows version

Postby blacey » Sun Dec 20, 2015 6:32 am

Leveraging @peterl94's and @brusks's prior art, we forged initial travis-ci Mac OS X builds for FreeCAD. What this means is that the FreeCAD Mac OS X builds should be able to maintain cadence with the Linux and Windows builds - ideally built once per day or even with each commit against the official FreeCAD github repo. While the resulting Travic-ci configuration file may seem straight-forward, we had to make numerous build configuration and test iterations to get to this point. Summary of the required changes:
  • 1. Remove GDAL if installed (a travis-ci.org nuance)
    2. Modified MakeMacAppBundleRelocatable.py to skip nonexistent dependent libraries with a warning (versus raise an exception - optional if no dangling libs)
    3. Install matplotlib using homebrew (versus pip or from source, etc.)
    4. Install libspnav
    5. Increase the git pull depth to 800 for correct version detection
    6. Modified the config to tag the deployment artifacts with the short SHA for the last FreeCAD master commit included in the build. For example, the first release is tagged 0.16_pre-d6920a0 meaning that it includes changes up through commit 0d6920a0 (use git log 0d6920a0 to review what is included in the build).
    7. Added pushover notifications to a FreeCAD Mac OS X group (see below)
    8. Convince the nice people at Travis-CI to increase the build timeout from 50 to 60 minutes so the Mac OS X builds don't timeout! They will raise the limit for the official FreeCAD repo when/if needed.

    You can download the first hot-off-Travis Mac OS X FreeCAD build here - https://github.com/bblacey/FreeCAD-MacOS-CI/releases. All built-in unit tests pass but consider this a first build that may have issues until we have completed more of the "Next Steps" below.

    Also, if you are a https://pushover.net user, you can subscribe to the FreeCAD build notices using https://pushover.net/subscribe/FreeCADT ... b3EMRd2uMZ to receive a message similar to the following for each FreeCAD Mac OS X build.
    IMG_8081.jpg
    IMG_8081.jpg (99.82 KiB) Viewed 1306 times
    Build 0.16_pre-d6920a0 "Info":

    Code: Select all

    OS: Mac OS X
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.16.6094 (Git)
    Build type: Release
    Branch: tag: 0.16_pre-d6920a0
    Hash: 262894a400cb40a75d1b38e5c0a8b5fb8d97c6a5
    Python version: 2.7.11
    Qt version: 4.8.7
    Coin version: 3.1.3
    OCC version: 6.8.0.oce-0.17
    
    Next steps:
    • 1. Code inspection by @peterl94 & @brusk to ensure integrity of the build(s)
      2. Resolve duplicate TK lib warnings.
      3. Define the steady-state w/peterl94
      4. Where to deploy? (note: I'm happy to maintain the Mac OS X CI builds if that would help).
      5. If as a "FreeCAD" fork, then define syncing strategy…
      6. Automate daily builds
      7. Consider a FreeCAD web-hook to automatically kick-off a new build for each FreeCAD main repo commit.
      8. User regression testing…
      9. Add build badges to FreeCAD or FreeCAD fork page
      10. Implement mac ports equivalent for continuous regression testing for more complete coverage
Currently we sync with the upstream official FreeCAD repo using the following:

Code: Select all

git fetch upstream
git checkout master
git merge -m "Merge upstream master into OS X CI fork [ci skip]" upstream/master
git push origin master 
git checkout travis-ci-hb
git merge master -m "Merge upstream/master into OS X CI fork travis-ci-hb"
git push origin travis-ci-hb
Is there a better way to do this?
User avatar
brusk
Posts: 52
Joined: Wed Feb 18, 2015 4:33 pm

Re: Mac pre-release download way behind Windows version

Postby brusk » Sun Dec 20, 2015 1:05 pm

Wow, amazing work, guys :D ! That is great news for CAD on Mac. As for inspecting the code I trust you completely :) . You obviously really know about this stuff. Thanks for the consideration.
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Mac pre-release download way behind Windows version

Postby peterl94 » Sun Dec 20, 2015 2:29 pm

Hey Bruce,

Have you tried running the build on your machine? I had a conflict with the Qt I have installed and the one in the bundle (both were loaded). I've had this problem before, but I don't remember what I did to fix it.

I would like to see this in master, but it would need to be merged with the linux travis.yml first. By doing this, we would have the env variable TRAVIS_OS_NAME that could be used to run different things depending on the os. It looks like we would need to run a shell script for at least the "before_install" step. If we exported a variable for each step, one script could do almost everything. For the deploy step, we could put condition: "$TRAVIS_OS_NAME = osx" in the on section.

@sgrogan, if I remember correctly, you run a scheduled script on your windows box to do the pre-releases? I assume once you push the tag, travis would deploy the mac build, so I don't think you would need to do anything different.

Thanks again Bruce, it is great to have another mac user that knows how do this stuff.

Peter
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: Mac pre-release download way behind Windows version

Postby sgrogan » Sun Dec 20, 2015 2:39 pm

peterl94 wrote:@sgrogan, if I remember correctly, you run a scheduled script on your windows box to do the pre-releases? I assume once you push the tag, travis would deploy the mac build, so I don't think you would need to do anything different.
I think we will need to let Travis-CI create the release and upload the osx artifact then I will need to get the release artifact url and upload the win artifacts there. I'm doing incremental builds so there might be a timing issue.

I think we can set up Travis to only deploy when the push is tagged. That way we could get the CI stuff for every push and pull request too! I think this would be a killer feature.

I still have trouble parsing the JSON response using curl and powershell. So now I am still uploading the artifacts manually. I have some time off work coming up, so hopefully I can solve this. I think if we can get bazaar installed in the linux travis we may be able to trigger the Ubuntu PPA automatically too.

Great job everyone. I think we are close to true automatic daily builds on Ubuntu, Windows, and OSX :D
"fight the good fight"