Skip to content

xtool/cppkg:install in linux#1104

Merged
xushiwei merged 2 commits intogoplus:mainfrom
luoliwoshang:unix/install
May 11, 2025
Merged

xtool/cppkg:install in linux#1104
xushiwei merged 2 commits intogoplus:mainfrom
luoliwoshang:unix/install

Conversation

@luoliwoshang
Copy link
Member

@luoliwoshang luoliwoshang commented May 9, 2025

  1. conan not in apt-get ' resource,so we could not use apt-get to install conan,and use pip install will got follow error,and the suggestion in the error message tips to use pipx.
> python3 -m pip install conan
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

user need install pipx,so when user not install pipx or brew notify error message with app manager.

root@259c7fd049f2:~/llgo/cmd/llgo# llgo cppkg install kspalaiologos/bzip3@1.5.1
From https://github.com/goplus/cppkg
 * branch              main       -> FETCH_HEAD
Already up to date.
panic: app managers not found: brew, pipx: executable file not found in $PATH

@luoliwoshang luoliwoshang changed the title [wip] xtool/cppkg install by pipx xtool/cppkg:install by pipx May 9, 2025
@codecov
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.34%. Comparing base (98bd05b) to head (d3e228c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1104   +/-   ##
=======================================
  Coverage   87.34%   87.34%           
=======================================
  Files          29       29           
  Lines        7225     7225           
=======================================
  Hits         6311     6311           
  Misses        849      849           
  Partials       65       65           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@luoliwoshang luoliwoshang marked this pull request as draft May 9, 2025 06:47
@luoliwoshang luoliwoshang marked this pull request as ready for review May 9, 2025 07:44
@luoliwoshang luoliwoshang changed the title xtool/cppkg:install by pipx xtool/cppkg:conan detect & install in linux May 9, 2025
@luoliwoshang luoliwoshang marked this pull request as draft May 9, 2025 08:41
@luoliwoshang luoliwoshang force-pushed the unix/install branch 3 times, most recently from bf7f776 to d3e228c Compare May 9, 2025 08:46
@luoliwoshang luoliwoshang marked this pull request as ready for review May 9, 2025 09:15
return
}

err = conanDetect(app, out)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should conan detect run every time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's only necessary to detect the profile once after installing Conan, should we skip conan profile detect if a profile already exists (i.e., if conan profile show executes successfully)

func conanDetect(app string, out io.Writer) (err error) {
	profileCmd := exec.Command(app, "profile", "show")
        // ....
	profileErr := profileCmd.Run()
	if profileErr == nil {
		return
	}
        // ...

or would you rather recommend letting the subsequent conan install step fail and prompt the user to run profile detect

notFoundMgs = append(notFoundMgs, am)
}
err = ErrNotFound
err = fmt.Errorf("app managers not found: %s: %w", strings.Join(notFoundMgs, ", "), ErrNotFound)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normally it's an unreachable path. so don't need have a kindly message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Linux, pipx might not be a very commonly used installation method, unlike brew or apt-get. So,I think a prompt like the one below could help reduce confusion during usage:

root@259c7fd049f2:~/llgo/cmd/llgo# llgo cppkg install kspalaiologos/bzip3@1.5.1  
From https://github.com/goplus/cppkg  
 * branch              main       -> FETCH_HEAD  
Already up to date.  
panic: app managers not found: brew, pipx: executable file not found in $PATH  

@luoliwoshang luoliwoshang changed the title xtool/cppkg:conan detect & install in linux xtool/cppkg:install in linux May 10, 2025
@luoliwoshang luoliwoshang reopened this May 10, 2025
@luoliwoshang luoliwoshang reopened this May 10, 2025
@xushiwei xushiwei merged commit 10d603b into goplus:main May 11, 2025
122 of 124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants