diff options
| author | ruki <[email protected]> | 2024-10-11 00:56:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-10-11 00:56:19 +0800 |
| commit | e0c0cddf7cc74bfbb2f948651be251ce7d4f6b57 (patch) | |
| tree | 7716e34bcbf6fba33851d9a07becaba3aaf05d0a | |
| parent | d023f3501a95bcd2c7475b578bed7585d8ed60d3 (diff) | |
replace some hash case
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/sandbox/module.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/utils/ci/packageskey.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/qt/qrc/xmake.lua | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 0b1b9879e..5d8d6b111 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1701,7 +1701,7 @@ function _instance:buildhash() table.sort(toolchains) str = str .. "_" .. table.concat(toolchains, "_") end - return hash.uuid4(str):gsub('-', ''):lower() + return hash.strhash128(str) end local function _get_installdir(...) local name = self:name():lower():gsub("::", "_") diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 4ca895d0c..4e908ec6b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1496,7 +1496,7 @@ function _instance:autogenfile(sourcefile, opt) -- @see -- https://github.com/xmake-io/xmake/issues/3021 -- https://github.com/xmake-io/xmake/issues/3715 - relativedir = hash.uuid4(relativedir):gsub("%-", ""):lower() + relativedir = hash.strhash128(relativedir) end relativedir = relativedir:gsub("%.%.", "__") local rootdir = (opt and opt.rootdir) and opt.rootdir or self:autogendir() @@ -2138,7 +2138,7 @@ function _instance:dependfile(objectfile) -- @see -- https://github.com/xmake-io/xmake/issues/3021 -- https://github.com/xmake-io/xmake/issues/3715 - relativedir = hash.uuid4(relativedir):gsub("%-", ""):lower() + relativedir = hash.strhash128(relativedir) end -- originfile: project/build/.objs/xxxx/../../xxx.c will be out of range for objectdir diff --git a/xmake/core/sandbox/modules/import/core/sandbox/module.lua b/xmake/core/sandbox/modules/import/core/sandbox/module.lua index bddfb1524..df1d31240 100644 --- a/xmake/core/sandbox/modules/import/core/sandbox/module.lua +++ b/xmake/core/sandbox/modules/import/core/sandbox/module.lua @@ -203,7 +203,7 @@ function core_sandbox_module._native_moduleinfo(module_fullpath, modulekind) local projectdir = path.normalize(path.absolute(module_fullpath)) local programdir = path.normalize(os.programdir()) local modulename = path.basename(module_fullpath) - local modulehash = hash.uuid4(projectdir):split("-", {plain = true})[1]:lower() + local modulehash = hash.strhash32(projectdir) local buildir local is_global = false local modulepath diff --git a/xmake/modules/utils/ci/packageskey.lua b/xmake/modules/utils/ci/packageskey.lua index a293009af..c29ddfdfe 100644 --- a/xmake/modules/utils/ci/packageskey.lua +++ b/xmake/modules/utils/ci/packageskey.lua @@ -60,7 +60,7 @@ function main(requires_raw) keys = table.concat(keys, ",") option.restore() - print(hash.uuid4(keys):gsub('-', ''):lower()) + print(hash.strhash128(keys)) end diff --git a/xmake/rules/qt/qrc/xmake.lua b/xmake/rules/qt/qrc/xmake.lua index 60653d080..084a7fff0 100644 --- a/xmake/rules/qt/qrc/xmake.lua +++ b/xmake/rules/qt/qrc/xmake.lua @@ -44,7 +44,7 @@ rule("qt.qrc") local rcc = target:data("qt.rcc") -- get c++ source file for qrc - local sourcefile_cpp = path.join(target:autogendir(), "rules", "qt", "qrc", path.basename(sourcefile_qrc).. "_" .. hash.uuid4(sourcefile_qrc):split('%-')[1] .. ".cpp") + local sourcefile_cpp = path.join(target:autogendir(), "rules", "qt", "qrc", path.basename(sourcefile_qrc).. "_" .. hash.strhash32(sourcefile_qrc) .. ".cpp") local sourcefile_dir = path.directory(sourcefile_cpp) -- add objectfile |
