TeamCity unmet requirement: MSBuildTools12.0_x86_Path exists (Mac only) - macos

I've seen this question asked but never specifically for Mac. My company is using TeamCity on a Mac Mini to do our iOS and android builds. We would use windows but, iOS builds require a Mac with Xcode. I have not been able to satisfy this condition. I can see that there are multiple versions of MSBuild (and Xbuild) already on my machine. Here is what I tried:
set an environment variable for MSBuildTools12.0_x86_Path using launchctl setenv (tried the bin directory of every instance of MSBuild existing on my machine), rebooted before checking TC
setting env.MSBuildTools12.0_x86_Path entry in buildAgent.properties
setting system.MSBuildTools12.0_x86_Path entry in buildAgent.properties
logging into TeamCity, going to my build configuration, going to the "parameters" tab and adding a new parameter for env.MSBuildTools12.0_x86_Path
After all of the above failed to satisfy the condition, I tried grabbing version 12 of MSBuild from a Windows machine, copying it to my Mac and pointing to its "Bin" directory instead, and repeating all bullets above.
The path was /Users/myusername/MSBuild/12.0/Bin. This bin directory contains MSBuild.exe, an MSBuild folder, a bunch of DLLs and more.
Again, this failed to change the outcome of the unmet condition in TeamCity. The frustrating thing is that TeamCity isn't giving me details. I don't know if it's still complaining that the path isn't even set (and where it is even looking for that path definition), or if it SEES that the path is set but it's not pointing to a folder it recognizes as MSBuild. I'm completely in the dark.
Does anyone have any guidance for me on this? I feel I've exhausted all paths to a solution. Thank you so much, in advance.

I figured it out on my own. On the Mac, you have to do an "MSBuild" runner type and pick "Mono xbuild 4.5" for the version. I used "x86" for the run platform and set a parameter for Mono4.5_x86 to point to xbuild. But it was trying to run the 64 bit version of mono and I found no way to set a command line argument for mono to tell it I want --arch=32 so I ended up having to link the mono executable to mono-sgen32 to get the build to finally work.

Related

Why does run fail after I compile a GoLang project to Web Assembly?

I created a Go(lang) project in Visual Studio Code. I created a main.go file that I will compile to WebAssembly, and another main.go that I will run as a server (to serve my Web Assembly glue file).
For reference, I'm following the tutorial here: https://golangbot.com/webassembly-using-go/
In a Visual Studio Code terminal, I do the following:
[cd to my wasm source folder with the first main.go]
${env:GOOS} = "js"
${env:GOARCH} = "wasm"
go build -o ../../assets/json.wasm
[cd to my server folder with the other main.go]
go run main.go
[I get the following error]
exec: "C:\Users\...\AppData\Local\Temp\go-build3258126417\b001\exe\main": file does not exist
I was able to run this server prior to the build. What's going on?
This should have just run. But now I'm not able to run the server. I get that strange "file does not exist" error.
I spent a lot of time trying to figure this out and finally got it! Here's the deal:
Either or both of the GOOS and GOARCH environment variables that are required by the build go command (for webassembly) seem to conflict with the go run command. I don't know why. I discovered this in a backwards kind of way.
(TLDR: use different terminals to build and run and don't set these environment variables globally -- set them prior to every build. Use the Terminal>Split Terminal to maintain the build settings between tests! ).
Using the Visual Studio Code Powershell terminal, I set these 2 variables (or so I thought) and then ran the build. Then I ran the server to try to see the fruits of my labor and got a strange error in the Chrome console (something about expecting one magic word but receiving another). It turns out this error is fairly generic and after some googling, determined it probably meant something happened with my build. After trying a few more times unsuccessfully to build, I decided to set the environment variables in windows (as SYSTEM variables) so that I didn't have to keep setting them when I did my build.
I built again (still no build errors), but then when I went to run the server, I got the
exec: "C:\Users...\AppData\Local\Temp\go-build3258126417\b001\exe\main": file does not exist
error. At this point, I couldn't run any of my Go servers in any project. Since the only "global" thing I'd done was set those 2 environment variables, I decided to remove them. I could now run my Go servers. But I still couldn't execute my builds in the browser. What's going on??
I figured that since setting the global environment variables had an effect (albeit, a negative effect) whereas I hadn't experienced that issue when manually setting them directly in the terminal prior to each build, then maybe there was something wrong with the way I was setting the variables (I don't use Powershell very often).
After more googling and some experimentation, I discovered the "correct" way to set these variables in the terminal (noted in my original question). So manually setting them (the right way) prior to the build fixed the build issue (it wasn't building correctly since those variables weren't being set properly).
Now I knew the variable were getting set properly because now I was getting that error when I set them manually prior to the build. So now what?
I killed the terminal after build, and then started a new terminal, and the run was successful.
So bottom line: the GOOS and GOARCH environment variables should not be set when running a server, so don't start a server in the same terminal that you used to build the web assembly code!

How to add Cargo to PATH required for pywinpty when deploying to Heroku?

I am getting the following error on Windows:
Cargo, the Rust package manager, is not installed or is not on PATH.
remote: This package requires Rust and Cargo to compile extensions.
I've installed Rust and cargo is in the path, but the problem persists. Does anybody know why this is happening?
Error message is the same as in this post.
Heroku's stack runs on Ubuntu. Cargo is required by pywinpty but that's a library required for communicating with Windows processes. You may need it for your local environment but you don't need it for Heroku. You should try removing pywinpty from your requirements.txt when you deploy to Heroku.
If you want a temporary solution
Open a command line prompt (cmd) and execute
path
that will show you the actual, current path. Inspect it to see whether the necessary directories are really absent. If they are, execute
path=%path%;directory you want to add;other directory you want to add
The path will be available in the command prompt for as long as it's open. If they are present, reboot the computer, the addition to the path may have been delayed after installation.
The permanent solution
For Win10 but I guess instructions are not very different for other flavors.
Open System properties, find Environment Variables. In the dialog that pops up you will see System Variables, among which you will see Path. Select it, click edit and add the directories you need via the New button. Close all popup boxes and reboot (always a good idea when Windows is stubborn ;-) )

TFBuild Local File Copy

I'm facing problems using TFBuild in Visual Studio Team Services (was Visual Studio Online).
I want to use the Copy Files task before running Cordova tasks, to copy certificates from a local folder into the build folder (or any folder that Cordova Build can access, it has to be relative to the repository)
I am using the following configuration:
Step Configuration
But what happens is, that it creates a folder with the name $(build.artifactsstagingdirectory) in user/****/myagent/_work/build/****/ instead of using the content of the variable as the path.
Tried with several variables, always creates a folder with the name of the variable. Tried with upper/lower/camel/pascal Case but it did not change anything.
The source files are copied into that folder.
Docs don't seem to do something different.
log does not say anything besides:
2016-07-20T11:58:20.550Z: found 1 files
2016-07-20T11:58:20.551Z: Copying /Users/****/certs/android/release/xxxx.keystore to $(build.artifactstagingdirectory)/xxxx.keystore
The Build-Agent is a Mac Mini, with OS X 10.11.6
Am I doing something wrong or is it a Bug?
Debug log says:
http://prntscr.com/bxn6s6
Had to add a picture, wouldn't let me post it with line breaks otherwise.
The solution was simple. The Build Agent was outdated.
With the current version (which had huge installation problems due to openSSL deprecation on Mac OS) it works fine.

Mac OS X app - deploying to Applications directory

I'm trying to have my app deploy to a user's applications directory on install, but am having trouble determining the correct configuration settings.
Right now I have:
Deployment Postprocessing - YES
Installation Build Products Location - ""
Installation Directory - "/Applications"
This seems to work when doing xcodebuild install, but is this the best way to do this? I had to change Installation Build Products Location from /tmp/Project.dst to an empty string which doesn't seem right. Also should these settings be set on the target, the project, or both?
These settings seem to work fine. They should be set at the project level, not the target.
Documentation of DSTROOT (Installation Build Products Location) says:
The path at which all products will be rooted when performing an
install build. For instance, to install your products on the system
proper, set this path to /. Defaults to /tmp/$(PROJECT_NAME).dst
to prevent a test install build from accidentally overwriting valid
and needed data in the ultimate install path. Typically this path is
not set per target, but is provided as an option on the command line
when performing an xcodebuild install. It may also be set in a build
configuration in special circumstances.
So the "official" way of doing it would be setting it to "/".

Android studio doesn't start

I just download Android Studio for Windows 7, the wizard went ok up to the end but now when I click on the shortcut or on the .exe to start the program nothing happens, no error, no new window, it's seems like it is doing nothing. Do you have any suggestion?
It's a bug of Android Studio 0.1v
You should add JAVA_HOME to the system environment variables.
http://tools.android.com/knownissues#as0.1
Open Start menu > computer > System Properties > Advanced System
Properties
In the Advanced tab > Environment Variables, add new system
variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21
Install latest Java Development Kit.
Set path in system variables for Java (ie *C:\Program Files\Java\jdk1.7.0_21\bin*)
Set JDK_HOME system variable (ie *C:\Program Files\Java\jdk1.7.0_21*)
If not working, set JAVA_HOME in system variable too (ie *C:\Program Files\Java\jdk1.7.0_21*)
If not working, check if you don't have spaces at the ends of the lines in system variables (PATH, JDK_HOME, JAVA_HOME)
You don't have to restart computer after changing system variables, just reload command prompt (if you are using it).
If it still not working, you probably have java.exe in C:/Windows/System32/. Rename it, restart command prompt and type java -version to check if you are using correct version of JDK.
I've posted tutorial how to fix Android Studio with screenshots on my blog.
I have had a similar problem with Android Studio 1.0 in windows 7 x64. When I ran studio64.exe it flashed the android studio logo and it disappeared immediately. Also I tried
studio64.exe > error.log
to figure out possible errors. JAVA_HOME=C:\Program Files\Java\jre1.8.0_25 environment variable was correctly setted.
Finally I decided to uninstall all Java versions (I had a mess of different java versions installed), both jdk and jre and reinstalled last version jdk 1.8.0_25. My problem was solved.
Regards,
Sometimes it might get stuck in memory. Open task manager, terminate android stuido. Open it up again.
If you install new the version of android studio.
It requires new jdk 1.8.
Just install the latest jdk 1.8 and android studio will work without the need to manually edit any environment variables.
You have to add a new system variable named ANDROID_STUDIO_JDK or JDK_HOME with the path to your JDK install folder, such as C:\Program Files\Java\jdk1.7.0_21\
I had the same exact problem and did try to do every thing manually nothing worked except for this command when I finished it finally launched. Open CMD with administrator if possible then put the following command:
set path="$PATH":C:\Program Files\Java\jdk1.7.0_21\bin
Then just try to launch it should work.
This is the only thing that worked for me.
Make sure you have Java 1.8 (JDK) or higher and update java_home and path to this version.
I did every tips but i checked AS requirements and updated jdk do 1.8.xx
It's possible there is a problem with your username (and name of the user folder). It shouldn't contain non-latin letters.
I had solved my problem (no response to an attempt to run Android studio) when I tried running the application as another Windows user (with name that consists of English letters only)
I got the same problem, but with no error message.
I found a studio.bat file and dig in it. There, I found some tips:
I found out thet the variable suggested in a previous post is incorrect.
ANDROID_STUDIO_JDK is no good.
STUDIO_JDK is the one.
Also, just to make the things/solution worst to corner,
I've uninstalled jre and jdk then reinstall jdk only.
The setup variables are like this:
JAVA_HOME is now pointing to C:\Program Files\Java\jdk1.8.0_172\bin
JDK_HOME is pointing to C:\Program Files\Java\jdk1.8.0_172
STUDIO_JDK is pointing to C:\Program Files\Java\jdk1.8.0_172
It's a mess but it's working...
Is it because I uninstalled/reinstalled java sdk and jre? or just the env. variables? who knows :)
Specs:
i5 with 4gig ram
win 10 32bit
In addition to following the steps pointed out by Tigris I also had to run the Android Studio with Administrative rights. Not sure why but I just made it in a few minutes ago.
Follow the steps here: http://tools.android.com/knownissues#as0.1
Run Android Studio as Admin
There is Another Issue
http://tools.android.com/knownissues
open a "cmd.exe" (command prompt), cd to the android-studio\bin folder and run "studio.bat". You will most likely see an error: for example b/55267 is about the option -XX:+UseCodeCacheFlushing not being recognized. Report the error, remove the line from the studio.exe.vmoptions or studio64.exe.vmoptions and it should now work.
There could be a process still running in the background that would need to be killed in the task manager. The name of the process is studio64.exe (at least that's the name on my machine). Could be because I am running a 64-bit OS. After killing this process, try to run Android Studio again, and it should work.
If your path and/or environment variables are not pointing to the correct JDK, things won't work properly.
A rock solid solution, especially if you must have multiple JDKs installed (e.g. Java 6/7/8) is to create a batch file to launch Android Studio.
Create a new file called studio.bat and place this somewhere outside the Android Studio installation, e.g.
c:\mydevstuff\launchers\studio.bat
(if you put the batch file anywhere in the android-studio folder, then you'll have problems when updating Android Studio).
Put the following code in the new batch file:
#echo off
REM Can make paths relative to SCRIPT_PATH if necessary
set SCRIPT_PATH=%~dp0
set ANDROID_STUDIO_JDK=<JDK Path>
set JAVA_HOME=<JDK Path>
set PATH=<JDK Path>\bin;%PATH%
cd <android-studio Install Path>\bin
start studio64.exe
Replace studio64.exe with studio.exe if you need the 32-bit version.
Replace
<JDK Path>
with the path to your JDK, e.g.
C:\Program Files\Java\jdk1.7.0_25
Replace
<android-studio Install Path>
with the path to your Android Studio installation, e.g.
C:\Program Files\Android\android-studio
Now you can just run the batch file to start Android Studio.
Additional:
If you want to pin to the Taskbar, then create a shortcut to the batch file and then change it's target to:
cmd.exe /c "<path to bat>\studio.bat"
Then pin this shortcut to the Taskbar by drag-and-drop.
You can also set it's icon from the original Android Studio studio.exe file.
I ran into this problem and these steps fixed it.
Remove ALL older JRE / JDK versions
Set values for JDK_HOME & JAVA_HOME to path of JDK install
if you use android studio version 2.3.3 you should have JDK with version 1.8 in the system environment values ,
to add it
click on Computer (in windows 7)
System properties
Advanced system settings (at the right)
Advanced (tab)
environment variables button
and edit the value of name JAVA_HOME to the file which contains jdk 1.8
if you don't have this variable make a new one

Resources