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

Starting on windows #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ on:

jobs:
python:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion ci-common/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ci-common/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ docker_commands: |
RUN --mount=type=cache,sharing=private,target=/tmp/downloads \
/tmp/install_conan.sh

COPY ../packages/conan/settings /opt/conan_home/.conan
COPY ../packages/conan/settings_linux /opt/conan_home/.conan
ENV CONAN_USER_HOME=/opt/conan_home
6 changes: 3 additions & 3 deletions packages/conan/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data/
settings/.conan.db
settings/cacert.pem
settings/artifacts.properties
settings_*/.conan.db
settings_*/cacert.pem
settings_*/artifacts.properties
ccache/
7 changes: 4 additions & 3 deletions packages/conan/recipes/clang/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conans import ConanFile, CMake, tools

import os.path
import platform
import os


Expand Down Expand Up @@ -34,7 +34,7 @@ def _source_subfolder(self):
return "source"

def build_requirements(self):
if tools.Version(self.version) > "11":
if tools.Version(self.version) > "11" and platform.system() == "Linux":
self.build_requires(f"python/3.9.7@{self.user}/vfx2022")

def configure(self):
Expand All @@ -53,7 +53,8 @@ def configure(self):

def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["GCC_INSTALL_PREFIX"] = os.environ["GCC_INSTALL_PREFIX"]
if platform.system() == "Linux":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May end up being:

and platform.system() != "Windows"

cmake.definitions["GCC_INSTALL_PREFIX"] = os.environ["GCC_INSTALL_PREFIX"]
cmake.definitions["LLVM_BUILD_LLVM_DYLIB"] = True
cmake.definitions["CLANG_INCLUDE_DOCS"] = False
cmake.definitions["LIBCXX_INCLUDE_DOCS"] = False
Expand Down
58 changes: 33 additions & 25 deletions packages/conan/recipes/python/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from platform import system
from conans import AutoToolsBuildEnvironment, ConanFile, tools
from contextlib import contextmanager
import os
Expand Down Expand Up @@ -47,23 +48,23 @@ def export_sources(self):
def _build_context(self):
if self.settings.compiler == "Visual Studio":
with tools.vcvars(self.settings):
env = {
"AR": "{} lib".format(
tools.unix_path(self.deps_user_info["automake"].ar_lib)
),
"CC": "{} cl -nologo".format(
tools.unix_path(self.deps_user_info["automake"].compile)
),
"CXX": "{} cl -nologo".format(
tools.unix_path(self.deps_user_info["automake"].compile)
),
"NM": "dumpbin -symbols",
"OBJDUMP": ":",
"RANLIB": ":",
"STRIP": ":",
}
with tools.environment_append(env):
yield
# env = {
# "AR": "{} lib".format(
# tools.unix_path(self.deps_user_info["automake"].ar_lib)
# ),
# "CC": "{} cl -nologo".format(
# tools.unix_path(self.deps_user_info["automake"].compile)
# ),
# "CXX": "{} cl -nologo".format(
# tools.unix_path(self.deps_user_info["automake"].compile)
# ),
# "NM": "dumpbin -symbols",
# "OBJDUMP": ":",
# "RANLIB": ":",
# "STRIP": ":",
# }
# with tools.environment_append(env):
yield
else:
yield

Expand Down Expand Up @@ -92,19 +93,26 @@ def _configure_autotools(self):
return self._autotools

def build(self):
with self._build_context():
autotools = self._configure_autotools()
autotools.make()
if system() == "Linux":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

match / case when when we switch to Python 3.10 and support Darwin/macOS

with self._build_context():
autotools = self._configure_autotools()
autotools.make()
else:
self.run(
os.path.join(self._source_subfolder, "PCbuild", "build.bat"),
run_environment=True,
)

def package(self):
self.copy("COPYING", src=self._source_subfolder, dst="licenses")

self.copy("yum", dst="bin")
self.copy("run-with-system-python", dst="bin")
if system() == "Linux":
self.copy("yum", dst="bin")
self.copy("run-with-system-python", dst="bin")

with self._build_context():
autotools = self._configure_autotools()
autotools.install()
with self._build_context():
autotools = self._configure_autotools()
autotools.install()

python_version = tools.Version(self.version)
if python_version.major == "3":
Expand Down
23 changes: 23 additions & 0 deletions packages/conan/settings_windows/conan.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[log]
run_to_output = True # environment CONAN_LOG_RUN_TO_OUTPUT
run_to_file = False # environment CONAN_LOG_RUN_TO_FILE
level = critical # environment CONAN_LOGGING_LEVEL
print_run_commands = False # environment CONAN_PRINT_RUN_COMMANDS

[general]
revisions_enabled = 1
default_profile = vfx2022
compression_level = 9 # environment CONAN_COMPRESSION_LEVEL
sysrequires_sudo = True # environment CONAN_SYSREQUIRES_SUDO
request_timeout = 60 # environment CONAN_REQUEST_TIMEOUT (seconds)
default_package_id_mode = semver_direct_mode # environment CONAN_DEFAULT_PACKAGE_ID_MODE

[storage]
path = ../d
download_cache = /tmp/downloads
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like a Linux-specific path?


[proxies]

[hooks]
attribute_checker

9 changes: 9 additions & 0 deletions packages/conan/settings_windows/hooks/attribute_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def pre_export(output, conanfile, conanfile_path, reference, **kwargs):
# Check basic meta-data
for field in ["url", "license", "description"]:
field_value = getattr(conanfile, field, None)
if not field_value:
output.warn(
"Conanfile doesn't have '%s'. It is recommended to add it as attribute"
% field
)
13 changes: 13 additions & 0 deletions packages/conan/settings_windows/profiles/ci_common1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=visual_studio
compiler.version=15
compiler.toolset=v141
compiler.cppstd=14
build_type=Release
[options]
[build_requires]
[env]
13 changes: 13 additions & 0 deletions packages/conan/settings_windows/profiles/ci_common2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
compiler.toolset=v141
compiler.cppstd=14
build_type=Release
[options]
[build_requires]
[env]
7 changes: 7 additions & 0 deletions packages/conan/settings_windows/profiles/vfx2019
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(ci_common1)

[settings]
python=2.7
[options]
[build_requires]
[env]
7 changes: 7 additions & 0 deletions packages/conan/settings_windows/profiles/vfx2020
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(ci_common1)

[settings]
python=3.7
[options]
[build_requires]
[env]
7 changes: 7 additions & 0 deletions packages/conan/settings_windows/profiles/vfx2021
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(ci_common2)

[settings]
python=3.7
[options]
[build_requires]
[env]
7 changes: 7 additions & 0 deletions packages/conan/settings_windows/profiles/vfx2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(ci_common2)

[settings]
python=3.9
[options]
[build_requires]
[env]
19 changes: 19 additions & 0 deletions packages/conan/settings_windows/remotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"remotes": [
{
"name": "aswf",
"url": "https://linuxfoundation.jfrog.io/artifactory/api/conan/aswf-conan",
"verify_ssl": true
},
{
"name": "conan-central",
"url": "https://center.conan.io",
"verify_ssl": true
},
{
"name": "aswftesting",
"url": "https://linuxfoundation.jfrog.io/artifactory/api/conan/aswf-conan-dev",
"verify_ssl": true
}
]
}
Loading