You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project that references a remote xmake-repo containing many packages. However, I need to locally debug one of the packages, and I found that I cannot override the package description from the remote xmake-repo.
-- this remote repo contains a log of packagesadd_repositories("my-repo https://github.com/for-2-years/xmake-repo.git")
-- I want to override a specific package to debugpackage("my-package", function()
set_policy("package.install_always", true)
set_sourcedir("/root/my-package-dir")
on_install(function(package)
import("package.tools.xmake").install(package)
end)
end)
Is there a way to prioritize local package descriptions over those in the remote repository?
After debugging the xmake source code, I found that this function merges the packages defined in the project with those defined in the remote repository.
-- load the package from the project filefunctionpackage.load_from_project(packagename, project)
-- get it directly from cache firstlocalinstance=package._memcache():get2("packages", packagename)
ifinstancethenreturninstanceend-- load packages (with cache) localpackages, errors=project.packages()
ifnotpackagesthenreturnnil, errorsend-- get package infolocalpackageinfo=packages[packagename]
ifnotpackageinfothenreturnend-- new an instanceinstance=_instance.new(packagename, packageinfo)
package._memcache():set2("packages", instance)
returninstanceend
I don't think there is a way to do this from within the project file itself. You have to create a custom repo, copy the original xmake.lua file in there and configure your project to use it.
I don't think there is a way to do this from within the project file itself. You have to create a custom repo, copy the original xmake.lua file in there and configure your project to use it.
Xmake Version
v2.9.6
Operating System Version and Architecture
wsl ubuntu 2204
Describe Bug
I have a project that references a remote xmake-repo containing many packages. However, I need to locally debug one of the packages, and I found that I cannot override the package description from the remote xmake-repo.
Is there a way to prioritize local package descriptions over those in the remote repository?
After debugging the xmake source code, I found that this function merges the packages defined in the project with those defined in the remote repository.
xmake/xmake/core/package/package.lua
Line 2955 in 959106b
Expected Behavior
I can override a remote-repo package description by a local package.
Project Configuration
none
Additional Information and Error Logs
none
The text was updated successfully, but these errors were encountered: