Gitversion not working on teamcity - FAKE - f#

I am trying to use below code to get the git version no , on my local machine it is working fine , but on teamcity it is giving an error .
here is the code :
open GitVersionHelper
// version
let version = GitVersion id
printfn "##teamcity[buildNumber '%s']" version.FullSemVer
let major = version.Major.ToString()
let minor = version.Minor.ToString()
let patch = version.Patch.ToString()
and when I see my build log on teamcity , it shows :
System.Exception: GitVersion.exe failed with exit code 1
Fake.GitVersionHelper.GitVersion#62.Invoke(String message)
Fake.GitVersionHelper.GitVersion(FSharpFunc`2 setParams)
is this related to the missing libraries or what ?

Related

Pull Git Repository using Bazel returns git_repository is not defined

I'm trying to build my project running Bazelbuild //... but I'm getting the following error
CPTI/WORKSPACE:1:1: name 'git_repository' is not defined
There's my WORKSPACE file:
git_repository(
name = "org_pubref_rules_protobuf",
remote = "https://github.com/pubref/rules_protobuf",
tag = "v0.8.1",
# commit = "d9523f3d443b6a4f3fabc72051d84eb5474d7745"
)
load("#org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories")
#cpp_proto_repositories()
#BTW, #org_pubref_rules_protobuf already contains #com_google_googletest
load("//tools/build_defs:externals.bzl",
"new_patched_http_archive",
)
# The sparsehash BUILD is copied from https://github.com/livegrep/livegrep
new_patched_http_archive(
name = "com_github_sparsehash",
url = "https://github.com/sparsehash/sparsehash/archive/sparsehash-2.0.3.tar.gz",
sha256 = "05e986a5c7327796dad742182b2d10805a8d4f511ad090da0490f146c1ff7a8c",
build_file = "//third_party:BUILD.sparsehash",
strip_prefix = "sparsehash-sparsehash-2.0.3/",
patch_file = "//third_party:sparsehash.patch",
)
I found another post with the answer Solve dependency issue when using gRPC cpp in bazel
I added and it worked. Sorry, I didn't found it before.
load("#bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

Issues with building a package with Rstan and RcppArmadillo

I have experienced the following problem during the process of building my package. I tried to search for a solution but was unsuccessful. In order to make the error reproducible, I present a minimal package that could generate the same error.
I started a package with the name mypkg, then I use usethis::use_rcpp and usethis::use_rcpp_armadillo. After that I add the following script in \src folder (which is copied from internet)
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::export]]
arma::vec getEigenValues(arma::mat M) {
return arma::eig_sym(M);
}
After that, I add an R shell to export the function using Roxygen. So far the package can be successfully documented and built.
Then I continue to add features of Rstan by using rstantools::use_rstan, and follow the steps on Step by step guide for creating a package that depends on RStan, and create lm.stan and lm_stan.R as instructed. Then I built the package again but it throws out an error. Here are the results of executing
.Last.error.trace
1. devtools:::document()
2. withr::with_envvar(r_env_vars(), roxygen2::roxygenise(pkg$path, ...
3. base:::force(code)
4. roxygen2::roxygenise(pkg$path, roclets, load_code = load_code)
5. roxygen2:::load_code(base_path)
6. pkgload::load_all(path, helpers = FALSE, attach_testthat = FALSE)
7. pkgbuild::compile_dll(path, quiet = quiet)
8. pkgbuild:::install_min(path, dest = install_dir, components = "libs", ...
9. pkgbuild:::rcmd_build_tools("INSTALL", c(path, paste("--library=", ...
10. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env, ...
11. withr::with_path(rtools_path(), code)
12. base:::force(code)
13. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, ...
14. callr:::run_r(options)
15. base:::with(options, with_envvar(env, do.call(processx::run, ...
16. base:::with.default(options, with_envvar(env, do.call(processx::run, ...
17. base:::eval(substitute(expr), data, enclos = parent.frame())
18. base:::eval(substitute(expr), data, enclos = parent.frame())
19. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, ...
20. base:::force(code)
21. base:::do.call(processx::run, c(list(bin, args = real_cmdargs, ...
22. (function (command = NULL, args = character(), error_on_status = TRUE, ...
23. throw(new_process_error(res, call = sys.call(), echo = echo, ...
x System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr (last 10 lines):
E> In file included from C:/Users/Jasper/Documents/R/win-library/3.6/rstan/include/rstan/rstaninc.hpp:3:0,
E> from stanExports_lm.h:20,
E> from stanExports_lm.cc:5:
E> C:/Users/Jasper/Documents/R/win-library/3.6/rstan/include/rstan/stan_fit.hpp:11:28: fatal error: stan/version.hpp: No such file or directory
E> #include <stan/version.hpp>
E> ^
E> compilation terminated.
E> make: *** [C:/PROGRA~1/R/R-36~1.2/etc/x64/Makeconf:213: stanExports_lm.o] Error 1
E> ERROR: compilation failed for package 'mypkg'
E> * removing 'C:/Users/Jasper/AppData/Local/Temp/RtmpwXHySZ/devtools_install_1d18454066b0/mypkg'
Could anyone suggest what the problem is? Here is my makevars file
CXX_STD = CXX11
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
However, when I follow the steps of the guide to create a package just with Rstan, it could be successfully built, but not when I also want to use RcppArmadillo.
Thank you very much for your kind help!!

Jenkins Windows Batch Script failing to find COM object

I have a script that updates an Install Shield .ism file (via InstallShield Automation Interface (2015)) with a version and ProductCode.
Dim projFile, projVersion
'check for arguments
If Wscript.Arguments.Count < 2 Then
WScript.Echo "InstallShield Version Utility" & _
vbNewLine & "1st argument is the full path to the .ism file" & _
vbNewLine & "2nd argument is the new version number Major.Minor.Build"
WScript.Quit 1
End If
'get the args
projFile = WScript.Arguments(0)
projVersion = WScript.Arguments(1)
'Create the end-user automation object
Dim ISWIProject
Set ISWIProject = CreateObject("ISWiAuto22.ISWiProject"): CheckError
'Open the project specified at the command line
ISWIProject.OpenProject projFile: CheckError
'change the product code to force major upgrades
Dim guidProductCode
guidProductCode = ISWIProject.GenerateGUID
ISWIProject.ProductCode = guidProductCode
'update the version
ISWIProject.ProductVersion = projVersion
'Save and close the project
ISWIProject.SaveProject: CheckError
ISWIProject.CloseProject: CheckError
WScript.Echo "Updated guid to: " & guidProductCode & ", version to: " & projVersion
Sub CheckError()
Dim message, errRec
If Err = 0 Then Exit Sub
message = Err.Source & " " & Hex(Err) & ": " & Err.Description
WScript.Echo message
WScript.Quit 2
End Sub
I call this script with
cscript //Nologo setInstallShieldVersion.vbs <ISMPath> <VersionNumber>
When I run this via a command line on the machine (with the same user as my Jenkins service), it works fine and runs the script. However when Jenkins runs it via a Windows batch command, it gives the error
setInstallShieldVersion.vbs(17, 1) Microsoft VBScript runtime error: File not found: 'CreateObject'
the script used to work, then I had to update Jenkins (and subsequently rolled it back when the script started failing). Maybe that's part of the issue?
I've tried dumping the environmental variables with SET in both instances, and all the environmental variables are the same (except some Jenkins-specific ones). I've registered the DLL with regsvr32 multiple times. In both instances they are running in 32 bit processes. I've even opened up the permissions on the .dll (ISWiAutomation22.dll). Any other ideas on why it would work when running it one way and not the other?

Buildbot nightly build is failing to checkout the branch

I am using buildbot for building and testing chromium source. We have a local repo maintained for chromium source. We are using Gerrit for maintaining the repository. The buildbot gets successfully triggered when some change is checked in.
I am facing problem with Nightly builds. I want the buildbot to get the source and build, even when there is no change. But, it fails with the following error:
===Running git checkout --force origin/ ===
error: pathspec 'origin/' did not match any file(s) know to git.
===Failed in 0.0. mins===
Can somebody tell me how to get this working?
My master.cfg is as below:
from master import master_utils
from master import slaves_list
from buildbot.schedulers import timed
from buildbot.changes import filter
import config
import master_site_config
ActiveMaster = master_site_config.Chromium
c = BuildmasterConfig = {}
c['change_source'] = []
c['schedulers'] = []
c['status'] = [] pendingRequests = {}
c['builders'] = []
import master_source_cfg
import master_full_cfg
master_source_cfg.Update(config, ActiveMaster, c)
master_full_cfg.Update(config, ActiveMaster, c)
c['logCompressionLimit'] = False
c['projectName'] = ActiveMaster.project_name
c['projectURL'] = config.Master.project_url
c['buildbotURL'] = 'build.chromium.org/p/chromium/';
slaves = slaves_list.SlavesList('slaves.cfg', 'Chromium')
# Trying to find the location of adding factories to the builder
from twisted.python import log
for builder in c['builders']:
log.msg('My BUILDER',builder)
log.msg(dir(builder['factory']))
builder['slavenames'] = slaves.GetSlavesName(builder=builder['name'])
c['slaves'] = master_utils.AutoSetupSlaves(
c['builders'],
config.Master.GetBotPassword(),
missing_recipients=['buildbot#chromium-build-health.appspotmail.com'])
master_utils.VerifySetup(c, slaves)
master_utils.AutoSetupMaster(c, ActiveMaster, enable_http_status_push=ActiveMaster.is_production_host)
c['buildHorizon'] = 3000
c['logHorizon'] = 3000
c['eventHorizon'] = 200
I had missed to add the last part of the master.cfg which contains the configuration for nightly:
c['schedulers'].append(
timed.Nightly(name='nightly',
branch='src',
change_filter=filter.ChangeFilter(project_re='pj/Sample/chromium.*', branch=['buildbot-testing1']),
builderNames=['Linux x64'],
hour=8,
minute=15))
With the above configuration, the nightly gets triggered at the correct time.
But, it is not checking out the 'buildbot-testing1' branch as needed.
Instead, it exits with the following error:
===Running git checkout --force origin/ ===
error: pathspec 'origin/' did not match any file(s) know to git.
===Failed in 0.0. mins===

HHVM+Hacklang: errors/warnings output into browser

Is there any way to tell HHVM to output Hacklang warnings and errors into the browser? Something like PHP does with enabled display_errors, display_startup_errors and error_reporting set to E_ALL
HHVM version:
$ php -v
HipHop VM 3.1.0-dev+2014.04.09 (rel)
Compiler: heads/master-0-g4fc811c64c23a3686f66a2bea80ba47f3eaf9f3d
Repo schema: 79197c935790c0b9c9cb13566c3e727ace368117
I've tried the following config:
$ cat /etc/hhvm/php.ini
; php options
display_startup_errors = On
error_reporting = E_ALL
display_errors = On
; hhvm specific
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
And :
$ cat /etc/hhvm/server.ini
; php options
pid = /var/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.mysql.typed_results = false
hhvm.debug.full_backtrace = true
hhvm.debug.server_stack_trace = true
hhvm.debug.server_error_message = true
hhvm.debug.translate_source = true
tl;dr: You can't.
The thing to keep in mind here is that the typechecker does a static analysis of your code while the PHP errors you talk about show up at runtime. If this was C++, you could compare the Hack typechecker errors with the errors during the compile step - so Hack tells you things that are wrong before the code even runs.
The trick is to use either the vim or emacs plugins which warn you of errors as you save the file, or use hh_client from the terminal, or build a plugin for your favorite IDE (feel free to send pull requests!). hh_client --json gives an easy to parse output if you want to build a plugin for Sublime Text, or Eclipse or whatever you want.
Note that some errors are runtime errors, while some aren't. Function args as well as return types should throw exceptions at runtime for the latest HHVM build for example. The problem there is that you only see those errors when you hit a certain code-path. The beauty of Hack is that it errors for all the problems in your code, even if it's a code-path you may not test at runtime.

Resources