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

Add runtimes only if the ndk version is low enough #5565

Merged
merged 5 commits into from
Sep 4, 2024

Conversation

A2va
Copy link
Contributor

@A2va A2va commented Sep 3, 2024

and a warning, if the current config have a deprecated runtime

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

A2va added 3 commits September 3, 2024 17:01
and a warning, if the current config have a deprecated runtime
@A2va
Copy link
Contributor Author

A2va commented Sep 3, 2024

This is strange, the CI on linux fails with this stacktrace:

error: @programdir/core/main.lua:329: @programdir/modules/async/runjobs.lua:325: @programdir/core/tool/toolchain.lua:371: @programdir/core/base/semver.lua:135: attempt to compare nil with number
stack traceback:
    [@programdir/core/base/semver.lua:135]: in function 'le'
    [@programdir/toolchains/ndk/load.lua:100]:

Even if I check the non nil value of ndk_sdkver

local old_runtimes = {"gnustl_static", "gnustl_shared", "stlport_static", "stlport_shared"}
if ndk_sdkver and semver.new(ndk_sdkver):le("r18") then
    toolchain:add("runtimes", table.unpack(old_runtimes))
end

@SirLynix
Copy link
Member

SirLynix commented Sep 3, 2024

I think the semver isn't recognized (as it's not a semver format, e.g. x.y.z.) returning nil

@A2va
Copy link
Contributor Author

A2va commented Sep 3, 2024

I have come up with a solution, but wouldn't it be better to get a minor and patch version of ndk?

ndk_version_info = ndk_version_info:match("#define __NDK_MAJOR__ (%d+)")
if ndk_version_info then
ndkver = tonumber(ndk_version_info)
end

@waruqi
Copy link
Member

waruqi commented Sep 4, 2024

why not use ndkver?

local ndkver = toolchain:config("ndkver")

elseif ndkver and ndkver >= 26 then

@A2va
Copy link
Contributor Author

A2va commented Sep 4, 2024

I got confused between ndk_sdkver and ndkver

@waruqi waruqi merged commit c9c01c9 into xmake-io:dev Sep 4, 2024
20 checks passed
@waruqi waruqi added this to the v2.9.5 milestone Sep 4, 2024
@A2va A2va deleted the warn-stl-ndk branch September 18, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants