Cake Addins install fail error during build - build

I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies compatible with .NETFramework,Version=v4.6.1.
Error: Failed to install addin 'Cake.Npm'.
When I use cake.npm version as 0.17.0 for cake 0.38.2, it generates two folders - cake.npm and cake.npm0.17.0. Only cake npm0.17.0 is required, because it has netstandard2.0 which can make build successful. But the other folder makes it fail

As discussed in https://github.com/cake-contrib/Cake.Npm/issues/140 Cake.Npm is not the culprit, here.
There is an additional (#load) reference in the project to Cake.Sitecore in version 1.0.3 which in contents/scripts/tasks.restore.cake contains the line
#addin "Cake.Npm"
This - without an explicit version being set - will always default to the newest version (currently 2.0.0, which is incompatible with Cake 0.38.2).
The current version of Cake.Sitecore (1.0.27) has that problem fixed.

Related

Could not load file or assembly System.Reflection.TypeExtensions

I got below exception while running xunit test projects which works under VS 2017 15.3
[2017/12/4 23:08:40 Error] [xUnit.net 00:00:00.0033291] xxx.Test: Catastrophic failure: System.TypeInitializationException: The type initializer for 'Xunit.DiaSession' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.TypeExtensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Xunit.DiaSession..cctor()
--- End of inner exception stack trace ---
at Xunit.DiaSession..ctor(String assemblyFileName)
at Xunit.DiaSessionWrapper..ctor(String assemblyFilename)
at Xunit.XunitFrontController..ctor(AppDomainSupport appDomainSupport, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink)
at Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner.RunTestsInAssembly(IRunContext runContext, IFrameworkHandle frameworkHandle, LoggerHelper logger, IMessageSinkWithTypes reporterMessageHandler, AssemblyRunInfo runInfo)
My current VS 2017 version is 15.4.5.
I have tried the work around which has been provided previously, but none did not work. And I have try to downgrade my VS 2016 to 15.3, but I could not find the 15.3 package to install. I have tried to install xunit to latest version.
Any help would be appreciated.
Update:
Project Type:xUnit Test Project(.NET Core)
Target: net 461
It seems VS 2017 fail to load specific "xunit.runner.visualstudio", after checking VS2017 15.4.2 - Unable to run tests for projects targeting .NET Framework 4.6.x #1542 again, I deleted the "%TEMP%\VisualStudioTestExplorerExtensions", create a new Xunit project, change the nonworked.csproj xunit.runner.visualstudio from 2.2.0 to 2.3.1, it works now. Not sure why it did not work when I try it previous.
Hope it will help others.
You need to install System.Reflection.TypeExtensions using VS Package Manager using the following command:
Install-Package System.Reflection.TypeExtensions -Version 4.5.1
for more information please review the following link
System.Reflection.TypeExtensions

Compiling native node addon with c++ 17 inside fails during npm install on ubuntu

I have native add-on for nodejs that uses c++17 features, specifically "shared_mutex".
When I call npm install which downloads and compiles the add-on i get an error:
The linux machine has GCC 6.0 installed.
My Binding.gyp uses the following config to catch os type and add flags accordingly:
'conditions': [
['OS=="linux"', {
'CXXFLAGS': [
'-std=c++1z'
]}],
** i've also tried with '-std=c++17', '-std=c++1z'.
What am I missing?
Update:
1. Updated ubuntu 16.04 to GCC 16.04 and made it default.
2. It seems that when i try to compile it manualy using node-gyp rebuild "CXXFLAGS='-std=c++17'" it works and brings only one error:
"shared_,utex in namespace std does not name a type std::shared_mutex file mutex" (the last error)
Problem solved. For anyone who has the same issue, bind.gyp should use cflags_cc instead of cxxflags.

Xamarin linker error with AWSSDK

I have a Xamarin forms mobile project (Android and iOS).
When I try to install the AWSSDK.S3 to access Amazon services, I get the following linker error when trying to build iOS:
Failed to resolve "System.Void Amazon.Runtime.Internal.Util.AESEncryptionPutObjectStream::.ctor(System.IO.Stream,System.Byte[],System.Byte[])" reference from "AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604"
..Android build has a similar error.
I have the following libraries installed:
AWSSDK.S3 v3.1.1.1
AWSSDK.Core v3.3.4
AWSSDK.SecurityToken v3.3.0.2
AWSSDK.CognitolIdenity v3.3.0.2
AWSSDK.CognitoIdentityProvider v3.3.1.2
PCLCrypto v2.0.147
PCLStorage v1.0.2
the only code in my project is:
var amazonClient = new AmazonS3Client();
Any ideas?
possible (bad) workaround that seems to work:
change in Linker Options/Linker behavior:
to: Don't link
instead of: Link SDK Assemblies only
The answer turns out to be found here:
Xamarin Forms IOS Failed to load assembly System.Net.Http.Primitive
even though its a different assembly error, the fix is the same:
update all the AWS.Core to the latest version: v3.3.6 in my case
install Microsoft.Bcl.Build v1.0.21
install Microsoft.Net.Http v2.2.29
Rolling back to AWSSDK.S3 V3.1.10 worked for me, done using the NuGet manager in Visual Studio. =)

Unable to install Anaconda environment containing anaconda 4.0.0 np110py27_0

In Anaconda I am trying to create an environment using an environment.yml file which begins with the lines:
name: mytest
dependencies:
- anaconda=4.0.0=np110py27_0
However when trying to create the environment, I get the error:
Fetching package metadata .........
Solving package specifications: ....
Error: The following specifications were found to be in conflict:
- anaconda 4.0.0 np110py27_0
Use "conda info <package>" to see the dependencies for each package.
I encountered no problems when I did this seven days ago, but when I tried this yesterday I got the error.
I am running on Windows 7 64-bit as administrator, Anaconda 2.2.0 (Python 2.7 version). The "conda list" output includes conda 4.1.11 and conda-env 2.5.2.
To try to isolate the error, I installed Miniconda2 on a different 64-bit Windows 7 computer (as administrator) that had never had any Anaconda/Miniconda installed before. This is the most recent 64-bit Python 2.7 series (Miniconda2-4.1.11-Windows-x86_64.exe).
But trying to install anaconda=4.0.0=np110py27_0, either to a new environment or to the root environment, both produce the same error I received before:
C:\>conda install anaconda=4.0.0=np110py27_0
Fetching package metadata .........
.Solving package specifications: ....
The following specifications were found to be in conflict:
- anaconda 4.0.0 np110py27_0
Use "conda info <package>" to see the dependencies for each package.
C:\>conda create --name test400 anaconda=4.0.0=np110py27_0
Fetching package metadata .........
.Solving package specifications: ....
The following specifications were found to be in conflict:
- anaconda 4.0.0 np110py27_0
Use "conda info <package>" to see the dependencies for each package.
How can I determine what is causing the conflict, and how could I resolve it, given that conda is not naming a second package in its error message? I have seen responses to other "specifications in conflict" questions in which the answer is often "Install the problematic package to a separate python environment", but in this case the new environment could not be created with the package. Starting from a clean Miniconda install did not work either. I suspect something has changed in the Anaconda repository (which would be consistent with the original environment.yml working in the past but not now), but how would I determine if this is the underlying issue?
Thanks.
The underlying issue was a temporary error in the https://repo.continuum.io/pkgs/free/win-64/repodata.json file, which has since been fixed.
For reference for anyone investigating Anaconda dependency conflicts, here are the details of the investigation, and the workaround for this case:
The cause:
The repodata.json file (linked above) is essentially a 'master list' of the dependencies of the various libraries in https://repo.continuum.io/pkgs/free/win-64/. The "conda" command uses this repodata.json file.
While the problem was occurring, the repodata.json file incorrectly listed "_nb_ext_conf" as a dependency for each version of ipywidgets. (The /info/index.json file inside "ipywidgets-4.1.1-py27_0.tar.bz2" did not list "_nb_ext_conf" as a dependency, however I think newer versions of ipywidgets require it.)
The "_nb_ext_conf-0.2.0-py27_0.tar.bz2" and "_nb_ext_conf-0.3.0-py27_0.tar.bz2" files list "notebook >=4.2.0" as a dependency in their info/index.json files.
The info/index.json file in anaconda-4.0.0-np110py27_0.tar.bz2 file (which is used when you specify "anaconda=4.0.0=np110py27_0" in an environment.yml) lists "ipywidgets 4.1.1 py27_0" as a dependency.
Due to the temporary problem in repodata.json, this "ipywidgets 4.1.1 py27_0" caused conda to think "_nb_ext_conf" needed to be installed, thus causing conda to think "notebook >=4.2.0" also needed to be installed.
But the info/index.json file in anaconda-4.0.0-np110py27_0.tar.bz2 file also specifies that the specific version "notebook 4.1.0 py27_2" must be installed.
The conflicting requirements for "notebook" versions (4.1.0 and >=4.2.0) caused the "specifications were found to be in conflict" error.
The workaround:
First, remove the line "- anaconda=4.0.0=np110py27_0" from the environment.yml file.
Next, replace that line in environment.yml with every library listed in the "depends" section of the info/index.json file from anaconda-4.0.0-np110py27_0.tar.bz2. (Remove the quotation marks, replace the spaces with equals signs, etc. to convert the .json syntax to the environment.yml syntax.)
Finally, remove the "- notebook=4.1.0=py27_2" line from this list.
This new environment.yml file will now list every library which would have been installed by "anaconda=4.0.0=np110py27_0", with the exception of "notebook", but "notebook" will get installed anyway due to the "notebook >=4.2.0" requirement in "_nb_ext_conf" due to "ipywidgets", and/or the "notebook" requirement in "ipywidgets" itself.
Investigative tools:
The command "conda info anaconda=4.0.0=np110py27_0" gives the list of libraries required by the specified package, according to repodata.json. I put this list of libraries into a temporary_environment.yml file. Attempting to create an environment from that temporary_environment.yml file caused conda to specify that "notebook" was involved in the conflict, which gave the hint to try omitting "notebook".
Running "conda info" lists all the libraries currently installed in the active environment. The output for the environment created by temporary_environment.yml was compared to the output from an environment from a computer where "anaconda=4.0.0=np110py27_0" had previously installed successfully. This highlighted "_nb_ext_conf" as one difference.
I created a batch file which ran "conda info" for every library listed in anaconda=4.0.0=np110py27_0, and I looked for instances of "notebook" and "_nb_ext_conf" in the output. This pointed to "ipywidgets" as a suspect.

yesod persistent dependencies missing

I have tried to follow the Yesod quick start from the official website, but when running yesod devel (after installation and running yesod init) it fails to build due to a missing dependency if I use sqlite, postgresql, postgresql+fay or mysql (the 'simple' option from yesod-init works fine).
The error messages given are:
For sqlite:
cabal: At least the following dependencies are missing:
persistent-sqlite ==1.3.*
For postgresql:
cabal: At least the following dependencies are missing:
persistent-postgresql ==1.3.*
For postgres + fay:
cabal: At least the following dependencies are missing:
fay >=0.16, persistent-postgresql ==1.3.*, yesod-fay >=0.5.0.1
For mysql:
cabal: At least the following dependencies are missing:
persistent-mysql ==1.3.*
For mongoDB:
cabal: At least the following dependencies are missing:
persistent-mongoDB ==1.3.*
Does anyone know what is going wrong and how it can be fixed?
Update:
I was able to fix some of the problems by installing, separately from the yesod-platform, some of the missing dependencies.
cabal install persistent-sqlite fixed any problems using sqlite.
cabal install persistent-postgresql and cabal install persistent-mysql worked after installing some extra distribution packages to my Mint 16 system (libpq-dev and libmysqlclient-dev).
cabal install persistent-mongodb failed with an error I could not resolve:
Resolving dependencies...
Configuring persistent-mongoDB-1.3.1...
Building persistent-mongoDB-1.3.1...
Preprocessing library persistent-mongoDB-1.3.1...
[1 of 1] Compiling Database.Persist.MongoDB ( Database/Persist/MongoDB.hs, dist/build/Database/Persist/MongoDB.o )
Database/Persist/MongoDB.hs:420:26:
Not in scope: type constructor or class `MonadThrow'
Failed to install persistent-mongoDB-1.3.1
cabal: Error: some packages failed to install:
persistent-mongoDB-1.3.1 failed during the building phase. The exception was:
ExitFailure 1
Does anybody know how to resolve this issue?
Update:
This final problem has been solved by the maintainer updating the cabal package.
There is a new version without this error (I have installed persistent-mongoDB-1.3.1.1, the previous version had the error you found).
Do a cabal update to refresh the packages list and try again.