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

Refactor Compilation Logic to Support Multiple OS Independently #5124

Open
wujunyi792 opened this issue Oct 30, 2023 · 0 comments
Open

Refactor Compilation Logic to Support Multiple OS Independently #5124

wujunyi792 opened this issue Oct 30, 2023 · 0 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@wujunyi792
Copy link
Contributor

What would you like to be added/modified:
Separate the logic for different operating systems into independent functions rather than implementing linux and windows compilation in a single function. Suggested approach:

function build_kubeedge_release() {
    case $OS in
    linux)
    build_kubeedge_release_linux
    ;;
    windows)
    build_kubeedge_release_windows
    ;; 
    *)
    echo "not support OS $OS"
    exit 1
    ;; 
    esac 

    exit 0
}

Why is this needed:
Combining the compilation for both Linux and Windows in one function can make future support for more OS variants (like windows-arm) challenging. Too many if branches can degrade code readability. By having dedicated functions for each OS, it simplifies the logic, enhances readability, and provides a more scalable approach for future OS support.

@wujunyi792 wujunyi792 added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant