-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Stabilize vs and vsxmake project generation #2959 #2971
Conversation
mode isn't sorted/stable. |
I know, it still in progress |
try it again |
Modes still aren't stable. -- get target ordered rules
function _instance:orderules()
local rules = self._RULES
local orderules = self._ORDERULES
if orderules == nil and rules then
orderules = {}
local rulerefs = {}
for _, r in pairs(rules) do
instance_deps.sort_deps(rules, orderules, rulerefs, r)
end
self._ORDERULES = orderules
end
return orderules
end => for _, r in table.orderpairs(rules) do with this change applied I still however get an unstable generation on run envs:
it seems pkgs:orderkeys() doesn't work well, I added a log in core/project/target.lua (on ligne 983 in target:pkgsenvs) for _, dep in ipairs(self:orderdeps()) do
print("dep: " .. dep:name())
for _, pkgname in ipairs(table.wrap(dep:get("packages", {interface = true}))) do
local pkg = dep:pkg(pkgname)
if pkg then
pkgs:insert(pkg)
end
end
end
for _, pkg in pkgs:orderkeys() do
print("pkg:name() = " .. pkg:name()) and I get this:
to my understanding this is because function hashset_impl:orderkeys()
local orderkeys = table.keys(self._DATA)
table.sort(orderkeys, function (a, b)
if a == hashset._NIL then
a = math.inf
end
if b == hashset._NIL then
b = math.inf
end
if type(a) == "table" then
a = tostring(a)
end
if type(b) == "table" then
b = tostring(b)
end
print(a, b)
return a < b
end) sorts two
maybe it could take a functor by parameter on how to sort them function hashset_impl:orderkeys(sort)
local orderkeys = table.keys(self._DATA)
table.sort(orderkeys, sort or function (a, b) for _, pkg in pkgs:orderkeys(function (a, b) return a:name() < b:name() end) do or maybe using target metatable and __lt metamethod |
try it again. |
I tested vsxmake multiple times and it seems to be stable now. However vs generator isn't:
looks like a few |
done, try it again. |
looks good for .sln, however .vcxproj file list isn't stable, adding for sourcefile, sourceinfo in table.orderpairs(sourceinfos) do in function _make_source_files(vcxprojfile, vsinfo, target) (vs201x_vcxproj.lua) with this, it seems good and ready to be merged 👍 |
I have improved it, try it again? |
seems stable now, thanks 👍 |
#2959