Skip to content

Conversation

yashuatla
Copy link
Owner

@yashuatla yashuatla commented Jun 25, 2025

PR Summary

Add Package Management Enhancements and Bug Fixes

Overview

This PR introduces several package management enhancements including the ability to list outdated packages, update lockfiles without installation, and improves script listing with sorting. It also fixes issues with symlink creation in ELF patching and optimizes git cloning in templates.

Change Types

Type Description
Feature Added ability to list outdated packages
Feature Added --no-install flag to update command
Enhancement Added sorting to ListScripts method
Bugfix Fixed symlink creation in ELF patching
Enhancement Optimized git clone with shallow option
Refactor Improved context handling in Search method

Affected Modules

Module / File Change Description
boxcli/list.go Added --outdated flag to list command
boxcli/update.go Added --no-install flag to update command
devbox/devbox.go Added sorting to ListScripts method
devbox/devopt/devboxopts.go Added NoInstall option to UpdateOpts
devbox/packages.go Added Outdated method and noInstall mode
patchpkg/elf.go Fixed symlink creation with filepath.Base()
searcher/client.go Added context parameter to Search method
templates/template.go Added shallow clone option to git clone

Notes for Reviewers

  • The new outdated packages feature compares current versions with latest available versions
  • The symlink fix in patchpkg/elf.go prevents issues when Soname or LinkerName contain path components
  • Search method signature change may require updates in other calling code

guerinoni and others added 15 commits January 14, 2025 11:35
This allows to have a consistent output from `devbox run`.

Closes jetify-com#1631 and jetify-com#1991.

## Summary

## How was it tested?

I tested running multiple times `devbox run` in different project where
I use it.
## Summary

This allows to cancel the search request.

## How was it tested?

Mostly manual testing
## Summary

TSIA

## How was it tested?
## Summary
This allow to present all new versions available for the pkg installed.
It is a lot useful because otherwise you need to check this manually.

## How was it tested?

In a different repository, this is the output.

<img width="383" alt="Screenshot 2025-01-31 at 17 54 25"
src="https://github.com/user-attachments/assets/6041e24a-8c1c-4d74-8213-99738959cc17"
/>

---------

Co-authored-by: John Lago <[email protected]>
This comment was incorrect. It IsDevboxPackage returns true for runx
(which is okay for this function)

## Summary

## How was it tested?

Signed-off-by: savil <[email protected]>
As part of the auto-patching for CUDA, devbox searches for the system's
libcuda (installed by the driver) and adds it to the Nix store. This
fixes a couple of bugs with that search process:

- When creating the soname links, the base name of the path to libcuda
wasn't being used. This would lead to creating symlinks like
"lib/libcuda.so.1", which would fail because a lib subdirectory didn't
exist.
- Ensure the `src` attribute is set in the patch flake so that devbox
knows the path the flake source (which contains the copied libcuda) at
build time.
…ify-com#2511)

## Summary

Fixes jetify-com#2510 

Previously, `devbox ls --outdated` would error on packages that it could
not resolve, like `stdenv.cc.cc.lib` or
`darwin.apple_sdk.frameworks.IOKit`. This prevented devbox from checking
if the rest of the packages were outdated.

This PR changes the error to a warning, so the rest of the version
checks can proceed

## How was it tested?

1. Create a devbox.json
2. Add standard packages using `devbox add`
3. Add `stdenv.cc.cc.lib` or `darwin.apple_sdk.frameworks.IOKit` to the
project
4. Verify that `devbox ls --outdated` shows a warning for the
non-versioned packages instead of an error.
## Summary

As part of getting devbox working in renovate, we need to run devbox in
renovate's base image (added here
containerbase/base#3191). The problem is the way
nix is installed (already in that image) it cannot actually install
anything. This is because it's a quirky variant of a single user install
where all the `/nix/*` paths are set to custom values.

We can work around this by just having devbox update the lockfile but
not actually install anything (which is also a speed win) - but this
functionality doesn't seem to available in the devbox cli currently.

This is a potential implementation adding what we need for renovate to
upgrade devbox projects. Happy for you to do it another way. The
approach we've taken seems like it's misusing the `mode` variable a
little bit.

## How was it tested?

Manually tested only; run locally on a macbook, plus in the container
linked above.
- add some packages that are older
- upgrade them by manually editing devbox.json
- run `devbox update --no-install` to update all packages in
`devbox.lock` to latest within ranges `devbox.json`
- in the container this failed with `cmd.path=/usr/local/bin/nix
cmd.stderr="cannot connect to socket at
'/tmp/containerbase/cache/nix/state/daemon-socket/socket': No such file
or directory"` but with this change it works
- run `devbox update nodejs --no-install` also works for a single
package
- changes to lockfile seem to be the same as `devbox update` without the
flag, so behaviour of this flag shouldn't surprise anyone
## Summary

Dependabot Merge in 1 PR

## How was it tested?

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
jetify-com#2488)

addresses jetify-com#2487 

## Summary
Creating a project using one of the templates will clone the entire
history of the repo.
Only one commit is really needed in order to access the template files
used to initialize a project.
This change creates a shallow clone with a depth of 1 to reduce the
amount of history that is fetched which should increase speed without
sacrificing any functionality

## How was it tested?
1. `devbox run build`: build devbox
2. `time devbox create --template go test1`: time the devbox create
command and confirm it clones faster and still creates the project
Fixes jetify-com#2411

## Summary
The UV_PYTHON env variables sets which python executable uv will use. 

The current plugin sets the UV_PYTHON value to
`.devbox/nix/profile/default/bin/python` which means `uv pip install `
commands will try to install and save libraries under the
`.devbox/nix/profile/default/lib/python3.x/site-packages` directory.

This will cause an error as the directory doesn't have write permissions
because it exists under a folder that is a symlinked to a folder under
the `/nix/store` path.

This change makes sure UV_PYTHON points to the python executable under
.venv.
This will make `uv pip install` commands install libraries to the
site-packages directory under .venv just like normal `pip install `
would.

## How was it tested?

1. devbox create uvtest --template python-pip
2. cd uvtest
3. devbox add uv
4. uv pip install fastapi
## Summary

When using poetry, with the suggested `init_hook` from the docs:
```
{
    "packages": [
        "python3",
        "[email protected]" // notice I am using poetry 1.8, the poetry shell command is not part of poetry version 2.0
    ],
    "shell": {
        "init_hook": "poetry shell"
    }
}
```
and running `devbox shell`, while the poetry env is being loaded, it
generates this log:
`Using virtualenv:
/home/fotiadis/src/work/trumo/services/tc_gateway_consumer/.venv`

This can be problematic to users instant prompt like the very famous zsh
theme [powerlevel10k](https://github.com/romkatv/powerlevel10k)

By adding the `--quiet` flag this solves the problem

### What about poetry 2.0?

poetry 2.0 has removed the `poetry shell` (the functionality still
exists if you download a plugin). The new way to achieve the same
behavior according to [the
docs](https://python-poetry.org/docs/managing-environments/#activating-the-environment)
is: `eval $(poetry env activate)`

This change doesn't impact either major versions of poetry, and it will
continue to work as normal

## How was it tested?

By disabling the current poetry plugin, and creating a new one that is
the exact copy, just with the flag on
## Summary

Bump to version 0.14.0

## How was it tested?

Confirmed via `nix build .` on localhost

---------

Signed-off-by: John Lago <[email protected]>
searchURL := endpoint + "?q=" + url.QueryEscape(query)

return execGet[SearchResults](context.TODO(), searchURL)
return execGet[SearchResults](ctx, searchURL)
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Undefined variable reference.

The code is trying to use 'ctx' which is not defined in this function's parameter list, causing a compilation error.

Current Code (Diff):

- 	return execGet[SearchResults](ctx, searchURL)
+ 	return execGet[SearchResults](context.TODO(), searchURL)
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
return execGet[SearchResults](ctx, searchURL)
return execGet[SearchResults](context.TODO(), searchURL)

}

func (c *client) Search(query string) (*SearchResults, error) {
func (c *client) Search(ctx context.Context, query string) (*SearchResults, error) {
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Breaking API Change: Context Parameter Added.

Adding a context parameter to Search() will break all existing callers of this method, causing compilation failures until they're updated.

📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
func (c *client) Search(ctx context.Context, query string) (*SearchResults, error) {
func (c *client) Search(ctx context.Context, query string) (*SearchResults, error) {

🔄 Dependencies Affected

internal

Function: (*client).Search

Issue: The function now uses context in its implementation to call execGet

Suggestion: Ensure all callers of Search() are updated to provide a context parameter

Proposed Code:

return execGet[SearchResults](ctx, searchURL)

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.

9 participants