Ticket #7765 (needs_review defect)

Opened 3 months ago

Last modified 11 days ago

In sage-4.3, the command "sage -bdist" is broken on OS X

Reported by: was Owned by: tbd
Priority: blocker Milestone: sage-4.3.4
Component: distribution Keywords:
Cc: GeorgSWeber Author(s): Karl-Dieter Crisman
Report Upstream: N/A Reviewer(s): William Stein
Merged in: Work issues:

Description

On OS X with sage-4.3, if you do "sage -bdist" it creates the dist/sage-* directory correctly. However, it doesn't create the dmg anymore. It can evidently be made to do so by setting environment variables. But the default "sage -bdist" doesn't create a bdist. This is confusing and very inconsistent with the behavior on all other OS's. For some reason Ivan Andrus changed this in #7546.

This will have to be fixed back for 4.3.1.

Attachments

trac_7765-dmg.patch Download (1.0 KB) - added by kcrisman 3 months ago.
Based on 4.3
trac_7765-dmg.2.patch Download (1.1 KB) - added by iandrus 11 days ago.

Change History

Changed 3 months ago by kcrisman

Based on 4.3

  Changed 3 months ago by kcrisman

  • status changed from new to needs_review

This is a very naive solution, but hopefully it is sufficient. Since I was the one who didn't realize that was changing standard behavior (in fact, I thought it was a feature!) on the previous ticket, I figure I should attempt to fix it.

follow-up: ↓ 4   Changed 6 weeks ago by was

  • status changed from needs_review to needs_work

Your patch has the line:

if [ "$SAGE_APP_DMG" = "no" ]; then 

This seems to thus bizarrely assume that SAGE_APP_DMG is either "yes" or "no". But it is an environment variable, so can be anything, and defaults to being "". Did you test the above with SAGE_APP_DMG not set?

  Changed 5 weeks ago by kcrisman

Like I said, it is a very naive solution; I never claimed to be a shell script expert :) Will do my best to make it better but am not sure when I will have time.

in reply to: ↑ 2   Changed 5 weeks ago by kcrisman

  • status changed from needs_work to needs_review
  • reviewer set to William Stein
  • author set to Karl-Dieter Crisman

Replying to was:

Your patch has the line: {{{ if [ "$SAGE_APP_DMG" = "no" ]; then }}} This seems to thus bizarrely assume that SAGE_APP_DMG is either "yes" or "no". But it is an environment variable, so can be anything, and defaults to being "". Did you test the above with SAGE_APP_DMG not set?

Well, apparently as long as you don't have SAGE_APP_DMG being 'no', it will make the dmg. At least, that's what happened when I tested this, and Sage worked. Should I change

        echo 'If you wish to create a disk image please set'
        echo 'SAGE_APP_DMG=yes'

to something about

        echo 'If you wish to create a disk image please do'
        echo 'unset SAGE_APP_DMG'

or something similar?

I just don't know what is best; since we want the default to be making a dmg, I guess any of these options make it maximally hard to *not* make a dmg, but maybe they are not very 'shell-script'-y. I'm putting this as 'needs review' again, but feel free to put it back to 'needs work' with any comments that would make it better.

  Changed 5 weeks ago by kcrisman

  • cc GeorgSWeber added

  Changed 5 weeks ago by GeorgSWeber

I'll see how much time time I find this weekend. The current situation is annoying me, too.

  Changed 5 weeks ago by GeorgSWeber

  • status changed from needs_review to needs_work

After the patch "trac_7765-dmg.patch" from seven weeks ago, the functionality is as (I think) it should be, i.e. unless an environment variable "SAGE_APP_DMG" both exists and has a value of "no", the dmg will be built. Good.

As for the documentation/printout statements, one might think of something along the following lines to be more verbose:

    if [ "$SAGE_APP_DMG" = "no" ]; then
        echo 'If you wish to create a disk image please set'
        echo 'SAGE_APP_DMG=yes'
        echo '(or to anything else but the current SAGE_APP_DMG=no,'
        echo ' or completely unset SAGE_APP_DMG)'
    else
        echo "Creating dmg"
        echo '(If you don't wish to create a disk image please set'
        echo ' SAGE_APP_DMG=no)'
        DYLD_LIBRARY_PATH=$SAGE_ORIG_DYLD_LIBRARY_PATH; export DYLD_LIBRARY_PATH
        hdiutil create -srcfolder "$TARGET" -format UDBZ "$TARGET".dmg
    fi

Could you update the patch, or should I do it (I didn't because otherwise I couldn't be the reviewer, could I)?

Changed 11 days ago by iandrus

  Changed 11 days ago by iandrus

  • status changed from needs_work to needs_review

Sorry about that, mabshoff mentioned that making a dmg should be optional since it takes so long e.g. when testing things. For some reason I took that to mean not the default. I created a new patch trac_7765-dmg.2.patch so that either of you can referee it.

Note: See TracTickets for help on using tickets.