Broken bash command substitution

2016-11-24 Thread Tydus


Dear list,

I use Cygwin64 for a long time and everything went well. However, after 
one setup.exe update, the command substitution (`foo`) is broken on bash.


How to reproduce:
$ echo "===`echo 123`==="
===123===
$ echo "===`echo 123 | cat`==="
===123===
$ A=`echo 123`; echo "===$A==="
===123===
$ A=`echo 123 | cat`; echo "===$A===" #<-- This one breaks (returned 
empty string)

==
$ A=`echo 123 | cat`;
$ echo "===$A==="
===123===
$ A=$(echo 123 | cat); echo "===$A==="
==
$ dash
$ A=`echo 123 | cat`; echo "===$A===" #<-- Did not occur on other shells
===123===
$ exit
$ ash
$ A=`echo 123 | cat`; echo "===$A==="
===123===
$ exit
$ ssh a-linux-server
$ A=`echo 123 | cat`; echo "===$A===" #<-- Linux doesn't have problem either
===123===
$ exit

This bug also occurs on another machine (win10 x64). And chere(1) is 
influenced by the bug and rendered unusable (ver 1.4 L613: 
KEY_ELEMENTS=`echo $1 | sed "s?/? ?g"`).



Anyway the cygcheck.log is attached. Additionally cygcheck complains 
about a cygheap base mismatch. This is a new-installed windows 7 x64 and 
I double confirmed there's only one cygwin1.dll on my computer.


  2 [main] cygcheck (2556) C:\cygwin64\bin\cygcheck.exe: *** fatal 
error - cygheap base mismatch detected - 0x180302408/0x22D2408.
This problem is probably due to using incompatible versions of the 
cygwin DLL.

Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version 
*should*

reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin1.DLL.


I'm not sure if it is a bug or my configuration problem, and whether it 
is filed or not. Please help with it.



Best Regards,
Tydus

Cygwin Configuration Diagnostics
Current System Time: Thu Nov 24 03:35:56 2016

Windows 7 Professional Ver 6.1 Build 7601 Service Pack 1

Path:   C:\cygwin64\bin
C:\cygwin64\sbin
C:\cygwin64\usr\local\bin
C:\cygwin64\bin
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64
C:\Program Files\Intel\WiFi\bin
C:\Program Files\Common Files\Intel\WirelessCommon
C:\Program Files (x86)\MacType

Output from C:\cygwin64\bin\id.exe
UID: 197608(Tydus)
GID: 197121(None)
197121(None)
114(Local account and member of Administrators group)
544(Administrators)
545(Users)
4(INTERACTIVE)
66049(CONSOLE LOGON)
11(Authenticated Users)
15(This Organization)
113(Local account)
4095(CurrentSession)
66048(LOCAL)
262154(NTLM Authentication)
405504(High Mandatory Level)

SysDir: C:\Windows\system32
WinDir: C:\Windows

HOME = 'C:\cygwin64\home\Tydus'
PWD = '/home/Tydus'
USER = 'Tydus'

ALLUSERSPROFILE = 'F:\AppData\ProgramData'
APPDATA = 'C:\Users\Tydus\AppData\Roaming'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
COMPUTERNAME = 'TYDUST420S'
COMSPEC = 'C:\Windows\system32\cmd.exe'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
CommonProgramW6432 = 'C:\Program Files\Common Files'
DISPLAY = ':0'
EXECIGNORE = '*.dll'
FP_NO_HOST_CHECK = 'NO'
HOMEDRIVE = 'C:'
HOMEPATH = '\Users\Tydus'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info'
LANG = 'en_US.UTF-8'
LOCALAPPDATA = 'C:\Users\Tydus\AppData\Local'
LOGONSERVER = '\\TYDUST420S'
LS_COLORS = 
'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:

Re: python 2.7.12 pip install with extensions fails with warning: "__BSD_VISIBLE" redefined

2016-11-24 Thread Erik Bray
On Wed, Nov 23, 2016 at 4:24 AM, Jason Bell  wrote:
> Hi -
>
> The newest version of cygwin with python 2.7.12-1 fails when pip
> installing packages that require compilation.  For example, pycrypto
> fails:
>
> $ pip install pycrypto
> Collecting pycrypto
> ...
>   building 'Crypto.PublicKey._fastmath' extension
>   creating build/temp.cygwin-2.6.0-x86_64-2.7
>   creating build/temp.cygwin-2.6.0-x86_64-2.7/src
>   gcc -fno-strict-aliasing -ggdb -pipe -Wimplicit-function-declaration
> -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/build=/usr/src/debug/python-2.7.12-1
> -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/src/Python-2.7.12=/usr/src/debug/python-2.7.12-1
> -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer
> -Isrc/ -I/usr/include/ -I/usr/include/python2.7 -c src/_fastmath.c -o
> build/temp.cygwin-2.6.0-x86_64-2.7/src/_fastmath.o
>   In file included from /usr/include/python2.7/Python.h:8:0,
>from src/_fastmath.c:31:
>   /usr/include/python2.7/pyconfig.h:1221:0: warning: "__BSD_VISIBLE" redefined
>#define __BSD_VISIBLE 1
>^
>   In file included from /usr/include/sys/config.h:5:0,
>from /usr/include/_ansi.h:16,
>from /usr/include/stdio.h:29,
>from src/_fastmath.c:29:
>   /usr/include/sys/features.h:250:0: note: this is the location of the
> previous definition
>#define __BSD_VISIBLE  0
>^
>   In file included from /usr/include/python2.7/pyport.h:332:0,
>from /usr/include/python2.7/Python.h:58,
>from src/_fastmath.c:31:
>   /usr/include/sys/time.h:104:34: error: unknown type name ‘u_int’
>bintime_mul(struct bintime *_bt, u_int _x)
> ^
>   error: command 'gcc' failed with exit status 1
>
>   
>
> I can fix these errors by changing __BSD_VISIBLE from 1 to 0 in
> /usr/include/python2.7/pyconfig.h.  Here's a patch:
>
> --- pyconfig.h 2016-11-20 09:38:22.434174700 -0500
> +++ pyconfig-bsd-not-visible.h 2016-11-20 09:38:05.391993200 -0500
> @@ -1218,7 +1218,7 @@
>  #define _XOPEN_SOURCE_EXTENDED 1
>
>  /* Define on FreeBSD to activate all library features */
> -#define __BSD_VISIBLE 1
> +#define __BSD_VISIBLE 0
>
>  /* Define to 1 if type `char' is unsigned and you are not using gcc.  */
>  #ifndef __CHAR_UNSIGNED__
>
> And here's a link to a script that changes the value in one shot:
> https://gist.githubusercontent.com/thorrr/271058eeb5f1903213938f89fcbc3a73/raw/15026396047b61102826a8dd92ea591155573f1d/pyconfig-fix.sh
>
> I can confirm this makes several packages I use often work correctly
> but I don't know what the other consequences of changing this variable
> are.

FWIW this patch to pycrypto also fixes it:

https://git.sagemath.org/sage.git/tree/build/pkgs/pycrypto/patches/cygwin/disable-std-c99.patch?id=aaa9b7fc887b64ba1dba7cba16061f598a097b75

The problem only occurs when trying to build with the C99 standard if
Python itself was not.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Fullscreen application with Cygwin/X in multiwindow mode

2016-11-24 Thread Jon Turney

On 23/11/2016 17:24, David Chamberlain wrote:

I recently installed xinit and the PDF viewers Evince and Zathura. I'm
starting X via startxwin which puts it in multiwindow mode. Both of
the PDF viewers work fine, except when I press F11 to view a PDF
fullscreen, nothing changes.

Is this an inherent limitation of Cygwin/X, or a problem with my
config or these particular applications? Should it be possible to make
an X application fullscreen while running in multiwindow mode?


The multiwindow-mode window manager doesn't support or advertise support 
for _NET_WM_STATE_FULLSCREEN, so this doesn't work at the moment.


So, technically I guess this an application/toolkit problem, as it 
should notice that lack of support and e.g. grey-out the fullscreen 
option in the menu.


But ideally this would be fixed by adding support for 
_NET_WM_STATE_FULLSCREEN to the WM.


--
Jon Turney
Volunteer Cygwin/X X Server maintainer

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Broken bash command substitution

2016-11-24 Thread L. A. Walsh

Tydus wrote:


Dear list,

I use Cygwin64 for a long time and everything went well. However, after 
one setup.exe update, the command substitution (`foo`) is broken on 
bash.




You didn't specify what version of bash you are running.

Since here:


$ ssh a-linux-server
$ A=`echo 123 | cat`; echo "===$A===" #<-- Linux doesn't have problem 
either

===123===
$ exit

---
	You know that the main shell on linux is "bash".  
If it didn't happen on linux, that meant it didn't happen in

the bash on that linux.

What version of bash was it running?

Problems in bash are specific to specific versions
of bash -- so their version becomes important.  Using
"bash --version" should tell you.  If the versions are different
and the later version doesn't have your problem, something
may have changed to fix the problem.

Also, FWIW, when I try your example on cygwin, I
got:

unset A; A=`echo 123 | cat`; echo "===$A==="

===123===

I.e - it seemed to work.

Not that it makes a difference in
your test case, but I think use of backticks has been
replaced by a suggestion to use "$()", like:


unset A; A=$(echo 123|cat); echo "===$A==="

===123===

I think it was thought that "$()" hilighted
the subprocess more clearly as well as making it
more clear that the interior text is done in a 
sub process.


FYI, my bash on cygwin is:


bash --version

GNU bash, version 4.1.17(9)-release (x86_64-unknown-cygwin)



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] New: gcovr-3.3-1

2016-11-24 Thread David Stacey

The following package has been added to the Cygwin distribution:

* gcovr-3.3-1

The gcovr command provides a utility for managing the use of the GNU
gcov utility and generating summarized code coverage results. gcovr
produces either compact human-readable summary reports, machine
readable XML reports or a simple HTML summary.

Dave.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] New: ruby-puppet-lint-2.0.2-1

2016-11-24 Thread David Stacey

The following packages have been added to the Cygwin distribution:

* ruby-puppet-lint-2.0.2-1
* ruby-puppet-lint-doc-2.0.2-1

puppet-lint is a command line tool that checks your Puppet manifests
against the Puppetlabs style guide and alerts you to any discrepancies.

Dave.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] New: ruby-redcarpet-3.3.4-1

2016-11-24 Thread David Stacey

The following packages have been added to the Cygwin distribution:

* ruby-redcarpet-3.3.4-1
* ruby-redcarpet-doc-3.3.4-1

Redcarpet is a Ruby gem providing a fast, safe and extensible Markdown
to (X)HTML parser.

Dave.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple