-
Notifications
You must be signed in to change notification settings - Fork 11
doc: add import from conan #277
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
ec081df
2c42a9a
cc6fd24
bad5f31
00dac3f
113b4ec
f809b77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Import and Convert All Conan C Libraries | ||
|
|
||
| Use the [rxsync](https://github.com/goplus/rxsync) tool to convert 1,800 libraries from the [Conan Center Index](https://github.com/conan-io/conan-center-index/tree/master/recipes). | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Use `rxsync` to sync Conan recipes locally | ||
| 2. Customize names and generate a name mapping table | ||
| 3. Parse dependency information to obtain the conversion list | ||
| 4. Perform conversion according to the order in the conversion list | ||
| 5. Automatically populate dependencies and remove unnecessary `include`s based on Conan dependency info | ||
| 6. After converting each library, submit a pull request. Use GitHub Actions to perform a basic validation via `llgo build` | ||
| 7. After merging, tag each `{{clib}}/{{cver}}` folder as `{{clib}}/{{cver}}/v0.1.0` to meet nested module requirements | ||
|
|
||
| ## Issues | ||
|
|
||
| ### 1. All `cflags` Included by Default | ||
|
|
||
| The automatically generated `llcpp.cfg` includes all header files from dependencies listed under `cflags`. For example, `libxml2` includes header files from `zlib`, and `libxslt` includes headers from both `libxml2` and `zlib` as part of its include paths. This behavior is unintended — for example, in certain cases, headers from `libxml2` and `zlib` need to be removed. | ||
|
|
||
| **Preliminary solution:** Automatically remove them during dependency population. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note:need support custom llpkg |
||
|
|
||
| ### 2. Local `deps` | ||
|
|
||
| How should dependencies be populated for `deps` in `llcppg.cfg`? All batch processing is done locally, while `deps` is expected to reference the GitHub path under `github.com/llpkg`. There's uncertainty about whether locally converted packages can be referenced as dependencies during batch processing. | ||
|
|
||
| **Needs verification.** | ||
|
|
||
| ### 3. Package Dependency Order | ||
|
|
||
| Ordering issues may arise during batch conversion. | ||
|
|
||
| ### 4. Naming Conflicts in Custom Names | ||
|
|
||
| The `lib` prefix is removed. | ||
|
|
||
| However, this may cause naming conflicts and needs to be verified. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
package main
import (
"fmt"
"os"
"strings"
)
func main() {
names := make(map[string][]string)
dirs, err := os.ReadDir("./recipes")
if err != nil {
panic(err)
}
for _, pkg := range dirs {
if pkg.IsDir() {
pkgnoLib := strings.TrimPrefix(pkg.Name(), "lib")
names[pkgnoLib] = append(names[pkgnoLib], pkg.Name())
}
}
for name, pkgs := range names {
if len(pkgs) > 1 {
fmt.Println(name, pkgs)
}
}
}❯ go run main.go
tar [libtar tar]
serial [libserial serial]
vdpau [libvdpau vdpau]
b2 [b2 libb2]
gettext [gettext libgettext]There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MeteorsLiu i open a pr for this verification MeteorsLiu#1, need review There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 4f3d04a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. conanfile.py package_type to filter binary or libary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ### 5. Demo Validation | ||
|
|
||
| Batch conversion cannot perform demo validation. | ||
|
|
||
| **Preliminary solution:** Use basic `llgo build` validation. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. valid compile |
||
|
|
||
| ### 6. Trim Prefix | ||
|
|
||
| The expected behavior is to configure `trimPrefixes` in `llcppg.cfg` to remove namespaces before committing to the repo. | ||
| However, the automated process may not be able to identify and fill this in automatically. | ||
|
|
||
| **No solution yet.** | ||
|
|
||
| ### 7. Tagging for All Version Branches | ||
|
|
||
| How should tags be created? | ||
|
|
||
| **Preliminary solution:** | ||
| ``` | ||
| cjson/3.4.5/v0.1.0 | ||
| cjson/3.3.5/v0.1.0 | ||
| cjson/3.2.5/v0.1.0 | ||
| ``` | ||
|
|
||
| But it's unclear whether Go can recognize this format — needs verification. | ||
|
|
||
| ### 8. GitHub Action Verification | ||
|
|
||
| Is it necessary to add `llcppg`-based validation? | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llcpp.cfg->llcppg.cfgThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cc6fd24