Windows 10 - Bash (WSL) | How to run Atom build on bash? - windows

I got a lot of problems when I try to run commands on Atom to "bash.exe".
Step by step
Enable "Bash Ubuntu" for Windows 10.
Setup compiler for my application on "Bash Ubuntu".
Test from "bash.exe" and "powershell.exe". Everything work ok.
Install Atom.
Create an runner on Atom.
Get msg "Erro: 0x80070057"
Possible Solutions
Disable Legacy Mode on Powershell (github.com/Microsoft/BashOnWindows/issues/7)
Use Powershell ISE (github.com/Microsoft/BashOnWindows/issues/430)
I've tried both links above, but nothing works.
Here is my Atom error and my Powershell working:
Atom IDE with Runner
Powershell with same command
Any idea? Thanks

As one of Atom developers said at GitHub issue:
"We support building Atom on Windows using our native Windows environment only. There is no support and no plans to support compiling the Linux version of Atom on Windows using WSL."
You can check at: https://github.com/atom/atom/issues/13774#issuecomment-278741701

Related

Bitrise bash script - command not found

i am building an android project with Bitrise.
i am running a bash script that resize the app icon with "sips" command.
locally everything is working fine, but when i am running on Bitrise build i got an error:
./Android/android-icons-generator.sh: line 32: sips: command not found
any idea why the sips command is not found?
thanks for your help !!
It sounds like you are building locally using macOS and on Bitrise you are building on Linux. As Viktor says in his comment the "sips" command is not available on Linux. You could solve this one of two ways:
Use a cross platform tool for image resizing (ImageMagick is a popular option) and make sure that is installed as part of your build.
Switch to using the Hybrid stack on Bitrise which provides macOS with the Android tooling installed.

How to get bash for Windows 10 (announced in build 2016)?

When will it get released ? and How to get/install bash for Windows 10 (announced in build 2016)?
The bash comes in a newer Insider Build, as said in the end of the video
So yo have to wait a bit. MS added all new things in the 143xx Builds, not in 14295. But MS must make the builds more stable before releasing them.
Build 14316 includes the bash now.
Run native Bash on Ubuntu on Windows: In this build, you can natively run Bash in Windows as announced last week at Build 2016. To
do this, you first need to turn on Developer Mode via Settings >
Update & security > For developers. Then search for “Windows Features”
and choose “Turn Windows features on or off” and enable Windows
Subsystem for Linux (Beta). To get Bash installed, open Command Prompt
and type “bash”.

Node.js - tutorials on getting it to work with Cygwin on a Vista machine

All,
Am trying to get Node.js to work on Vista machine.
I installed Cygwin (as per the Github instructions) which appears to have been installed correctly. However, none of the commands are executing.
Are there any tutorials for the stages after the Cygwin installation?
PROBLEM: When any command is executed, I get 'Bash: command not found' error.
Not even command like 'c:\cygwin\bin' is executing.
When I type 'user' in cygwin command prompt, I get 'ntvdm has encountered an system error. Parameter incorrect'.
I thought the above error may be due to the firewall, disabling the firewall did not have any effect, running the program with admin rights also did not change the results...
Am confused and would love to get some guidance on what steps to go with next on getting Node.js up and running on a Windows Vista machine.
Many thanks,
UPDATE1:
We managed to make a bit more progress. It appears that we had not installed all the relevant files related to Cygwin. Upon re-download and reinstalled, it ran well, however, we have driven into another error. Error we get:
How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).
We followed the instructions as per the above thread (3rd post from top for Windows machines), however, we are still stuck at the same error.
Any guidance please?
Have you tried just using the Windows self contained binaries? http://node-js.prcn.co.cc/ This way you actually don't need to bother with Cygwin.
At first, i tried it your way too, using Cygwin. After smashing my head for the 10th time against a wall i just stopped trying and found a much cleaner solution.
I'm using VirtualBox running a Debain guest system to locally develop on my Windows 7 machine. Using VirtualBox, you can easily set up shared folders or port forwarding for node apps between your Windows machine and your Debian guest system.
Since you are using a plain Linux-system, all the compiling-pain is blown away.
If you plan to run node.js in production on a windows system: don't. I hardly believe node.js will be ever stable enough on windows-based systems using MINGW/Cygwin...
People seem to run into problems with Cygwin because they think that they are using a Windows machine.
If you install Cygwin, and open a bash shell prompt using the Cygwin icon, you are now in a UNIX environment and everything works the same as it would on UNIX. That includes building node.js.
I think you added some info to the question and I can see your problem. Yes, normally on Cygwin it has been possible to build node.js just as you would on any UNIX system, but that is no longer possible on Windows 7. Before running ./configure you have to:
Close all cygwin apps.
Double-click on C:\Cygwin\bin\ash.exe
Run ./rebaseall and when it completes, run ./perlrebase.
exit from the ash shell window.
At this point Cygwin will be back to normal and you can ./configure and make install.

How do I get color coded console output from SBT on Windows?

I'm using SBT (Simple Build Tool) to build my Scala projects on Windows. I've seen that one of my friends, that runs OSX, gets color coded output in his terminal windows when running SBT, but mine is just the same color everywhere. Is there any way to enable this for Windows?
For DOS shell, check out ansicon
download page
type in the DOS shell:
ansicon -i
(If the above links don't work too well, aeracode mentiones in the comments this address)
(this picture is not from a sbt session but illustrates colors within a DOS session)
One way would be to install a POSIX-layer like MinGW or Cygwin and add -Djline.terminal=jline.UnixTerminal as a parameter to java to your sbt startup script.
I do not know if JLine supports colored output on Windows natively though.
I was able to get color output on windows by using Minnty with Cygwin. See the following question for the script to execute sbt from minnty
how to get specs2 color support on windows using mingw and sbt

Haskell on Windows Setup

Unfortunately I don't have access to a *nix box at work or at home. The only way I can play with Haskell is on windows. Anyone here using Haskell on Windows? What's your setup?
DISCLAIMER: What's below was valid in Oct, 2013. So there is a good chance it might get outdated soon. Your edits and comments are welcome.
This is what I have done in order to get Haskell set up on my Windows 7 x64
1. Install Haskell Platform
Download and install the Haskell Platform from http://www.haskell.org/platform/windows.html
2. Install Sublime Text 3
Download and install Sublime Text 3 from http://www.sublimetext.com/3
3. Enable the Package manager in Sublime
Run Sublime
Open the console: View >> Show console
Paste the following code to the console and hit Enter (according to this):
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
Open the command palette: Tools >> Command palette
In the command palette popup type in: Package Control: Install Package
Select the package: SublimeHaskell
4. Install Haskell tools
Cabal is the standard package manager for Haskell. What you need to do is:
Start a console with administrative permissions
Run:
cabal install cabal-install
cabal update
cabal install aeson
cabal install haskell-src-exts
cabal install ghc-mod
cabal install cmdargs
cabal install haddock
5. Install hdevtools
You can NOT install hdevtools on Windows by running: cabal instal hdevtools. What you need to do instead is:
Download the source code of hdevtools for Windows from https://github.com/mvoidex/hdevtools*
(* Currently does not work with GHC 7.10. See this fork for building with GHC 7.10 and above)
Unpack it to some folder
Go to that folder and run:
runhaskell Setup.hs configure --user
runhaskell Setup.hs build
runhaskell Setup.hs install
Watch for the path (in the console output) where the hdevtools have been installed. You will need this path when setting up the SublimeHaskell plugin in Sublime. The path should look something like this: C:\Users\Aleksey Bykov\AppData\Roaming\cabal\bin where Aleksey Bykov is the name of the current user.
6. Setting up the SublimeHaskell plugin in Sublime:
Start Sublime
Go Preferences >> Package settings >> SumblimeHaskell >> Settings - User
Make sure you configuration looks like:
{
"add_to_PATH":
[
"C:/Users/Aleksey Bykov/AppData/Roaming/cabal/bin/"
],
"enable_hdevtools": true
}
where C:/Users/Aleksey Bykov/AppData/Roaming/cabal/bin/ is that path (you got at step 5) where hdevtools (all all other toolls have been installed)
4. Save the file and restart Sublime
7. Hello world
Start Sublime
Create a new file and save it immediately as hello-world.hs
Put the following code there:
main::IO()
main = putStrLn "Hello world!"
Build and run by going Tools >> Build x 2 times (first it builds, second it runs)
8. See also
There is another great article: http://howistart.org/posts/haskell/1
I've used Haskell on Windows, but only when forced to. Not because the combination Haskell+Windows is particularly bad, but just because I don't really like Windows.
My setup was basically the following:
GHC
Vim
MinGW
Console
CMake
Visual Studio Express
As you can see I was trying to get an environment that was as similar to Unix as possible (without using cygwin, because I find it utterly confusing). Vim is my favourite editor. The reason for Visual Studio was that the C environment shipped with GHC doesn't cover all of Win32API. I used CMake to get a decent build environment.
Haskell Platform is now more or less the standard distribution of haskell, and it has a windows installer.
GHC is a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell.
There is a Windows installer for GHC, but it for Version 6.4.2 .
A Windows .exe (not an .msi installer) for version 6.10.1 is at http://www.haskell.org/ghc/dist/6.10.1/
It is not clear when the current (GHC 6.10.1) version will offer a Windows installer.
No one seems to have mentioned Atom yet, which I've been using for a few weeks now. It's not quite as stable and mature as ST3 yet, but it looks promising and offers cabal (partial) and ghc-mod (good) integration via plugins.
How to install Haskell in windows10 :
Step01: open windows powershell (run as administrator) and run the following command as instructed:
command 1 : command = Get-ExecutionPolicy, If it returns "Restricted" then run this command = Set-ExecutionPolicy AllSigned
command 2 : command = Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
(note: type "Y" whenever it asks and click enter )
step02:run the following command(in windows powershell (run as administrator)):
command = choco install haskell-dev haskell-stack
(note: type "Y" whenever it asks and click enter )
after running this command close the powershell
step03: verification if you did everything right:
open command prompt and run the following code:
command = ghc --version
output should be = The Glorious Glasgow Haskell Compilation System, version 9.2.1
(minimize the command prompt)
how to run a simple code and get output :
step01: open command prompt and run the following commands one by one:
cd \
cls
mkdir dev
cd dev
cls
notepad hello.hs
notepad will open and now write the following program and save it :
program:
main = do
print "My first Haskell program"
name <- getLine
print ("Hello, " ++name)
write this and save
step 02 : to run the program open command prompt that was minimized before and run the following commands:
commands=
ghc hello.hs
hello
You should get the output as : My first Haskell program.
To use the same in vs code: after you do the above steps open(open with vs code) hello.hs file in c drive dev folder and then in extentions install Haskell Syntax Highlighting and run the same commands in terminal choose command prompt as default rather than windows powershell.
(note before you open the .hs in vs code make sure you delete every other file expect the hello.hs file)
I recall using hugs with some success a while ago. I was just playing around though.
I based on Magnus solution. I have to state that I'm normally GNU/Linux user and I had to port low level packages (like this one).
Console
Haskell Platform (it contains GHC and, on Windows, MinGW)
Cygwin with X
XEmacs
Installing it on windows is much more difficult and painful that on a Mac (as it is with almost all dev software). That being said, here is the simplest way to set up a Haskell environment on Windows 10:
Open Powershell as Aministrator (right click, and "Run as Administrator").
1 In Powershell, check your execution policy as follows:
Get-ExecutionPolicy
2 If you get "Restricted", you need to change it. Execute this command:
Set-ExecutionPolicy Bypass -Scope Process
3 When you get a question prompt, type:
A
Hit Enter.
4 Verify your policy again with Get-ExecutionPolicy. Now your policy should be "Bypass".
5 Double check that you have Chocolatey:
choco
6 Install Haskell:
choco install haskell-dev
It takes a while..
7 Start coding in Haskell!
http://learnyouahaskell.com/starting-out
Or You could partition your hard-drive a duel boot between linux and windows :)
Doesn't answer your question, but it is an alternative.
You could install Sun's VirtualBox, and install Linux on it.

Resources