public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How do start a cygwin shell session from a script ?
@ 2014-05-12 11:35 Timothy Madden
  2014-05-12 19:39 ` Larry Hall (Cygwin)
  2014-05-13 11:49 ` Timothy Madden
  0 siblings, 2 replies; 4+ messages in thread
From: Timothy Madden @ 2014-05-12 11:35 UTC (permalink / raw)
  To: cygwin

Hello

I have a CMake build script for my application, that among other
things tries to build libvpx (open-source video codec, see
webmproject.org).

libvpx library v1.3.0 compiles fine by hand when I open a cygwin
terminal from the Windows start menu and type in the needed
`configure`; `make` and `make install` commands.

But when I try to invoke the cygwin shell from my build script, to run
the same 3 commands with the -lc option to sh.exe (same command line),
something happens and the build commands no longer work like in the
real mintty terminal. Then my build fails.

I believe there is something in the cygwin shell session or
environment that I do not know how to set right when invoking
$(CYGWIN_DIR)/bin/sh from my CMake script.

Is there a way for me to start a cygwin shell session from the build
script, that is identical to the one that opens in the mintty terminal
from the start menu, and run some commands there ?

I checked the environment variables and umask in the mintty terminal
and in a /bin/sh session that I launch, they are the same in both
cases. I tried using /bin/sh, /bin/bash, /bin/dash, with both --login
and -c options. But the automated build always fails, and the manual
build works.

Thank you,
Timothy Madden

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do start a cygwin shell session from a script ?
  2014-05-12 11:35 How do start a cygwin shell session from a script ? Timothy Madden
@ 2014-05-12 19:39 ` Larry Hall (Cygwin)
  2014-05-13 11:49 ` Timothy Madden
  1 sibling, 0 replies; 4+ messages in thread
From: Larry Hall (Cygwin) @ 2014-05-12 19:39 UTC (permalink / raw)
  To: cygwin

On 05/12/2014 06:12 AM, Timothy Madden wrote:
> Hello
>
> I have a CMake build script for my application, that among other
> things tries to build libvpx (open-source video codec, see
> webmproject.org).
>
> libvpx library v1.3.0 compiles fine by hand when I open a cygwin
> terminal from the Windows start menu and type in the needed
> `configure`; `make` and `make install` commands.
>
> But when I try to invoke the cygwin shell from my build script, to run
> the same 3 commands with the -lc option to sh.exe (same command line),
> something happens and the build commands no longer work like in the
> real mintty terminal. Then my build fails.
>
> I believe there is something in the cygwin shell session or
> environment that I do not know how to set right when invoking
> $(CYGWIN_DIR)/bin/sh from my CMake script.
>
> Is there a way for me to start a cygwin shell session from the build
> script, that is identical to the one that opens in the mintty terminal
> from the start menu, and run some commands there ?
>
> I checked the environment variables and umask in the mintty terminal
> and in a /bin/sh session that I launch, they are the same in both
> cases. I tried using /bin/sh, /bin/bash, /bin/dash, with both --login
> and -c options. But the automated build always fails, and the manual
> build works.

What's the error and from where?

I think you are on the right track to look at environment differences.
If you're sure there are no longer any differences between the sessions
invoked through CMake and manually, I'd suspect something surrounding
CMake.  Do you have the same problem using Cygwin's CMake?


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do start a cygwin shell session from a script ?
  2014-05-12 11:35 How do start a cygwin shell session from a script ? Timothy Madden
  2014-05-12 19:39 ` Larry Hall (Cygwin)
@ 2014-05-13 11:49 ` Timothy Madden
  2014-05-13 15:32   ` Larry Hall (Cygwin)
  1 sibling, 1 reply; 4+ messages in thread
From: Timothy Madden @ 2014-05-13 11:49 UTC (permalink / raw)
  To: cygwin

It appears I found my missing shell session settings: the access
rights on the current build and source directories.

The manual build was always run within the user home directory in
cygwin, and cygwin could see the proper access right on all the files
used in the build.

But outside the user home directory, cygwin no longer sees the proper
permissions for directories and files, even though the user running
the cygwin session can very well read and write the files. But cygwin
will list the files with no permissions whatsoever, not even u+r (read
access for the file owner). If I use the Windows `icacls` command to
explicitly add the current user to the ACL on the directory with
inheritable (recursive) "full control" access right, than cygwin can
see the proper access rights too for such directories.

Can this issue maybe be fixed, so cygwin sees the same permissions, on
any files, user that Windows will grant to the current user ?

Thank you,
Timothy Madden

On Mon, May 12, 2014 at 1:12 PM, Timothy Madden <terminatorul@gmail.com> wrote:
> Hello
>
> I have a CMake build script for my application, that among other
> things tries to build libvpx (open-source video codec, see
> webmproject.org).
>
> libvpx library v1.3.0 compiles fine by hand when I open a cygwin
> terminal from the Windows start menu and type in the needed
> `configure`; `make` and `make install` commands.
>
> But when I try to invoke the cygwin shell from my build script, to run
> the same 3 commands with the -lc option to sh.exe (same command line),
> something happens and the build commands no longer work like in the
> real mintty terminal. Then my build fails.
>
> I believe there is something in the cygwin shell session or
> environment that I do not know how to set right when invoking
> $(CYGWIN_DIR)/bin/sh from my CMake script.
>
> Is there a way for me to start a cygwin shell session from the build
> script, that is identical to the one that opens in the mintty terminal
> from the start menu, and run some commands there ?
>
> I checked the environment variables and umask in the mintty terminal
> and in a /bin/sh session that I launch, they are the same in both
> cases. I tried using /bin/sh, /bin/bash, /bin/dash, with both --login
> and -c options. But the automated build always fails, and the manual
> build works.
>
> Thank you,
> Timothy Madden

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do start a cygwin shell session from a script ?
  2014-05-13 11:49 ` Timothy Madden
@ 2014-05-13 15:32   ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Hall (Cygwin) @ 2014-05-13 15:32 UTC (permalink / raw)
  To: cygwin

On 05/13/2014 07:25 AM, Timothy Madden wrote:
> It appears I found my missing shell session settings: the access
> rights on the current build and source directories.
>
> The manual build was always run within the user home directory in
> cygwin, and cygwin could see the proper access right on all the files
> used in the build.
>
> But outside the user home directory, cygwin no longer sees the proper
> permissions for directories and files, even though the user running
> the cygwin session can very well read and write the files. But cygwin
> will list the files with no permissions whatsoever, not even u+r (read
> access for the file owner). If I use the Windows `icacls` command to
> explicitly add the current user to the ACL on the directory with
> inheritable (recursive) "full control" access right, than cygwin can
> see the proper access rights too for such directories.
>
> Can this issue maybe be fixed, so cygwin sees the same permissions, on
> any files, user that Windows will grant to the current user ?

There are some tools that only look at the POSIX permissions (rwxrwxrwx),
which is what Cygwin works to provide.  But if you're using non-Cygwin
tools to create or modify files, these will not necessarily comply with
POSIX permissions.  If using Cygwin alternatives for these tools isn't
an option, you can mount the directory tree in question with the "noacl"
option to tell Cygwin tools to always allow access (see
<http://cygwin.com/cygwin-ug-net/using.html#mount-table>).  Many
times, this approach works best when you're trying to mix Windows native
and Cygwin tools.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-13 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 11:35 How do start a cygwin shell session from a script ? Timothy Madden
2014-05-12 19:39 ` Larry Hall (Cygwin)
2014-05-13 11:49 ` Timothy Madden
2014-05-13 15:32   ` Larry Hall (Cygwin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).