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

RFC: Add cygwin mintty to windows binary distribution. #12879

Closed
wants to merge 2 commits into from

Conversation

twadleigh
Copy link
Contributor

Addresses #7267.

  • Add automated download of cygwin bits to the win-extras target.
  • Copy the right bits to the staging area.
  • Create the julia shortcut that wraps mintty.
  • Verify that common workflows still work.

The contrib/windows/cygwin.sh script is minimally functional but could be robustified and possibly generalized ala winrpm.sh.

The copy step is written but I haven't tested it yet, as my environment is currently set up such that the binary-dist target is barfing before it gets to the new stuff.

The shortcuts are getting generated but they don't work unless the working directory is mintty/usr/bin as julia is looking for stty on the path. We need a workaround.

@tkelman
Copy link
Contributor

tkelman commented Aug 31, 2015

I think for the 32-bit version we also need cyggcc_s-1.dll

url=$(awk "BEGIN {RS = \"@ \"} ; \$1 == \"$f\" { print \$0 }" $local_path/setup.ini | awk '$1 == "install:" { print $2 }' - | head -1)

# determine the local filename
filename=${url##*/}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bashism, so #!/bin/bash would be a more honest shebang. A set -e early on would also be a good idea.

@tkelman tkelman added windows Affects only Windows build Build system, or building Julia or its dependencies labels Aug 31, 2015
@tkelman
Copy link
Contributor

tkelman commented Aug 31, 2015

Also needs a mention in LICENSE.md.

@ViralBShah
Copy link
Member

I have seen lots of users struggle with our Windows REPL, and this is much appreciated!

@twadleigh twadleigh force-pushed the distribute_mintty branch 3 times, most recently from 5c38e31 to 650f73e Compare August 31, 2015 21:07
@twadleigh twadleigh changed the title WIP: Add cygwin mintty to windows binary distribution. RFC: Add cygwin mintty to windows binary distribution. Aug 31, 2015
mkdir $(DESTDIR)$(prefix)/Git && \
7z x PortableGit.7z -o"$(DESTDIR)$(prefix)/Git" && \
echo "[core] eol = lf" >> "$(DESTDIR)$(prefix)/Git/etc/gitconfig" && \
sed -i "s/\bautocrlf = true$$/autocrlf = input/" "$(DESTDIR)$(prefix)/Git/etc/gitconfig" && \
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/echo.exe && \
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/printf.exe )
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/printf.exe && \
mkdir -p $(DESTDIR)$(prefix)/mintty/usr/bin && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mintty stuff gets put in its own directory because @ihnorton reported in #7267 (comment) that it was necessary that mintty exist in a usr/bin directory in order for cygwin-console-helper to do its thing (hiding the extra terminal window).

@stevengj
Copy link
Member

stevengj commented Sep 1, 2015

Test failure due to #11553.

@davidanthoff
Copy link
Contributor

Can this be made optional on Win10? The Win10 console is perfectly fine and so on Win10 I would much prefer to get the same console that I have for everything else, that is the system console.

@tkelman
Copy link
Contributor

tkelman commented Sep 1, 2015

It will always be optional by double-clicking bin/julia.exe instead of using the shortcut. I don't think it's worth too many more hurdles than that for windows 10.

@@ -87,3 +87,4 @@ Julia bundles the following external programs and libraries on some platforms:
- [GIT](http://git-scm.com/about/free-and-open-source)
- [ZLIB](http://zlib.net/zlib_license.html)
- [LIBEXPAT](http://expat.cvs.sourceforge.net/viewvc/expat/expat/README)
- [CYGWIN](https://cygwin.com/licensing.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also link to https://github.com/mintty/mintty/blob/master/LICENSE since it's somewhat separate

@stevengj
Copy link
Member

stevengj commented Sep 1, 2015

Please push a rebased version, now that 11553 is hopefully worked around.

@twadleigh
Copy link
Contributor Author

I've been dogfooding this. A couple of things have come up. For one, while the terminal is open there are apparently two mintty processes going. Not a show-stopper, but neither is it particularly intuitive.

The other, more significant, issue: when julia is running a subprocess and I type Ctrl+C, mintty exits. I would have expected control to return to the julia prompt. In the particular case of running IJulia.notebook(), interrupting it shuts down the terminal and ends the mintty and julia processes, but leaves a zombie python process running.

@twadleigh
Copy link
Contributor Author

@tkelman, to answer an earlier question of yours (on an outdated commit?), the target for a shortcut can be 259 characters: 256 characters for a path plus an additional 3 characters for the drive, I guess.

EDIT: According to SO, it is only the shell that is limited. NSIS-generated shortcuts with long paths should still work (but would just be a pain to edit).

@davidanthoff
Copy link
Contributor

I would prefer if there were two shortcuts added to the start menu, one that defaults to the standard windows console and one that runs julia in mintty. I often start julia via the startmenu, and on win10 there is really no reason to surprise users with a non-standard console experience.

@tkelman
Copy link
Contributor

tkelman commented Sep 1, 2015

People won't know the difference or recognize what mintty means. If we have 2 shortcuts, do we call them "Julia (nice terminal)" and "Julia (crappy terminal unless you're on windows 10)"? Doesn't seem worth the clutter to me.

@twadleigh
Copy link
Contributor Author

Another issue: mintty-wrapped julia doesn't play nice with PowerShell, at least as far as using it for BinDeps downloads is concerned.

@twadleigh
Copy link
Contributor Author

@davidanthoff @tkelman : we could be more diplomatic and call them "Julia" and "Julia (classic)" 😃

@tkelman
Copy link
Contributor

tkelman commented Sep 1, 2015

or "basic," like there used to be with the old readline repl

@twadleigh
Copy link
Contributor Author

Googling suggests the Ctrl-C issues with mintty aren't isolated to running julia within. I've seen a few posts with years-old dates, and none that suggest the problem has been identified in mintty. I've seen a couple of posts that suggest using trap in some way as a workaround. I did some experimenting with it, but didn't come up with anything effective.

@tkelman
Copy link
Contributor

tkelman commented Sep 20, 2015

We could open an issue at https://github.com/mintty/mintty if you can reproduce this with some simple small program. mintty is being actively developed recently so there's a chance we would have more luck this time identifying the problem or workarounds here.

@twadleigh
Copy link
Contributor Author

Figured I'd post an update on this just to show I haven't completely abandoned this thread. Sometime last week I tried to see if I could reproduce the signal handling issue with a program simpler than julia. Didn't make any headway. The Ctrl-C behavior seemed to be correctly handled for my dummy exe.

@tkelman
Copy link
Contributor

tkelman commented Nov 11, 2015

It's worth noting that release-0.4 is using git 2.x for 0.4.1, which seems to be working fine so far. Unless anyone reports any Pkg issues with the newer version of Git, we could add a julia-mintty shortcut specifically for the release-0.4 branch. This PR is still worth pursuing independently since master will stop bundling command line git before 0.5.0.

@twadleigh twadleigh closed this Aug 14, 2016
@tkelman
Copy link
Contributor

tkelman commented Aug 14, 2016

Did we ever track down what was wrong with the bindeps powershell download? This is still worth doing.

@twadleigh
Copy link
Contributor Author

I never got further with it and haven't looked at for a year and a half. I ran out of ideas and turned my attention to some hacks to make life more palatable while living in the standard command window. #12754 lets me make the colors less annoying, and I've learned a registry hack to add DejaVu Sans Mono as a terminal font. Those were my two primary motivations for following this thread. I've been living with the standard command window since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system, or building Julia or its dependencies windows Affects only Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants