diff options
| author | ruki <[email protected]> | 2024-03-22 23:40:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-03-22 23:40:31 +0800 |
| commit | abe7c109927250244ff0294525054401134da79f (patch) | |
| tree | d53a2acc9eedd50c8a6b3598df0436680fb92b80 | |
| parent | a179acd1f474be6821c31cf203964ce41b0177a1 (diff) | |
revert check package toolchains
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/install.lua | 12 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/install_packages.lua | 19 |
2 files changed, 13 insertions, 18 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua index f154962bf..6d903885a 100644 --- a/xmake/modules/private/action/require/impl/actions/install.lua +++ b/xmake/modules/private/action/require/impl/actions/install.lua @@ -222,6 +222,15 @@ function _fix_paths_for_precompiled_package(package) end end +-- check package toolchains +function _check_package_toolchains(package) + for _, toolchain_inst in pairs(package:toolchains()) do + if not toolchain_inst:check() then + raise("toolchain(\"%s\"): not found!", toolchain_inst:name()) + end + end +end + -- get failed install directory function _get_installdir_failed(package) return path.join(package:cachedir(), "installdir.failed") @@ -351,6 +360,9 @@ function main(package) dep:envs_enter() end + -- check package toolchains + _check_package_toolchains(package) + -- do install if script ~= nil then filter.call(script, package, {oldenvs = oldenvs}) diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index 82037422c..359392f71 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -325,12 +325,9 @@ function _fetch_packages(packages_fetch, installdeps) end end fetching_count = fetching_count + 1 - packages_fetching[index] = instance - - -- check package toolchains, system/find_package maybe will call toolchains - _check_package_toolchains(instance) -- fetch this package + packages_fetching[index] = instance local oldenvs = os.getenvs() instance:envs_enter() instance:fetch() @@ -379,15 +376,6 @@ function _should_install_package(instance) return result end --- check package toolchains -function _check_package_toolchains(package) - for _, toolchain_inst in pairs(package:toolchains()) do - if not toolchain_inst:check() then - raise("toolchain(\"%s\"): not found!", toolchain_inst:name()) - end - end -end - -- install packages function _install_packages(packages_install, packages_download, installdeps) @@ -496,11 +484,6 @@ function _install_packages(packages_install, packages_download, installdeps) -- install this package packages_installing[index] = instance if downloaded then - - -- check package toolchains - _check_package_toolchains(instance) - - -- do install if not action_install(instance) then assert(instance:is_precompiled(), "package(%s) should be precompiled", instance:name()) -- we need to disable built and re-download and re-install it |
