Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructuring for faster build times #33

Merged
merged 19 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 53 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_3_Update_DEVKIT_Windows.zip"
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Windows.zip"
- maya: "2024"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_1_Update_DEVKIT_Windows.zip"

steps:
- name: Checkout code
Expand Down Expand Up @@ -73,8 +75,8 @@ jobs:
# MacOS
#
#
maya-macos:
runs-on: macos-10.15
maya-macos-11:
runs-on: macos-11

strategy:
fail-fast: false
Expand Down Expand Up @@ -105,7 +107,47 @@ jobs:

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '10.3'
xcode-version: '11.7'

- name: Configure CMake
run: |
cmake -G Xcode -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_ROOT="$PWD/devkitBase"

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Artifacts
uses: actions/upload-artifact@v3
with:
name: macos-${{matrix.maya}}
path: build/${{env.BUILD_TYPE}}/cmdc.so

maya-macos-12:
runs-on: macos-12

strategy:
fail-fast: false

matrix:
include:
- maya: "2024"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_1_Update_DEVKIT_Mac.dmg"

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true

- name: Install devkit
run: |
curl -o devkit.dmg ${{matrix.devkit}}
MOUNTDIR=$(hdiutil mount devkit.dmg | awk 'END {$1=$2=""; print $0}')
cp -r $MOUNTDIR .

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4'

- name: Configure CMake
run: |
Expand Down Expand Up @@ -144,6 +186,7 @@ jobs:
- maya: "2020.4"
- maya: "2022.3"
- maya: "2023"
- maya: "2024"

steps:
- name: Checkout code
Expand Down Expand Up @@ -219,6 +262,9 @@ jobs:
- maya: "2023"
image: "scottenglert/maya-test:2023"
pip: "get-pip.py"
- maya: "2024"
image: "scottenglert/maya-test:2024"
pip: "get-pip.py"

steps:
- name: Checkout code
Expand Down Expand Up @@ -246,11 +292,14 @@ jobs:

# Since 2019, this sucker throws an unnecessary
# warning if not declared.
# The MAYA_NO_STANDALONE_ATEXIT is needed to return a non 0 return code for test failure
# this seems to be addressed with bug fix MAYA-122975 (Maya 2024)
- name: Environment
run: |
mkdir -p /var/tmp/runtime-root
export XDG_RUNTIME_DIR=/var/tmp/runtime-root
export MAYA_DISABLE_ADP=1
export MAYA_NO_STANDALONE_ATEXIT=1

- name: Tests
run: |
Expand All @@ -273,7 +322,7 @@ jobs:
#
upload_release:
name: Upload release
needs: [maya-win, maya-linux, maya-macos, generate-stubs, test]
needs: [maya-win, maya-linux, maya-macos-11, maya-macos-12, generate-stubs, test]
runs-on: ubuntu-latest

# Only run on e.g. v0.1.0
Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.4)
project(cmdc)

set(CMDC_SOURCES "src/main.cpp")

if (NOT DEFINED MAYA_VERSION)
set(MAYA_VERSION 2020 CACHE STRING "Maya version")
endif()
Expand All @@ -12,8 +10,10 @@ list(GET VERSION_LIST 0 MAYA_VERSION)

if (MAYA_VERSION VERSION_EQUAL "2022")
set(PYBIND11_PYTHON_VERSION "3.7" CACHE STRING "")
elseif(MAYA_VERSION VERSION_GREATER_EQUAL "2023")
elseif(MAYA_VERSION VERSION_EQUAL "2023")
set(PYBIND11_PYTHON_VERSION "3.9" CACHE STRING "")
elseif(MAYA_VERSION VERSION_EQUAL "2024")
set(PYBIND11_PYTHON_VERSION "3.10" CACHE STRING "")
else()
set(PYBIND11_PYTHON_VERSION "2.7" CACHE STRING "")
endif()
Expand Down Expand Up @@ -42,12 +42,13 @@ add_subdirectory(pybind11)
add_custom_target(BuildMFnTypes ALL python ./scripts/mfn.py parse ${MAYA_DEVKIT_ROOT}
BYPRODUCTS ./src/MFn.Types.inl
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_library(${PROJECT_NAME} SHARED ${CMDC_SOURCES})
add_library(${PROJECT_NAME} SHARED "")
add_subdirectory(src)

add_dependencies(${PROJECT_NAME} BuildMFnTypes)
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND python ./mfn.py clear -
BYPRODUCTS ./src/MFn.Types.inl
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/scripts"
)

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.build-2023
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM aswf/ci-base:2022.2
FROM aswf/ci-base:2022.4

# Download devkit
ENV DEVKIT "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Linux.tgz"
Expand Down
8 changes: 8 additions & 0 deletions docker/Dockerfile.build-2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM aswf/ci-base:2023.0

# Download devkit
ENV DEVKIT "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_1_Update_DEVKIT_Linux.tgz"
RUN wget $DEVKIT -O /tmp/devkit.tgz && \
mkdir -p /usr/autodesk && \
tar -xvf /tmp/devkit.tgz -C /usr/autodesk/ && \
rm /tmp/devkit.tgz
Binary file added os/linux/3.10/lib/libpython3.10.so
Binary file not shown.
148 changes: 148 additions & 0 deletions os/mac/3.10/include/Python.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#ifndef Py_PYTHON_H
#define Py_PYTHON_H
/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */

/* Include nearly all Python header files */

#include "patchlevel.h"
#include "pyconfig.h"
#include "pymacconfig.h"

#include <limits.h>

#ifndef UCHAR_MAX
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
#endif

#if UCHAR_MAX != 255
#error "Python's source code assumes C's unsigned char is an 8-bit type."
#endif

#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
#define _SGI_MP_SOURCE
#endif

#include <stdio.h>
#ifndef NULL
# error "Python.h requires that stdio.h define NULL."
#endif

#include <string.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <stdlib.h>
#ifndef MS_WINDOWS
#include <unistd.h>
#endif

/* For size_t? */
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif

/* CAUTION: Build setups should ensure that NDEBUG is defined on the
* compiler command line when building Python in release mode; else
* assert() calls won't be removed.
*/
#include <assert.h>

#include "pyport.h"
#include "pymacro.h"

/* A convenient way for code to know if sanitizers are enabled. */
#if defined(__has_feature)
# if __has_feature(memory_sanitizer)
# if !defined(_Py_MEMORY_SANITIZER)
# define _Py_MEMORY_SANITIZER
# endif
# endif
# if __has_feature(address_sanitizer)
# if !defined(_Py_ADDRESS_SANITIZER)
# define _Py_ADDRESS_SANITIZER
# endif
# endif
#elif defined(__GNUC__)
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
#endif

#include "pymath.h"
#include "pymem.h"

#include "object.h"
#include "objimpl.h"
#include "typeslots.h"
#include "pyhash.h"

#include "cpython/pydebug.h"

#include "bytearrayobject.h"
#include "bytesobject.h"
#include "unicodeobject.h"
#include "longobject.h"
#include "longintrepr.h"
#include "boolobject.h"
#include "floatobject.h"
#include "complexobject.h"
#include "rangeobject.h"
#include "memoryobject.h"
#include "tupleobject.h"
#include "listobject.h"
#include "dictobject.h"
#include "cpython/odictobject.h"
#include "enumobject.h"
#include "setobject.h"
#include "methodobject.h"
#include "moduleobject.h"
#include "funcobject.h"
#include "classobject.h"
#include "fileobject.h"
#include "pycapsule.h"
#include "code.h"
#include "pyframe.h"
#include "traceback.h"
#include "sliceobject.h"
#include "cellobject.h"
#include "iterobject.h"
#include "cpython/initconfig.h"
#include "genobject.h"
#include "descrobject.h"
#include "genericaliasobject.h"
#include "warnings.h"
#include "weakrefobject.h"
#include "structseq.h"
#include "namespaceobject.h"
#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"

#include "codecs.h"
#include "pyerrors.h"
#include "pythread.h"
#include "pystate.h"
#include "context.h"

#include "modsupport.h"
#include "compile.h"
#include "pythonrun.h"
#include "pylifecycle.h"
#include "ceval.h"
#include "sysmodule.h"
#include "osmodule.h"
#include "intrcheck.h"
#include "import.h"

#include "abstract.h"
#include "bltinmodule.h"

#include "eval.h"

#include "cpython/pyctype.h"
#include "pystrtod.h"
#include "pystrcmp.h"
#include "fileutils.h"
#include "cpython/pyfpe.h"
#include "tracemalloc.h"

#endif /* !Py_PYTHON_H */
Loading