Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Initial coreclr and build tooling#612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
djoyce82 wants to merge18 commits intopythonnet:masterfromdjoyce82:master
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
c98d6fb
Initial coreclr and build tooling
Jan 24, 2018
8bc01ad
Init variables outside of loop to avoid C compiler error
Feb 1, 2018
48b18a4
Merge branch 'master' into master
den-run-aiFeb 10, 2018
fc30255
Revert netstandard2.0 Python.Runtime.dll for Windows
Feb 14, 2018
1f7ebd8
Remove unused _WIN32 strdup
Mar 8, 2018
1126819
Merge branch 'master' into master
filmorMay 28, 2018
c2cd097
Merge branch 'master' into master
den-run-aiJun 12, 2018
070a7fc
Merge branch 'master' into master
den-run-aiAug 23, 2018
55171b9
Merge branch 'master' into master
filmorOct 16, 2018
5425eb7
Merge branch 'master' into master
filmorOct 17, 2018
b4b36fc
Merge branch 'master' into master
den-run-aiOct 20, 2018
0e0f71f
Merge branch 'master' into master
den-run-aiDec 31, 2018
4c19515
Merge branch 'master' into master
filmorMar 6, 2019
58ac99d
Merge branch 'master' into master
filmorMar 19, 2019
0670bde
Merge branch 'master' into master
filmorApr 8, 2019
9bea24d
Merge branch 'master' into master
filmorMay 8, 2019
ea48a09
Merge branch 'master' into master
filmorSep 12, 2019
149e4e5
Merge branch 'master' into master
filmorOct 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletionsetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -362,8 +362,10 @@ def build_extension(self, ext):
),
shell=use_shell,
)
if DEVTOOLS == "Mono" or DEVTOOLS == "dotnet":
if DEVTOOLS == "Mono":
self._build_monoclr()
if DEVTOOLS == "dotnet":
self._build_coreclr()

def _get_manifest(self, build_dir):
if DEVTOOLS != "MsDev" and DEVTOOLS != "MsDev15":
Expand DownExpand Up@@ -403,6 +405,19 @@ def _build_monoclr(self):

build_ext.build_ext.build_extension(self, clr_ext)

def _build_coreclr(self):
# build the clr python module
clr_ext = Extension(
"clr",
sources=[
"src/coreclr/pynetinit.c",
"src/coreclr/clrmod.c",
"src/coreclr/coreutils.c",
],
)

build_ext.build_ext.build_extension(self, clr_ext)

def _install_packages(self):
"""install packages using nuget"""
use_shell = DEVTOOLS == "Mono" or DEVTOOLS == "dotnet"
Expand Down
70 changes: 70 additions & 0 deletionssrc/coreclr/clrmod.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
#include "pynetclr.h"

/* List of functions defined in the module */
static PyMethodDef clr_methods[] = {
{NULL, NULL, 0, NULL} /* Sentinel */
};

PyDoc_STRVAR(clr_module_doc,
"clr facade module to initialize the CLR. It's later "
"replaced by the real clr module. This module has a facade "
"attribute to make it distinguishable from the real clr module."
);

static PyNet_Args *pn_args;
char **environ = NULL;

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef clrdef = {
PyModuleDef_HEAD_INIT,
"clr", /* m_name */
clr_module_doc, /* m_doc */
-1, /* m_size */
clr_methods, /* m_methods */
NULL, /* m_reload */
NULL, /* m_traverse */
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *_initclr(void)
{
PyObject *m;

/* Create the module and add the functions */
#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&clrdef);
#else
m = Py_InitModule3("clr", clr_methods, clr_module_doc);
#endif
if (m == NULL)
return NULL;
PyModule_AddObject(m, "facade", Py_True);
Py_INCREF(Py_True);

pn_args = PyNet_Init(1);
if (pn_args->error)
{
return NULL;
}

if (NULL != pn_args->module)
return pn_args->module;

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC
PyInit_clr(void)
{
return _initclr();
}
#else
PyMODINIT_FUNC
initclr(void)
{
_initclr();
}
#endif
55 changes: 55 additions & 0 deletionssrc/coreclr/coreclrhost.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//
// APIs for hosting CoreCLR
//

#ifndef __CORECLR_HOST_H__
#define __CORECLR_HOST_H__

// For each hosting API, we define a function prototype and a function pointer
// The prototype is useful for implicit linking against the dynamic coreclr
// library and the pointer for explicit dynamic loading (dlopen, LoadLibrary)
#define CORECLR_HOSTING_API(function, ...) \
int function(__VA_ARGS__); \
typedef int (*function##_ptr)(__VA_ARGS__)

CORECLR_HOSTING_API(coreclr_initialize,
const char* exePath,
const char* appDomainFriendlyName,
int propertyCount,
const char** propertyKeys,
const char** propertyValues,
void** hostHandle,
unsigned int* domainId);

CORECLR_HOSTING_API(coreclr_shutdown,
void* hostHandle,
unsigned int domainId);

CORECLR_HOSTING_API(coreclr_shutdown_2,
void* hostHandle,
unsigned int domainId,
int* latchedExitCode);

CORECLR_HOSTING_API(coreclr_create_delegate,
void* hostHandle,
unsigned int domainId,
const char* entryPointAssemblyName,
const char* entryPointTypeName,
const char* entryPointMethodName,
void** delegate);

CORECLR_HOSTING_API(coreclr_execute_assembly,
void* hostHandle,
unsigned int domainId,
int argc,
const char** argv,
const char* managedAssemblyPath,
unsigned int* exitCode);

#undef CORECLR_HOSTING_API

#endif // __CORECLR_HOST_H__
Loading

[8]ページ先頭

©2009-2025 Movatter.jp