MSBUILD : error MSB1005: Specify a property and its value - bamboo

I have tried to build .Net project using MSBuild in Bamboo and in MSBuild comman line switches I have provided /p:PublishDir=D:\Atlassian\home\bamboo\xml-data\build-dir\AP-BUILD-JOB1; /p:VisualStudioVersion=12.0 so i got the below error
MSBUILD : error MSB1005: Specify a property and its value.
Added job called MSBUild and provide .Net project details like solution file and all

Not sure has much to do with Bamboo - looks like an MSBUILD command syntax error. Here is their doc on error: https://msdn.microsoft.com/en-us/library/h8h04acf.aspx.
Looks like maybe a separator issue? It says semi-colon or comma can be used to separate properties, or the /p: may be repeated - but you've done both. You have a semi-colon and you're also repeating /p: - so you have two of what they consider to be separators back to back.

MSB1005: Specify a property and its value.
Rebuilds build #16
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\workspace\First Windows Project
No credentials specified
git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git.exe config remote.origin.url https://github.com/pronobeshm/PdftoWord.git # timeout=10
Fetching upstream changes from https://github.com/pronobeshm/PdftoWord.git
git.exe --version # timeout=10
git.exe fetch --tags --force --progress -- https://github.com/pronobeshm/PdftoWord.git +refs/heads/:refs/remotes/origin/ # timeout=10
git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision b41ae8f43b6760d2da87091f907d2640ff42db6b (refs/remotes/origin/master)
git.exe config core.sparsecheckout # timeout=10
git.exe checkout -f b41ae8f43b6760d2da87091f907d2640ff42db6b # timeout=10
Commit message: "This is my First Commit to the Github"
git.exe rev-list --no-walk b41ae8f43b6760d2da87091f907d2640ff42db6b # timeout=10
New run name is '#17'
Path To MSBuild.exe: C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe
Executing the command cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:Deploy=True;Configuration=Debug; %workspace%/FormatToFormat/FormatToFormat.sln " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\First Windows Project
[First Windows Project] $ cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:Deploy=True;Configuration=Debug; %workspace%/FormatToFormat/FormatToFormat.sln " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1005: Specify a property and its value.
Switch: /p:Deploy=True;Configuration=Debug;
For switch syntax, type "MSBuild /help"
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
New run name is '#17'
Finished: FAILURE

Related

Git Bash on Windows - CMake Error: The source directory does not exists

I use Git Bash on Windows 10. When I run the following command from the TestCpp directory:
cmake -S . -B build -G "Visual Studio 15 2017" -A "Win32"
I get the following error:
CMake Error: The source directory "C:/Projects/TestCpp/build" does not exist.
When I create a build folder and then run the command from that folder:
cmake -G "Visual Studio 15 2017" -A "Win32" ..
everything works fine. Why the first command doesn't work ?
The behavior described exists when trying to use the -S and -B options with an older version of CMake that does not support them. Support for these options is documented as starting in 3.13.

Azure DevOps private Linux agent - YAML pipeline checkout failing - can fix with "git config --global --unset http.extraHeader" but not early enough

We have an issue regarding the following:
Azure DevOps Linux Private Agent
Possible issue with corrupt / stale bearer token
Can be fixed with this command by logging onto the box but this is not convenient: git config --global --unset http.extraHeader
Can be fixed with this command as part of script in YAML: git config --global --unset http.extraHeader but not early enough. (See next comment below).
I can't run this command early enough in the pipeline YAML to clear the header as checkout is not controlled by me.
It generally only happens if a previous run fails at some point on the same private agent
Syncing repository: test-project-azure-workspace (Git)
git version
git version 2.26.0
git lfs version
git-lfs/2.10.0 (GitHub; linux amd64; go 1.13.4)
git config --get remote.origin.url
git clean -ffdx
git reset --hard HEAD
HEAD is now at 5f9fd24 sql mi
git config gc.auto 0
git config --get-all http.https://xxxxxxx#dev.azure.com/xxxxxxx/xxxxxxx/_git/test-project-azure-workspace.extraheader
git config --get-all http.proxy
git config http.version HTTP/1.1
git -c http.extraheader="AUTHORIZATION: bearer ***" -c http.proxy="http://10.XXX.XXX.XX:80" fetch --force --tags --prune --progress --no-recurse-submodules --unshallow origin
* Couldn't find host dev.azure.com in the .netrc file; using defaults
Here is the code that can remedy the symptom:
- script: |
echo '======================================================================'
echo 'list all of git config values for your convenience:'
echo '======================================================================'
git config --list
echo '======================================================================'
existing_header=$(git config --get http.extraHeader)
if [ ${#existing_header} -gt 0 ]
then
echo 'We found the http.extraHeader'
echo 'un-setting extra header: http.extraHeader 🔥'
git config --global --unset http.extraHeader
else
echo 'no extra header: http.extraHeader was not found. Nothing to unset 👍'
fi
condition: always()
workingDirectory: '$(Agent.BuildDirectory)/s'
displayName: 'Remove Git Authentication'
Obviously, I am treating the symptom and not the cause so any pointers as to what is causing this would be a great help.
You can create a "cleaning" job at the start of your pipeline that uses the checkout task with none as the repo to checkout. This will allow you to then run the cleaning script.
- job: cleanAgent
steps:
- checkout: none
- script: |
echo "Put your git cleaner here"
A better option is really to clean the agent after you are done by running a cleaning task with a condition of always() at the end of your pipeline. This can be hard if other people also use the agents and don't clean-up though.
- job: cleanupAgents
condition: always()
steps:
- script: |
echo "Put your git cleaner here"

How to stop robocopy from exiting the build?

I'm using Gitlab 8.15.4 and the latest runner for that build. Because of our firewall I can't run npm install so I'm copying the node-modules from another location into the build folder. The runner is on a Windows 7 machine.
My first attempt:
(.gitlab-ci.yml)
before_script:
- robocopy S:\Storage\GitLab-Runner\Assets\node_modules .\node_modules /s
build:
stage: build
script:
- echo starting
- gulp
- echo done
artifacts:
paths:
- deploy.zip
Fails the build with the error:
ERROR: Job failed: exit status 1
My second (nth) try puts the robocopy into a script file and executes it from there:
(.gitlab-ci.yml)
before_script:
- S:\Storage\GitLab-Runner\Scripts\CopyAssets.bat
build:
stage: build
script:
- echo starting
- gulp
- echo done
artifacts:
paths:
- deploy.zip
(CopyAssets.bat)
robocopy S:\Storage\GitLab-Runner\Assets\node_modules .\node_modules /s
set/A errlev="%ERRORLEVEL% & 24"
exit/B %errlev%
Passes but does not execute any other steps.
How can I prevent RoboCopy from exiting the build when it finishes?
You and a lot of other people have encountered this issue with robocopy in CI deployment. As I have found this question being unanswered for some time and the other answers being incompatible with continuing the script after robocopy, I want to share the solution here.
If you want robocopy to ignore all return codes under 8 (>= 8 means copy error), you need a condition that follows the command directly and changes the error level.
(robocopy src dst) ^& IF %ERRORLEVEL% LSS 8 SET ERRORLEVEL = 0
For powershell users:
(robocopy src dst) ; if ($lastexitcode -lt 8) { $global:LASTEXITCODE = $null }
or
cmd /c (robocopy src dst) ^& IF %ERRORLEVEL% LEQ 1 exit 0
I have tested on GitLab 13.12 with GitLab Runner powershell and it worked well.

Xcode 7.1.1 - fatal error : lipo: can't open input file

I'm getting fatal error: lipo: can't open input file: /Users/.../libABC.a (No such file or directory)
I've cross-checked this file exists in same location after checking with 'Show in Finder'
I'm getting this error while building library. I've tried below solutions but didn't worked:
1. Build Active architecture only - YES/NO
2. Enable BitCode - YES/NO
3. Clean / Clean Build Folder, Quit simulator.
Any other fix?
Xcode-Build phases
check the scripts wheacher contain codes or not look like this to Removex86_64Andi386Framework:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[#]}"
rm "${EXTRACTED_ARCHS[#]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
delete the shell script and clean the project then run again.

Jenkins, SSH plugin, 0 files transferred

We are a group of three doing a project using MEANJS, Bitbucket is our source control and we are using Jenkins for test automation and CI. We want to use Jenkins to pull from Bitbucket, build and run tests and then deploy the project via SSH to another machine.
We have a connection between Bitbucket and Jenkins, Jenkins is hosted on a windows server, after that we want to deploy our project via SSH and we are able to connect to our CentOS server using SSH, the connection is a success but the transfer always has 0 files:
Started by user Centris
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Evert
> C:\Program Files (x86)\Git\cmd\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files (x86)\Git\cmd\git.exe config remote.origin.url https://evertJenkins:teamEvert#bitbucket.org/evert-team/evert.git # timeout=10
Fetching upstream changes from https://evertJenkins#bitbucket.org/evert-team/evert.git
> C:\Program Files (x86)\Git\cmd\git.exe --version # timeout=10 using .gitcredentials to set credentials
> C:\Program Files (x86)\Git\cmd\git.exe config --local credential.helper store --file=\"C:\Users\centris\AppData\Local\Temp\git2236090933781388612.credentials\" # timeout=10
> C:\Program Files (x86)\Git\cmd\git.exe fetch --tags --progress https://evertJenkins#bitbucket.org/evert-team/evert.git +refs/heads/*:refs/remotes/origin/*
> C:\Program Files (x86)\Git\cmd\git.exe config --local --remove-section credential # timeout=10
> C:\Program Files (x86)\Git\cmd\git.exe rev-parse "origin/master^{commit}" # timeout=10
Checking out Revision b0ca93376cb8b1799a069a7e33e212ebc886261a (origin/master)
> C:\Program Files (x86)\Git\cmd\git.exe config core.sparsecheckout # timeout=10
> C:\Program Files (x86)\Git\cmd\git.exe checkout -f b0ca93376cb8b1799a069a7e33e212ebc886261a
> C:\Program Files (x86)\Git\cmd\git.exe rev-list b0ca93376cb8b1799a069a7e33e212ebc886261a # timeout=10
> C:\Program Files (x86)\Git\cmd\git.exe tag -a -f -m Jenkins Build #39 jenkins-Evert-39 # timeout=10
SSH: Connecting from host [centris]
SSH: Connecting with configuration [Centris leit] ...
SSH: Disconnecting configuration [Centris leit] ...
SSH: Transferred 0 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
SSH: Connecting from host [centris]
SSH: Connecting with configuration [Centris leit] ...
SSH: Disconnecting configuration [Centris leit] ...
SSH: Transferred 0 file(s)
Finished: SUCCESS
Our project is named Evert and thus it is located under workspace\Evert.
We have tried all forms of strings for our source files, from a full path down to what we have now that is:
Evert\**\*
We also have remove prefix set as:
Evert\
we have tried following this: Jenkins transferring 0 files using publish over SSH plugin but we still have the same problem. Can anyone please tell us what might be the problem.
You could simply archive it and scp the archive to the CentOS machine. Not all Jenkins plugins are created equal.
I had this problem and found 2 issues:
the files in the transfer set are relative to the job workspace. So you just use **
setting a destination directory in the SSH server setup and on the SSH server in the build configuration causes it to double the path (i.e. /tmp in both places results in /tmp/tmp)