Comments (16)
I'm also having a trouble with the export-pkg
Please open a new ticket for this, and please try to provide full details, it is not clear what if fails, it seems to work from your output. Also, providing things that we can reproduce in our end is what makes the support effective, otherwise it is just mostly guessing.
In your case, your dst=include_archicad
is wrong, it is a relative path. Please use an absolute path as documented, if you check the package()
method docs in https://docs.conan.io/2/reference/conanfile/methods/package.html, the dst
should be an absolute folder, typically using self.package_folder
from conan.
No idea, sorry.
I'd need exact steps to reproduce it. As it is a boost
pacakge issue, it seems that it should be possible to reproduce with some conan install --requires=boost/.. --build="boost/*" ...
. Please provide reproducible steps (including platform, compiler, compiler version, etc) and I'll try to have a look.
from conan.
@memsharded Sadly I can't is a private repositor :(
Then I am afraid that it is impossible for us to know what is happening, if we cannot reproduce the issue.
The standard way of proceeding with this is to make a minimal reproducible example. You setup a simple public project, with the very minimum to reproduce the issue. This is usually done by doing a copy of your project, and stripping almost everything, or starting a simple project from a template. Typically very simple hello world
projects, as the ones created with conan new cmake_lib -d name=mypkg -d version=0.1
are enough to reproduce issues, so no need to share your private code or IP, you can fabricate an artificial project that shows the issue.
from conan.
Hi @manuelpagliuca - thanks for taking the time to submit this question.
As far as I can see, boost/1.77.0
is compatible with Conan 2.x
conan list "boost/1.77.0:*" -r conancenter
This returns that binary packages were published - and if the recipe was not compatible you would've seen errors much earlier.
The errors when building boost seem to match what is discussed here:
Thus it is possible that the specific version of clang that you are using is also at play. If this is a result of -Werror
, depending on the version of clang you are using, you may have some luck with -Wno-enum-constexpr-conversion
. This issue would be isolated to the specific combination of Boost version and Clang compiler version - could you report which version of Clang you are using? However if this is indeed the case - there isn't much we can do from our end.
As for the recipe that you have pasted:
generators = "cmake", "txt", "virtualenv"
-> no longer applies in Conan 2, in your case you needCMakeDeps
andCMakeToolchain
- but I would advise to use thegenerate()
method https://docs.conan.io/2/reference/conanfile/methods/generate.html#generate - since you need to customize some CMake settingscmake.definitions
is deprecated - you need to do this in thegenerate()
method by customizing the input inCMakeToolchain
(withvariables
orcache_variables
, see this section of the docs for example snippets: https://docs.conan.io/2/reference/tools/cmake/cmaketoolchain.html#cache-variables
from conan.
Hello @jcar87
I tried appending the flag option for mac installation.
def build(self):
cmake = CMake(self)
acver = str(self.options.archicad)[:2]
if self.settings.os == "Windows":
if acver == "25":
compiler_flags = "/W3 /WX /permissive- /EHsc"
else:
compiler_flags = "/W4 /WX /permissive- /EHsc"
else:
compiler_flags = "-Wall -Wextra -Werror -Wno-missing-field-initializers -ffunction-sections -Wno-enum-constexpr-conversion"
cmake.definitions["CMAKE_CXX_FLAGS"] = compiler_flags
cmake.definitions["ARCHICAD_VERSION"] = str(self.options.archicad)[:2]
cmake.definitions["LANGUAGE"] = str(self.options.language)
cmake.configure()
cmake.build()
But I still get the same error the version is "Apple clang version 15.0.0 (clang-1500.3.9.4)", but I suppose this conan installation command would work for 14.0.0, could it be? Is really possible that I can't do nothing for making this work?
In the while I'll investigate more on generate()
method, thanks for everything.
from conan.
The previous couldn't be a valid test since it wasn't reading the flags according to what you've told me, sorry.
from conan.
I updated the conanfile.py as the following:
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
class PlannerSuiteArchicadConan(ConanFile):
ADK_VERSIONS = {
"25": "25.3006",
"26": "26.3000",
"27": "27.3001",
}
settings = "os", "compiler", "build_type", "arch"
options = {
"archicad": list(ADK_VERSIONS.keys()) + list(ADK_VERSIONS.values()) + ["25.3002"],
"language": [ # folderName;locale_code_ID(LCID);standardName
"INT;0x409;en-US", # The fallback language
"INT;0x9;en", # The prioritized language by Archicad INT on Windows
"AUT;0xc07;de-AT",
"FRA;0x40c;fr-FR",
"GER;0x407;de-DE",
"ITA;0x410;it-IT",
"NED;0x413;nl-NL",
"POL;0x415;pl-PL",
"POR;0x816;pt-PT",
"SPA;0x40a;es-ES",
"TUR;0x3801;tr-TR",
"RUS;0x419;ru-RU",
"CZE;0x405;cs-CZ"
]
}
default_options = {
"archicad": "26",
"language": "INT;0x409;en-US",
"fmt/*:header_only": True,
"gsl-lite/*:on_contract_violation": "throw",
"spdlog/*:header_only": True,
}
build_requires = [
"cmake/3.29.0",
]
requires = [
"boost/1.77.0",
"catch2/3.5.3",
"fakeit/2.0.9",
"gsl-lite/0.38.1",
"magic_enum/0.7.3",
"spdlog/1.8.5",
]
def generators(self):
acver = str(self.options.archicad)[:2]
if self.settings.os == "Windows":
if acver == "25":
compiler_flags = "/W3 /WX /permissive- /EHsc"
else:
compiler_flags = "/W4 /WX /permissive- /EHsc"
else:
compiler_flags = "-Wall -Wextra -Werror -Wno-missing-field-initializers -ffunction-sections -Wno-enum-constexpr-conversion"
tc = CMakeToolchain(self)
tc.cache_variables["CMAKE_CXX_FLAGS"] = compiler_flags
tc.cache_variables["ARCHICAD_VERSION"] = str(self.options.archicad)[:2]
tc.cache_variables["LANGUAGE"] = str(self.options.language)
tc.generate()
cmake = CMakeDeps(self)
cmake.generate()
def build_requirements(self):
# To configure a specific Windows toolset we must use
# MSBuild/VisualStudio instead of Ninja or Makefiles.
if "Windows" != self.settings.os:
self.tool_requires("ninja/1.10.2")
def requirements(self):
version = str(self.options.archicad)
if self.settings.os == "Windows":
# because windows/macos ADK 25 have a different subversion number
self.ADK_VERSIONS["25"] = "25.3002"
self.tool_requires("archicad_adk/" +
self.ADK_VERSIONS.get(version, version))
acver = str(self.options.archicad)[:2]
# range-v3 in newer versions is incompatible with the older ADKs
# since it requires C++17 and /permissive- ("conformance mode" in VS)
# which turns some warnings into errors: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5208?view=msvc-170
if acver == "26" or acver == "27":
self.tool_requires("range-v3/0.12.0")
else:
self.tool_requires("range-v3/0.5.0")
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
But I'm still getting the same error, maybe I'm doing something wrong in the file.
from conan.
In many cases it is not desired to be fully overwriting tc.cache_variables["CMAKE_CXX_FLAGS"] = compiler_flags
as CMAKE_CXX_FLAGS
is managed and defined mostly by CMake. They recommend in general to use the CMAKE_CXX_FLAGS_INIT
instead.
Are you sure you don't want to use the CMakeToolchain.extra_cxxflags
instead to define extra flags only?
Otherwise, we would need something we can reproduce from our end, challenging to know the issue if we can't reproduce it.
Some other issues:
self.tool_requires("range-v3/0.12.0")
range-v3 is a library, not an executable.tool_requires
are for applications used at build time only, not intended for libraries, and that can have some unexpected behaviors.- In Conan 1.X
tool_requires
must be in thebuild_requirements()
method, not in therequirements()
method
from conan.
Hi @memsharded, I was following the migration guide and I thought I had to change all the old requirements call with tool_requires
.
from conan.
I'm also having a trouble with the export-pkg
from conan import ConanFile
from conan.tools.files import copy
from conan.tools.cmake import CMake
class ArchicadAdkConan(ConanFile):
name = "archicad_adk"
license = "non-free"
homepage = "https://archicadapi.graphisoft.com/downloads/api-development-kit"
url = "https://app.asana.com/0/1199938359399354/board" # for issues
description = """With the help of this tool you can develop Add-Ons to extend Archicad’s
standard functionalities. Also this tool enables you to create I/O interfaces for
converting Archicad files to different formats."""
topics = ("CAD", "sdk", "plugin", "addon")
settings = "os", "arch"
def package(self):
src_pattern = "{}/"
if "Macos" == self.settings.os:
src_pattern = "/Applications/GRAPHISOFT ARCHICAD API DevKit {}/Support/"
elif "Windows" == self.settings.os:
src_pattern = "C:/Program Files/GRAPHISOFT/API Development Kit {}/Support/"
src = src_pattern.format(self.version)
copy(self, "license.txt", src=src, dst="/")
copy(self, "**/ResConv.exe", src=src, dst="bin", keep_path=False)
copy(self, "**/ResConv", src=src, dst="bin", keep_path=False)
copy(self, "*.lib", src=src, dst="lib", keep_path=False)
copy(self, "*.dll", src=src, dst="bin", keep_path=False)
copy(self, "*.so", src=src, dst="lib", keep_path=False)
copy(self, "Frameworks/*.dylib", src=src,
dst="bin/Support", keep_path=False)
copy(self, "Tools/*.dylib", src=src,
dst="bin/Support", keep_path=False)
copy(self, "*.a", src=src, dst="lib", keep_path=False)
copy(self, "Frameworks/*.framework/*", src=src, dst="lib")
include_archicad = "include/Archicad" # for SonarCloud
# main headers
copy(self, "*.h", src=src + "Inc", dst=include_archicad)
copy(self, "*.hpp", src=src + "Inc", dst=include_archicad)
copy(self, "*.ico", src=src + "Inc", dst=include_archicad)
copy(self, "*.icns", src=src + "Inc", dst=include_archicad)
# module headers
copy(self, "*.h", src=src + "Modules",
dst=include_archicad, keep_path=True)
copy(self, "*.hpp", src=src + "Modules",
dst=include_archicad, keep_path=True)
This is the conanfile.py, when I execute the commands I get an empty package and I don't understand why this happens.
(pythonConanEnv) manuel@MacBook-Pro-di-Manuel build % sudo conan export-pkg .. archicad_adk/27.3001@ -f
Exporting package recipe
archicad_adk/27.3001: The stored package has not changed
archicad_adk/27.3001: Exported revision: 858fc649a205400c96639345223e865a
archicad_adk/27.3001: Forced build from source
Packaging to 46f53f156846659bf39ad6675fa0ee8156e859fe
archicad_adk/27.3001: Generating the package
archicad_adk/27.3001: Package folder /Users/manuel/.conan/data/archicad_adk/27.3001/_/_/package/46f53f156846659bf39ad6675fa0ee8156e859fe
archicad_adk/27.3001: Calling package()
archicad_adk/27.3001: Copied 1 file: ResConv
archicad_adk/27.3001: Copied 1 '.dylib' file: libXL.dylib
archicad_adk/27.3001: Copied 40 '.dylib' files
archicad_adk/27.3001: Copied 1 '.a' file: libACAP_STAT.a
archicad_adk/27.3001: Copied 453 files
archicad_adk/27.3001: Copied 152 '.plist' files
archicad_adk/27.3001: Copied 1156 '.tif' files
archicad_adk/27.3001: Copied 528 '.rsrd' files
archicad_adk/27.3001: Copied 15 '.strings' files
archicad_adk/27.3001: Copied 1 '.metallib' file: default.metallib
archicad_adk/27.3001: Copied 1 '.jpg' file: transitionmask.jpg
archicad_adk/27.3001: Copied 10 '.png' files
archicad_adk/27.3001: Copied 1 '.tiff' file: restrictedshine.tiff
archicad_adk/27.3001: Copied 35 '.h' files
archicad_adk/27.3001: Copied 8 '.hpp' files
archicad_adk/27.3001: Copied 1 '.icns' file: ArchiCADPlugin.icns
archicad_adk/27.3001: Copied 164 '.h' files
archicad_adk/27.3001: Copied 1956 '.hpp' files
archicad_adk/27.3001 package(): WARN: No files in this package!
archicad_adk/27.3001: Package '46f53f156846659bf39ad6675fa0ee8156e859fe' created
archicad_adk/27.3001: Created package revision a4fc02a1e79613c182918ede17eae4a4
(pythonConanEnv) manuel@MacBook-Pro-di-Manuel build %
from conan.
Are you sure you don't want to use the
CMakeToolchain.extra_cxxflags
instead to define extra flags only? Otherwise, we would need something we can reproduce from our end, challenging to know the issue if we can't reproduce it.
def generate(self):
acver = str(self.options.archicad)[:2]
compiler_flags = []
if self.settings.os == "Windows":
if acver == "25":
compiler_flags = ["/W3", "/WX", "/permissive-", "/EHsc"]
else:
compiler_flags = ["/W4", "/WX", "/permissive-", "/EHsc"]
else:
compiler_flags = ["-Wall", "-Wextra", "-Werror",
"-Wno-missing-field-initializers", "-ffunction-sections"]
tc = CMakeToolchain(self)
tc.extra_cxxflags = compiler_flags
tc.cache_variables["ARCHICAD_VERSION"] = str(self.options.archicad)[:2]
tc.cache_variables["LANGUAGE"] = str(self.options.language)
tc.generate()
cmake = CMakeDeps(self)
cmake.generate()
Does something like this works?
from conan.
@memsharded Thanks for the answer, if you want we can continue there.
from conan.
I'm still getting this error, do you think it is possible solve it? @memsharded
What is your question?
Hello, I'm attempting to migrate from legacy (1.62.0) conan to the latest version, in doing this I've update the
conanfile.py
according to the migration guidelines, now I'm trying to install the binaries I need to update them on a remote repository.Command:
conan install -pr macos -o archicad=27 ../BIM-ArchiCAD-Plugin --build=missing -r conancenter
I've entered an issue regarding boost/1.77.0, these are the final output texts from the installation process:
... In file included from libs/locale/src/shared/localization_backend.cpp:11: In file included from ./boost/thread/locks.hpp:10: In file included from ./boost/thread/lock_algorithms.hpp:11: In file included from ./boost/thread/lock_types.hpp:18: In file included from ./boost/thread/thread_time.hpp:11: In file included from ./boost/date_time/posix_time/posix_time_types.hpp:16: In file included from ./boost/date_time/posix_time/posix_time_duration.hpp:15: In file included from ./boost/numeric/conversion/cast.hpp:33: In file included from ./boost/numeric/conversion/converter.hpp:13: In file included from ./boost/numeric/conversion/conversion_traits.hpp:13: In file included from ./boost/numeric/conversion/detail/conversion_traits.hpp:18: In file included from ./boost/numeric/conversion/detail/int_float_mixture.hpp:19: In file included from ./boost/mpl/integral_c.hpp:32: ./boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] ./boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST' # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr) ^ 2 errors generated. ...failed updating 4 targets... boost/1.77.0: ERROR: Package '84356e9d75030b311e113d5bd51a777a030db55a' build failed boost/1.77.0: WARN: Build folder /Users/manuel/.conan2/p/b/boostbe9745d1dbe03/b/build-minsizerel ERROR: boost/1.77.0: Error in build() method, line 1003 self.run(full_command) ConanException: Error 1 while executing
from conan.
Sure.
- Activate the Python environment which has installed in it Conan 2.2.2, with the command
source ~pythonConanEnv2
- Create a
build
directory inside at the same level of the repositoryBIM-ArchiCAD-Plugin
. - Move into the
build
directory with the commandcd build
- Installing all the configuration files in conan
conan config install ../BIM-ArchiCAD-Plugin/conan/config
- Installing the required recipes from the conanfile.py inside the repository
conan install -pr macos -o archicad=27 ../BIM-ArchiCAD-Plugin --build=missing -r conancenter
. I'm forcing to use the conancenter remote, since later I will upload them on artifdactory, also between these recipes there is an ADK that I've built using conan 2, which is installed in cache (and on artifactory). - Executing the build command
conan build ../BIM-ArchiCAD-Plugin --profile:build=default --profile:host=macos
, I'm attempting to force cross-compilation since at the moment the current machine I'm using isn't aligned with themacos
profile.
from conan.
Create a build directory inside at the same level of the repository BIM-ArchiCAD-Plugin.
Sorry, can you please point us to the repo (and exact branch) URL? Thanks!
from conan.
@memsharded Sadly I can't is a private repositor :(
from conan.
Related Issues (20)
- [question] Is it possible to upload a package without adding it to the local cache first? HOT 2
- [question] Cross-compiling with arm toolchain and unit tests HOT 9
- [question] Prevent installation of Static dependencies if binary exists HOT 10
- [bug] unable to consume zlib while creating a package HOT 4
- [bug] Cannot build v2.2.2 with Python 3.12 HOT 1
- [feature] CMakeToolchain cacheVariables should have a type
- [question] CMAKE cannot find libraries added to cmakelists, except for zlib HOT 6
- [question] Interactions between cmake cache and find_package for config.cmake files provided by the package itself. HOT 1
- [question] how conan resolves shared library dependencies HOT 2
- [bug] TypeError: sequence item 0: expected str instance, NoneType found HOT 4
- [question] Failure on corrupted (empty) remotes.json HOT 1
- [bug] Failed to fetch correct commit HOT 3
- [bug] Conan config install fails HOT 3
- [bug] conan v2 package hash calculation is different from conan v1? HOT 2
- [question] conan 2 output to file HOT 2
- [bug] Cannot set requirements through extended class HOT 2
- [bug] ConanFile.run() expects command to be a string (not a list of strings), even when shell=False HOT 1
- [question] How to dynamically set channel attribute ? HOT 1
- [bug] Bad UX when trying to fetch deactivated Artifactory
- [feature] Use `pluggy` to take plugin-managemant to the next level HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.