Git Product home page Git Product logo

Comments (16)

memsharded avatar memsharded commented on June 13, 2024 1

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.

memsharded avatar memsharded commented on June 13, 2024 1

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 avatar memsharded commented on June 13, 2024 1

@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.

jcar87 avatar jcar87 commented on June 13, 2024

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:

from conan.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

memsharded avatar memsharded commented on June 13, 2024

Hi @manuelpagliuca

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 the build_requirements() method, not in the requirements() method

from conan.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

@memsharded Thanks for the answer, if you want we can continue there.

from conan.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

Sure.

  1. Activate the Python environment which has installed in it Conan 2.2.2, with the command source ~pythonConanEnv2
  2. Create a build directory inside at the same level of the repository BIM-ArchiCAD-Plugin.
  3. Move into the build directory with the command cd build
  4. Installing all the configuration files in conan conan config install ../BIM-ArchiCAD-Plugin/conan/config
  5. 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).
  6. 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 the macos profile.

from conan.

memsharded avatar memsharded commented on June 13, 2024

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.

manuelpagliuca avatar manuelpagliuca commented on June 13, 2024

@memsharded Sadly I can't is a private repositor :(

from conan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.