#29371 closed enhancement (fixed)

little tweak in mac-app

Reported by: chapoton Owned by:
Priority: major Milestone: sage-9.1
Component: scripts Keywords: macOS, app
Cc: dimpase, gh-maverickwoo, gh-Shlokatadistance, iandrus, slelievre, vbraun Merged in:
Authors: Frédéric Chapoton Reviewers: John Palmieri, Torakozo Kariya
Report Upstream: N/A Work issues:
Branch: 043f10e (Commits, GitHub, GitLab) Commit: 043f10e821073ab47e1056b921dc30165f592124
Dependencies: Stopgaps:

Status badges

Change History (19)

comment:1 Changed 19 months ago by chapoton

  • Branch set to u/chapoton/29371
  • Cc dimpase added
  • Commit set to 043f10e821073ab47e1056b921dc30165f592124
  • Status changed from new to needs_review

New commits:

043f10elittle tweak in mac-app (about grep options)

comment:2 Changed 19 months ago by jhpalmieri

I don't know how to test this because I can't produce a functioning app with or without this patch.

comment:3 Changed 19 months ago by chapoton

Well, this seems to be innocuous enough.

The proposer on sage-support could be the reviewer, but I cannot answer him there.

comment:4 Changed 19 months ago by dimpase

  • Cc vbraun added

Perhaps Volker can review it.

comment:5 Changed 19 months ago by slelievre

  • Cc gh-maverickwoo gh-Shlokatadistance iandrus slelievre added
  • Description modified (diff)
  • Keywords macOS app added

Cc a few extra "macOS" people.

comment:6 Changed 19 months ago by gh-Shlokatadistance

Hello, following the discussion from https://groups.google.com/forum/#!topic/sage-support/gf0aR8b_vk0, I had reported this previously about how it was breaking from the paths. it worked once with a temporary fix and the second time when I granted complete permissions to sagemath. I am however skeptical of the latter because it was rather odd for an application explicitly needing complete and direct drive access

Last edited 19 months ago by gh-Shlokatadistance (previous) (diff)

comment:7 Changed 19 months ago by gh-rana-aerea

Thank you for accepting my proposal. I managed to compile sage-9.0 + sag-9.0/src/mac-app and the version with the proposal it took 6 hours. I tested running the both version. The older version is slightly slower. Alternatively, I tested the code of pipes.

myhome$ cat sage.log | grep -i --context 1 'Notebook is running at' | grep --line-buffered -o -e "http://.*" 
grep: Notebook is running at: No such file or directory 
myhome$ cat sage.log | grep -i --line-buffered --context=1 'Notebook is running at' | grep --line-buffered -o -e "http://.*"  
..... 
http://localhost:8888/?token=XXX...X

The previous code is an error and the proposal detects the address. (ticket being hidden by XXX...X.

I compare two versions in new local account.

comment:8 Changed 19 months ago by gh-maverickwoo

Sorry, this was my fault in #28661. On my Mac, I use GNU grep and I forgot about that when testing that revision. I confirm the equal sign in --context=1 is indeed required. My apologies!

However, I am not sure why --line-buffered is needed here even though having it shouldn't break things.

comment:9 Changed 19 months ago by chapoton

so, who will dare to give a positive review, ladies and gentlemen ?

comment:10 Changed 19 months ago by gh-rana-aerea

I am working on it.

My trial:

Step 1. Create a new account where no initialization is done for Jupyter.

Step 2. Copy updated SageMath-9.0 and reference version (original SageMath-9.0) to some location accessible to the new account.

Step 3. Compare the two versions in new account.

Current Status: The two versions I compiled both have absolute pathnames somewhere in them.

Copying SageMath-9.0.app from the disk image did not change this situation.

The problem is that the path (in bash script and somewhere I do not know)) points to the same new version. (!echo in Jupyter notebook shows missing of subdirectory of build directory and the subdirectory of the copied application.)

I will make two copies of the source tree of Sagemath and compile them again. I think I can make some part of the comparison. But I am afraid my environment differs from the user's environment.

If someone tells me how to make a relocatable copy of SageMath-9.0 or SageMath-9.1 and make a packages which resemble the distribution, I can do a better test.

Partial Information I got so far:

Original SageMath-9.0 has a incompatibility problem with insertion of new debugging messages. Indeed, it was unable to invoke jupyter server when I inserted two or three instances of echo commands.

# @rana-aerea
# debugging code
echo >&2 -e "PATH=$PATH" ;
# echo >&2 -e "SAGE_ROOT=$SAGE_ROOT" ;
echo >&2 -e "CWD=`pwd`" ;

(I have no intension to include the three debugging messages in the distribution.)

Another observation is the log file misses all messages after the first one of these debugging information.

Right now, coping of the updated version from the disk image finished. I added the same three commands of echo to SageMath-9.0/sage. I activated the second one, too. I double clicked this version. In sage.log, I found the path, the SAGE_ROOT and the current working directory and more messages. This is a side evidence of some function of the option "--line buffered". I do not see version information of sage itself.

I continue my test. I think I can report the result in 24 hours.

comment:11 Changed 19 months ago by dimpase

binary distributions of Sage are made using https://github.com/sagemath/binary-pkg

comment:12 Changed 19 months ago by gh-rana-aerea

Step 1: Delete sage.log Step 2: Invoke two copies one at a time. Open a Jupiter notebook and shutdown the kernel. Then view log. (Guest account and the account of compilation.)

Result: In both accounts, the comparison has the same conclusion. The original version printed only one line of message in the sage.log. The updated version printed several messages until the last message complaining kernel not found.

The conclusion of the review is "go".

Thank you for the message on binary distributions. I will study it and solve the problem of signature.

comment:13 Changed 19 months ago by chapoton

if you agree with the ticket, you should set the status to "Positive Review" and put your real name in the "Author" box of the ticket (use the Modify ticket button)

comment:14 Changed 19 months ago by chapoton

so nobody dares to give a positive review ? Damn...

comment:15 Changed 19 months ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_review to positive_review

Okay, fine.

comment:16 Changed 19 months ago by gh-rana-aerea

I apologize for very slow response. I succeeded in compiling relocatable version of Sagemath. The next thing I must do is to reflect the change in relocatable version.

comment:17 Changed 19 months ago by gh-rana-aerea

I manage to produce disk-image-file of SageMath-9.1beta9 with the proposed code of this ticket. The resulting program solves the first bug reported in sage-support group "Sage 9.0 macOS Jupyter Server failed to start" ( https://groups.google.com/forum/#!topic/sage-support/gf0aR8b_vk0 ).

The bug was this: the pipes "sage ... | tee ... | grep ... | grep ... " got stuck after the second last stage of pipes terminated by error. This caused tee to terminate. The termination occurred when the buffer was full. Then, the first stage also terminated in a way we cannot understand form the source code of the bash script sage.

If someone is aware of suppressing logs for saving Mac application from strange failure, I ask him/her/them to enable logging.

comment:18 Changed 19 months ago by gh-rana-aerea

  • Reviewers changed from John Palmieri to John Palmieri, Torakozo Kariya

The update now fixes the bug reported by Dr. Murray Eisenberg in "Sage 9.0 macOS Jupyter Server failed to start" ( https://groups.google.com/forum/#!topic/sage-support/gf0aR8b_vk0 ).

comment:19 Changed 19 months ago by vbraun

  • Branch changed from u/chapoton/29371 to 043f10e821073ab47e1056b921dc30165f592124
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.