I'm trying to build libgrpc as a nixpkg on OS X.
It depends on zlib, protobuf >= 3.0 and openssl >= 1.0.2.
How can I specify these versions as the minimum? Both are contained in the official channel and both built successfully.
I'm pretty new to nix and this is my attempt to get my feet wet.
For now, this is what I have for default.nix:
{ stdenv, fetchurl, zlib, openssl, protobuf }:
stdenv.mkDerivation rec {
name = "libgrpc-0.10.1";
src = fetchurl {
url = "https://github.com/grpc/grpc/archive/release-0_10_1.tar.gz";
sha256 = "2da8deef4fcc421ce8e9102e8531261b3c23073ab4d2bf459e549ed4e37b5ba1";
};
buildInputs = [zlib "openssl-1.0.2d" "protobuf-3.0.0-alpha-3.1"];
meta = {
homepage = "https://github.com/grpc/grpc/";
version = "0.10.1";
description = "A library for a RPC service based on HTTP/2 and protobuf";
license = stdenv.lib.licenses.bsd3;
platforms = [
"i686-linux"
"x86_64-linux"
"x86_64-darwin"
"i686-cygwin"
"i686-freebsd"
"x86_64-freebsd"
"i686-openbsd"
"x86_64-openbsd"
];
downloadPage = "https://github.com/grpc/grpc/archive/release-0_10_1.tar.gz";
};
}
I'm either looking for a way to either build libgrpc > 0.10 under nix - or for a wayto define minimum versions for requirements so I can try to fix this myself.
Thanks!
A look inside all-packages.nix showed that these versions are available as openssl_1_0_2 and protobuf3_0.
I'm still stuck at a zlib-dependency problem, but the problem I asked about is solved.
Related
I am following https://docs.substrate.io/tutorials/v3/forkless-upgrades/ and have added
pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.19" } to my Cargo.toml.
It seems that this appears to be a newer version and requires me to specify NoPreimagePostponement and PreimageProvider in pallet_scheduler::Config.
Here is the exact error message:
error[E0046]: not all trait items implemented, missing: PreimageProvider, NoPreimagePostponement
What should I set those value to be? https://docs.rs/pallet-scheduler/latest/pallet_scheduler/trait.Config.html doesn't seem to also have those properties and I'm guessing that the crate hasn't been published yet.
The associated pull request mentions the changes necessary. In short, just set the following to imitate the desired behavior:
type PreimageProvider = ();
type NoPreimagePostponement = ();
I've use the below bazel rule to build static libraries with bazel:
def _cc_static_library_impl(ctx):
cc_deps = [dep[CcInfo] for dep in ctx.attr.deps]
libraries = []
for cc_dep in cc_deps:
for link_input in cc_dep.linking_context.linker_inputs.to_list():
for library in link_input.libraries:
libraries += library.pic_objects
args = ["r", ctx.outputs.out.path] + [f.path for f in libraries]
ctx.actions.run(
inputs = libraries,
outputs = [ctx.outputs.out],
executable = "/usr/bin/ar",
arguments = args,
)
return [DefaultInfo()]
cc_static_library = rule(
implementation = _cc_static_library_impl,
attrs = {
"deps": attr.label_list(providers = [CcInfo]),
},
outputs = {"out": "lib%{name}.a"},
)
How can I extract the command to use from the current toolchain instead of using the hardcoded /usr/bin/ar? I've based the rule on what I've found on the internet and I have very limited knowledge about this. This example seems to do something related:
https://github.com/bazelbuild/rules_cc/blob/main/examples/my_c_archive/my_c_archive.bzl
This is the relevant part of my_c_archive:
archiver_path = cc_common.get_tool_for_action(
feature_configuration = feature_configuration,
action_name = CPP_LINK_STATIC_LIBRARY_ACTION_NAME,
)
That gets you the path, and then you need to add cc_toolchain.all_files to your ctx.actions.run call, so it ends up looking like this:
ctx.actions.run(
inputs = depset(
direct = [libraries],
transitive = [
cc_toolchain.all_files,
],
),
outputs = [ctx.outputs.out],
executable = archiver_path,
arguments = args,
)
However, you'll also notice that my_c_archive builds up a command line and environment variables to call the archiver with. A simple toolchain won't have anything to pass in either of those, but a more complex one may not work correctly without adding them (for example, passing -m32 or setting PATH).
Part of the starlark implementation of cc_import in _create_archive_action in cc_import.bzl is a good place to start for handling all the intricacies. It creates an action to produce a static library from a set of object files, with flexibility to work with many toolchains.
I am finishing off building an mvc web application using .net core 2.0 with vs2017 on Win10.In writing an 'About' page I looked to put in the current project version number (at present still set at 1.0.0). I would have thought that pretty straightforward!
The only reference I could find suggested:
AppVersion = typeof(RuntimeEnvironment).GetTypeInfo ().Assembly
.GetCustomAttribute<AssemblyFileVersionAttribute> ().Version;
However, this returns, in my case, '4.6.25814.01' - not what is required.
Can anyone suggest how to retrieve the version in code, please?
I assume that I want the 'Package Version' but admit I am not clear on the distinction between/how one would use 'Package Version', 'Assembly Version' and 'Assembly File Version'.
When you call typeof(RuntimeEnvironment).Assembly, you're querying the containing assembly of that type. In this case this would be System.Runtime.InteropServices.dll or Microsoft.Dotnet.PlatformAbstractions.dll, depending on the namespace you've imported.
To get the information of your own assembly, you could simply replace RuntimeEnvironment with one of your own types, for example
var appVersion = typeof(Program).Assembly
.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
or even
var appVersion = typeof(HomeController).Assembly
.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
This would return "6.6.7.0" if the Package version if your project is set as follows:
You were close!
Here you can find more information on reflection for .NET in general, but it should work fine for .NET Core.
Tried on version 2.0
using System.Reflection;
var appVersion = string.Empty;
var customAttribute = typeof(Program).Assembly.GetCustomAttributes(false).SingleOrDefault(o => o.GetType() == typeof(AssemblyFileVersionAttribute));
if (null != customAttribute)
{
if (customAttribute is AssemblyFileVersionAttribute)
{
var fileVersionAttribute = customAttribute as AssemblyFileVersionAttribute;
appVersion = fileVersionAttribute.Version;
}
}
AssemblyFileVersionAttribute type is in System.Reflection namespace.
So I have a Bintray repository, but I'm having difficulty uploading to it from gradle. Well, what I mean is version management is not working how I want it, currently for every single .jar I upload, I have to increment the version in my configuration, and dependencies. I know this is not how it's supposed to be done. My question is how do I automate/implement VCS tagging with Bintray. Right now my configuration for uploading looks like so (using the bintray plugin):
bintray {
user = "$bintrayUser"
key = "$bintrayKey"
publications = ['maven']
dryRun = false
publish = true
pkg {
repo = "$targetBintrayRepo"
name = "$targetBintrayPackage"
desc = ''
websiteUrl = "$programWebsiteUrl"
issueTrackerUrl = "$programIssueUrl"
vcsUrl = "$programVcsUrl"
licenses = ["$programLicense"]
labels = []
publicDownloadNumbers = true
version {
name = "$programVersion"
released = new java.util.Date()
vcsTag = "$programVcsTag"
}
}
}
And my variables are:
def programVersion = '0'
def programVcsTag = '0.0.0'
def programGroup = 'com.gmail.socraticphoenix'
def targetBintrayRepo = 'Main'
def targetBintrayPackage = 'java-api'
def programLicense = 'MIT'
def programWebsiteUrl = 'https://github.com/meguy26/PlasmaAPI'
def programIssueUrl = 'https://github.com/meguy26/PlasmaAPI/issues'
def programVcsUrl = 'https://github.com/meguy26/PlasmaAPI.git'
Yet here no tags appear, and running publish again (even with a different vcs tag) results in a version already exists error. (Could not upload to 'https://api.bintray.com/content/meguy26/Main/java-api/0/com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar': HTTP/1.1 409 Conflict [message:Unable to upload files: An artifact with the path 'com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar' already exists])
Sorry if I'm being noobish, but I don't understand why its not working, I filled out all the appropriate variables (I thought)
Bintray does not support multiple tags per version. Version is a unique string. If you want to release something from the same version with different tags, compose a Bintray version string with from your program version and tag, e.g. "$programVersion-$programVcsTag"
Not a question but a information.
If you are having issues with processor ATOS failing because of the lack of the cavvAlgorithm not being send then check that the module WSDL is updated to the latest version, current version i can find is 1.111 not 1.26
Url is in 2 files:
app\code\core\Mage\Cybersource\Model\Soap.php
If using CybersourceAuth extension:
CybersourceAuth\Model\Api.php
change the constants from
const WSDL_URL_TEST = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl';
const WSDL_URL_LIVE = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl';
to
const WSDL_URL_TEST = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.111.wsdl';
const WSDL_URL_LIVE = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.111.wsdl';
If you are having issues with processor ATOS failing because of the lack of the cavvAlgorithm not being send then check that the module WSDL is updated to the latest version, current version i can find is 1.111 not 1.26
Url is in 2 files:
app\code\core\Mage\Cybersource\Model\Soap.php
If using CybersourceAuth extension:
CybersourceAuth\Model\Api.php
change the constants from
const WSDL_URL_TEST = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl';
const WSDL_URL_LIVE = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl';
to
const WSDL_URL_TEST = 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.111.wsdl';
const WSDL_URL_LIVE = 'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.111.wsdl';