Re: vagrant on windows with cygwin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: vagrant on windows with cygwin

Christopher Hopper
Mitchell,

Your change to fix the vagrant launch script for Cygwin bash seems to have become broken again. I've worked out what is going on though.

I'm using Vagrant version 1.1.0 installed using the Windows MSI on Windows 7. I'm running vagrant from the Cygwin bash. The following code line breaks your Cygwin detection:

# Prepend our embedded dir to the PATH so that we call that preferably
export PATH="${EMBEDDED_DIR}/bin:${PATH}"

Later in the script you added the following lines:

OS=$(uname -o 2> /dev/null)
if [ "${OS}" = "Cygwin" ]; then
        VAGRANT_EXECUTABLE=`cygpath -w "${VAGRANT_EXECUTABLE}"`
        GEM_HOME=`cygpath -w "${GEM_HOME}"`
        GEM_PATH=`cygpath -w "${GEM_PATH}"`
fi

But what happens here is that OS ends up being set to equal "Msys", because the PATH variable change above means that commands are run from the ${EMBEDDED_DIR}/bin path in preference to their native Cygwin versions.

Try this and you'll see what I mean. Change the lines around the export PATH="${EMBEDDED_DIR}/bin:${PATH}" to read like this:

echo "Before: $(uname -o 2> /dev/null)"
export PATH="${EMBEDDED_DIR}/bin:${PATH}"
echo "After: $(uname -o 2> /dev/null)" 
exit; 
 
You'll see the output like this:

Before: Cygwin
After: Msys

I solved the problem by moving the OS variable set line to the top of the vagrant shell script. 

Christopher.

On Wednesday, 28 March 2012 16:22:40 UTC+11, Mitchell Hashimoto wrote:
Matthew,

On Wed, Mar 28, 2012 at 5:07 AM, Mitchell Hashimoto
<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yF1wFuzLIiIJ">mitchell....@...> wrote:


> On Mon, Mar 26, 2012 at 1:41 PM, Luis Lavena <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yF1wFuzLIiIJ">luisl...@...> wrote:
>> On Sun, Mar 25, 2012 at 11:35 PM, Matthew Turney
>> <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="yF1wFuzLIiIJ">pho3ni...@...> wrote:
>>> This may help. I believe it is available in all cygwin installs.
>>>
>>> http://cygwin.com/cygwin-ug-net/using-utils.html#cygpath
>
> Amazing. This will work perfectly.
>
>>>
>>> Using that, it should be easy to convert paths back and forth.
>>
>> Good finding.
>>
>> The only thing is that will limit the script to only work in Cygwin
>> bash and not MSYS (which is kinda the same, but not have all the
>> cygwin tools)
>>
>> I don't see many using the Git Bash (MSYS) to control Vagrant or
>> anything with native Ruby (RubyInstaller) so perhaps you can use that
>> script to be cygwin-only.
>
> I don't see this having to be the case. I can easily detect we're
> running in Cygwin:
> http://stackoverflow.com/questions/4250280/shell-script-detecting-running-in-cygwin
>
> Using that, I can choose to either convert the path or not. :)
>
> Best,
> Mitchell
>
>>
>> --
>> Luis Lavena
>> AREA 17
>> -
>> Perfection in design is achieved not when there is nothing more to add,
>> but rather when there is nothing more to take away.
>> Antoine de Saint-Exupéry

I just pushed this change:

https://github.com/mitchellh/vagrant-installers/commit/4747e5071f46f4397b3339fd289ee8ab54901743

This will take effect in the next version of the installers. I haven't

tested it yet but can you eyeball and see if it looks right?

Best,
Mitchell

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant on windows with cygwin

Mitchell Hashimoto
Christopher,

Thanks. This is fixed and will be part of 1.1.1.


On Sun, Mar 17, 2013 at 10:47 PM, Christopher Hopper <[hidden email]> wrote:
Mitchell,

Your change to fix the vagrant launch script for Cygwin bash seems to have become broken again. I've worked out what is going on though.

I'm using Vagrant version 1.1.0 installed using the Windows MSI on Windows 7. I'm running vagrant from the Cygwin bash. The following code line breaks your Cygwin detection:

# Prepend our embedded dir to the PATH so that we call that preferably
export PATH="${EMBEDDED_DIR}/bin:${PATH}"

Later in the script you added the following lines:

OS=$(uname -o 2> /dev/null)
if [ "${OS}" = "Cygwin" ]; then
        VAGRANT_EXECUTABLE=`cygpath -w "${VAGRANT_EXECUTABLE}"`
        GEM_HOME=`cygpath -w "${GEM_HOME}"`
        GEM_PATH=`cygpath -w "${GEM_PATH}"`
fi

But what happens here is that OS ends up being set to equal "Msys", because the PATH variable change above means that commands are run from the ${EMBEDDED_DIR}/bin path in preference to their native Cygwin versions.

Try this and you'll see what I mean. Change the lines around the export PATH="${EMBEDDED_DIR}/bin:${PATH}" to read like this:

echo "Before: $(uname -o 2> /dev/null)"
export PATH="${EMBEDDED_DIR}/bin:${PATH}"
echo "After: $(uname -o 2> /dev/null)" 
exit; 
 
You'll see the output like this:

Before: Cygwin
After: Msys

I solved the problem by moving the OS variable set line to the top of the vagrant shell script. 

Christopher.

On Wednesday, 28 March 2012 16:22:40 UTC+11, Mitchell Hashimoto wrote:
Matthew,

On Wed, Mar 28, 2012 at 5:07 AM, Mitchell Hashimoto
<[hidden email]> wrote:

> On Mon, Mar 26, 2012 at 1:41 PM, Luis Lavena <[hidden email]> wrote:
>> On Sun, Mar 25, 2012 at 11:35 PM, Matthew Turney
>> <[hidden email]> wrote:
>>> This may help. I believe it is available in all cygwin installs.
>>>
>>> http://cygwin.com/cygwin-ug-net/using-utils.html#cygpath
>
> Amazing. This will work perfectly.
>
>>>
>>> Using that, it should be easy to convert paths back and forth.
>>
>> Good finding.
>>
>> The only thing is that will limit the script to only work in Cygwin
>> bash and not MSYS (which is kinda the same, but not have all the
>> cygwin tools)
>>
>> I don't see many using the Git Bash (MSYS) to control Vagrant or
>> anything with native Ruby (RubyInstaller) so perhaps you can use that
>> script to be cygwin-only.
>
> I don't see this having to be the case. I can easily detect we're
> running in Cygwin:
> http://stackoverflow.com/questions/4250280/shell-script-detecting-running-in-cygwin
>

> Using that, I can choose to either convert the path or not. :)
>
> Best,
> Mitchell
>
>>
>> --
>> Luis Lavena
>> AREA 17
>> -
>> Perfection in design is achieved not when there is nothing more to add,
>> but rather when there is nothing more to take away.
>> Antoine de Saint-Exupéry

I just pushed this change:

https://github.com/mitchellh/vagrant-installers/commit/4747e5071f46f4397b3339fd289ee8ab54901743

This will take effect in the next version of the installers. I haven't
tested it yet but can you eyeball and see if it looks right?

Best,
Mitchell

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant on windows with cygwin

Christopher Hopper
Wow, quick reply. Service with a smile. 

Here I was thinking that I'd need to post an issue in the Github issue queue, because this thread was a bit old and cold.


On Monday, 18 March 2013 16:52:21 UTC+11, Mitchell Hashimoto wrote:
Christopher,

Thanks. This is fixed and will be part of 1.1.1.


On Sun, Mar 17, 2013 at 10:47 PM, Christopher Hopper <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iAqJbOllm48J">christophe...@gmail.com> wrote:
Mitchell,

Your change to fix the vagrant launch script for Cygwin bash seems to have become broken again. I've worked out what is going on though.

I'm using Vagrant version 1.1.0 installed using the Windows MSI on Windows 7. I'm running vagrant from the Cygwin bash. The following code line breaks your Cygwin detection:

# Prepend our embedded dir to the PATH so that we call that preferably
export PATH="${EMBEDDED_DIR}/bin:${PATH}"

Later in the script you added the following lines:

OS=$(uname -o 2> /dev/null)
if [ "${OS}" = "Cygwin" ]; then
        VAGRANT_EXECUTABLE=`cygpath -w "${VAGRANT_EXECUTABLE}"`
        GEM_HOME=`cygpath -w "${GEM_HOME}"`
        GEM_PATH=`cygpath -w "${GEM_PATH}"`
fi

But what happens here is that OS ends up being set to equal "Msys", because the PATH variable change above means that commands are run from the ${EMBEDDED_DIR}/bin path in preference to their native Cygwin versions.

Try this and you'll see what I mean. Change the lines around the export PATH="${EMBEDDED_DIR}/bin:${PATH}" to read like this:

echo "Before: $(uname -o 2> /dev/null)"
export PATH="${EMBEDDED_DIR}/bin:${PATH}"
echo "After: $(uname -o 2> /dev/null)" 
exit; 
 
You'll see the output like this:

Before: Cygwin
After: Msys

I solved the problem by moving the OS variable set line to the top of the vagrant shell script. 

Christopher.

On Wednesday, 28 March 2012 16:22:40 UTC+11, Mitchell Hashimoto wrote:
Matthew,

On Wed, Mar 28, 2012 at 5:07 AM, Mitchell Hashimoto
<[hidden email]> wrote:

> On Mon, Mar 26, 2012 at 1:41 PM, Luis Lavena <[hidden email]> wrote:
>> On Sun, Mar 25, 2012 at 11:35 PM, Matthew Turney
>> <[hidden email]> wrote:
>>> This may help. I believe it is available in all cygwin installs.
>>>
>>> http://cygwin.com/cygwin-ug-net/using-utils.html#cygpath
>
> Amazing. This will work perfectly.
>
>>>
>>> Using that, it should be easy to convert paths back and forth.
>>
>> Good finding.
>>
>> The only thing is that will limit the script to only work in Cygwin
>> bash and not MSYS (which is kinda the same, but not have all the
>> cygwin tools)
>>
>> I don't see many using the Git Bash (MSYS) to control Vagrant or
>> anything with native Ruby (RubyInstaller) so perhaps you can use that
>> script to be cygwin-only.
>
> I don't see this having to be the case. I can easily detect we're
> running in Cygwin:
> http://stackoverflow.com/questions/4250280/shell-script-detecting-running-in-cygwin
>

> Using that, I can choose to either convert the path or not. :)
>
> Best,
> Mitchell
>
>>
>> --
>> Luis Lavena
>> AREA 17
>> -
>> Perfection in design is achieved not when there is nothing more to add,
>> but rather when there is nothing more to take away.
>> Antoine de Saint-Exupéry

I just pushed this change:

https://github.com/mitchellh/vagrant-installers/commit/4747e5071f46f4397b3339fd289ee8ab54901743

This will take effect in the next version of the installers. I haven't
tested it yet but can you eyeball and see if it looks right?

Best,
Mitchell

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iAqJbOllm48J">vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.