Commit Graph

150 Commits

Author SHA1 Message Date
Antoine Prouvost 7ce51b3de9
Compile with C++20 (#3965) 2025-06-04 11:28:11 +02:00
Johan Mabille aeb417f617
Out of context (#3952) 2025-05-26 14:37:16 +02:00
Johan Mabille 6115ac5cf2
Context dependency reduction (#3949) 2025-05-21 13:01:47 +02:00
Antoine Prouvost 06000139c9
Refactor `SubdirData` > `SubdirIndexLoader` (#3940) 2025-05-15 16:57:52 +02:00
Sandrine Pataut b6b1143b1b
feat: add envs flag to info command (#3837) 2025-03-05 16:11:55 +01:00
Ayaz Salikhov c59969ab05
maint: Add missing thread and undefined sanitizers CMake options (#3753) 2025-01-16 14:05:35 +01:00
Ayaz Salikhov 76d06a7f5a
maint: Cleanup CMake files and delete not compiled files (#3667) 2024-12-09 20:27:12 +01:00
Henry Schreiner 020b1163c6
fix: support homebrew/linuxbrew (AppleClang, GCC 11) (#3613)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-11-21 16:39:07 +01:00
Ayaz Salikhov 0a8128d23e
maint: Enable `-Werror` compiler flag for GCC, Clang and AppleClang (#3611) 2024-11-21 13:50:09 +01:00
Henry Schreiner 5bfdd90adf
chore: some CMake cleanup (#3564)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-10-28 11:58:57 +01:00
Julien Jerphanion bd8c1d2e4d
fix: Only register channels in the context once (#3521)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-10-23 11:09:48 +02:00
Hind-M ad8ca3cf02
Compute `root prefix` as mamba install path (#3447)
* Compute root prefix as mamba install path

* Run test only on linux

* Test conflict between conda and mamba with same base env in CI

* Change strategy

* Use target_compile_definitions instead of add_definitions

* Add test logs

* Add ENABLE_MAMBA_ROOT_PREFIX_FALLBACK OPTION
2024-09-20 14:36:17 +02:00
Johan Mabille f8bb11c853
Fixed micromamba static build after cctools and ld64 upgrade on conda… (#3436)
Fixed micromamba static build after cctools and ld64 upgrade on conda-forge
2024-09-09 16:53:28 +02:00
Julien Jerphanion c4a6e78a78
fix: PyPI support for `env update` (#3419)
* Simple fix

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* Factor elements in `pip_utils.{hpp,cpp}`

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* docs: Add TODO

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* test: Creation and update of env with pip sections

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* Use quiet mode for pip

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* Address review comments

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>

* Invert headers' inclusion

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* Address review comments

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Add more tests

* Use enum instead of bool

* Adapt tests

* Add warning

* Clean up

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
2024-09-05 15:41:39 +02:00
Hind-M 3e1e97b0e6
Add checking typos to pre-commit (#3278)
* Add checking typos to pre-commit

* Add missed corrections

* Add more corrections to doc
2024-05-27 09:16:14 +02:00
Antoine Prouvost 327534724a
Refactor os utilities (#3248)
* Refactor make_virtual_package

* Refactor macos_version

* Add new windows_version

* Add __win virtual package version

* Use new util::windows_version

* Add virtual packages version test

* Add Plaform os detection

* Refactor linux_version

* Fix linux_version on mac with unix_name_version
2024-03-28 14:08:35 +01:00
Antoine Prouvost 7942d3feaf
Handle regex in build string (#3239) 2024-03-20 18:52:22 +01:00
Antoine Prouvost 43e38efb18
Custom resolve complex MatchSpec in Solver (#3233)
* Add ObjPool::current_error

* Support reference_wrapper in MatchSpec::contains

* Rename subdir > platform in solv-cpp

* Add Matcher as namespace callback

* Add MatcherFlags

* Redefine MatchSpec::is_simple

* Add VersionSpec::from_predicate

* Refactor reinstall jobs

* Fix MatchSpec::is_simple

* Handle complex MatchSpec in solver

* Add version cache in Matcher

* Add more pool namespace tests

* Handle exception in ObjPool callback

* Try removing SOLVABLE_PROVIDES

* Add unsolvable complex spec test

* Fix Database callback exceptions

* Add channel in Matcher

* Adapt channel_specific tests

* Fix updates
2024-03-19 19:52:56 +01:00
Antoine Prouvost 02b36ba5a2
Mamba 2.0 name fixes (#3225)
* Change default mamba root prefix

* Name generic rc_file_content

* Refactor other rc content executable names

* Allow mamba name in sh shells

* Adapt test_activate.py to use mamba/micromamba name

* Allow mamba name in tcsh shells

* Fix micromamba names

* Rename extrac_subroc_mode::micromamba ? mamba_exe

* Rename is_micromamba > is_mamba_exe

* Change more micromamba names

* Fix test_shell.py

* Adapt mamba name in Win shell wrappers

* Adapt mamba name in Win powershell wrappers

* Remove an occurence of micromamba

* Fix wrap_call on Windows

* Deactivate failing test
2024-03-14 16:01:05 +01:00
Hind-M ce840bbf8c
[mamba content trust] Enable verifying packages signatures (#3192)
* Enable verifying packages signatures

* Remove post hook and use LOG_DEBUG instead of LOG_INFO

* Move getting "signatures" from `pkg_signatures` to `verify_package`

* Add tests for solvable and PackageInfo
Remove signatures from field in PackageInfo

* Add const and reorganize repo_checker
Add text in description for verify-package flag

* Add bindings and make `trusted_channels` configurable

* Define MAX_CONDA_TIMESTAMP

* Code review

* Add tests for add_repo_from_repodata_json in test_database

* Remove fake_signatures in favor of optional
2024-03-08 20:37:18 +01:00
Johan Mabille 8f276cbefa
Added HTTP Mirrors (#3178)
* Added HTTP Mirrors

* Mirror mirror on the wall...

* True hope lies beyond the coast

* You're a damned kind can't you see

* That the winds will change

* Mirror mirror on the wall

* True hope lies beyond the coast

* You're a damned kind can't you see

* That tomorrow bears insanity
2024-02-27 18:47:30 +01:00
Antoine Prouvost 88748be956
Use expected for specs parsing (#3201)
* Expected in Version::parse

* Use boolean check in expr trees

* Expected in VersionSpec::parse

* Add assert caster safeguard

* Expected in BuildNumberSpec::parse

* Minor improvement in GlobSpec

* Expected in UnresolvedChannel::parse

* Expected in URL::parse
2024-02-27 09:35:27 +01:00
Antoine Prouvost afdb5a185d
Simple logging fix (#3184) 2024-02-08 23:02:22 -05:00
Antoine Prouvost daeb96cb08
Make libsolv wrappers into standalone library (#3181)
* Move solv-cpp into standalone library

* Remove mamba namespace from solv-cpp

* Switch solv-cpp to object library

* Install solv-cpp object library

* Fix doctest

* Fix windows path
2024-02-08 10:49:53 -05:00
Antoine Prouvost d20d176b86
Rename MPool into solver::libsolv::Database (#3180)
* Move only MPool

* Rename MPool > Database

* Move Database to solver::libsolv

* Add missing explicit

* Rename pool in function names

* Rename core/pool.hpp package_database_loader
2024-02-08 16:41:11 +01:00
Antoine Prouvost a2a2d26445
Simplify MPool Interface (#3177)
* Remove some use to MPool::ChannelContext

* Explicit palette in UnSolvable

* Explicit option for use_only_tar_bz2 in Pool

* Remove context from Pool

* Remove Context capture in Pool

* Remove ChannelContext capture in Pool

* Silence warnings

* Chane Unsolvable to use solv::ObjPool

* Fine grain control of MPoll raw access

* Remove MPool::id2pkginfo

* Remove MPool::matchspec2id and select_solvables

* Remove MPool::dep2str

* Auto create_whatprovides in repoquery

* Remove MPool::create_whatprovides

* Change MPool::remove_repo API

* Private libsolv
2024-02-07 09:25:37 -05:00
Antoine Prouvost d4c9f96dea
Proper sorting of display actions (#3165)
* Add variant compare

* Sort actions not strings
2024-01-31 14:27:22 -05:00
Antoine Prouvost dedf072874
Split Solver and Unsolvable (#3156)
* No capture MPool in Solver

* Solution in MSolver

* Change MTransaction solver ctor

* Split UnSolvable from MSolver

* Implement MSolver Outcome

* Private SolverProblem

* Move UnSolvable to solve::libsolv

* Move sat* solver::problems_graph

* Clean test_problems_graph

* Move MSolver to solver::libsolv

* Rename MSolver > Solver

* Add minimal 2.0 doc

* Bind solver::Solution

* Move problems_graph bindings to libmambapy.solver

* Change Solver namespace

* Move Solver bindings to libmambapy.solver.libsolv
2024-01-30 22:20:36 +01:00
Johan Mabille f7c763082d
Implemented support for mirrors (#3157)
* Implemented support for mirrors

* Changes according to reviews
2024-01-30 18:31:07 +01:00
Johan Mabille a63587da2e
Moved download related files to dedicated folder (#3155) 2024-01-25 20:45:54 +01:00
Antoine Prouvost a310d31da9
Improve Solution usage (#3148)
* Rename Solution > solver::Solution

* Try noarch relink in solution space

* Remove dead code

* Move relink computation to helpers

* Refactor find_installed_python

* Add Loop control break to Solution

* Refactor find_new_python_in_solution

* Add  solution_needs_python_relink

* Change Py relink decision

* Remove dead relink_noarch

* Delete TransationContext copy ctor in favor of default move ctor.

* Refactor transaction_to_solution

* Refactor MSolver::add_request

* Free MSolver::add_reinstall_job

* Refactor Solution filter

* Refactor is_any_of

* Add solver Request for_each_of

* Remove MSolcer remove/installed_specs

* Refactor add_job_impl

* Use expected_t in add_job_impl

* Remove MSolver::m_jobs

* Refactor request_to_decision_queue
2024-01-25 15:23:15 +01:00
Antoine Prouvost a190d9394c
Solver Request (#3141)
* Change type for MSolver::add_pin

* Add Solver Request 1

* Add Solver Request 2

* Add Solver Request 3

* Cleanup retry flags

* Remove constant parameter

* Add Solver Request 4

* Add Request::Freeze

* Add Request::Keep

* Add Request::UpdateAll

* Remove MSolver::add_global_job

* Use MSolver::add_request for remove

* Remove MSolver::add_jobs

* Remove MSolver::add_pins

* Add api/install pins in request

* Add api/update pins in request

* Remove MSolver::add_pin

* Remove dead MSovler neuter_specs & pinned_specs

* Move Request to solver::Request

* Bind solver::Request

* Apply review comments
2024-01-23 13:38:11 +01:00
Antoine Prouvost 7d6856e9b5
MRepo refactor (#3118)
* Rename Enum members in MRepo

* use solv::Pool in MRepo

* Free MRepo add_pip_as_python_dependency

* Free MRepo repodata reading

* Free MRepo read_solv

* Free MRepo write_solv

* Remove MRepo constructor

* Remove MPool capture from MRepo

* Add missing pip dependency

* Refactor solv file serialization

* No lock on non-existant files

* Cleanup dead code

* write_solve create-directories

* Clean MRepo member functions

* Decouple MRepo and Pool

* Finetune Clang-format

* Add filename location to error

* Do not fail on solv file write

* Load new pool loader for repodata and .solv files

* Remove repo name in favor of URL

* Refactor MRepo index loading

* Fix SubDirData.writable_solv_cache

* Fix solv file loading

* Lock repodata.json while reading metadata

* Refactor expected in load_subdir_in_pool

* use expected in solver helpers

* Refactor helpers functions and error messages in Repo

* Add MPool::create_repo_from_packages

* Use load_installed_packages_in_pool

* Remove MRepo ctor

* Fix rebase

* Refactor MRepo::priority

* Update Taskfile realpath to work on MacOS

* Fix virtual packages being removed

* Move MRepo::priority to MPool

* Rename MRepo > solver::libsolv::RepoInfo

* Move RepoInfo parameters for its own library

* Move make_package_info to helpers

* Add libmambapy.solver.libsolv

* Add solver::libsolv::Priorities op

* Bind libsolv parameters

* Bind RepodataOrigin

* Merge libsolv/serialization and libsolv/parameters

* Bind new MPool methods

* Add RepoInfo op

* Add RepoInfo changes to log

* Rename attribute

* Remove RepoInfo::repo
2024-01-17 16:44:47 +01:00
Antoine Prouvost 8e9b376161
Move util_random.hpp > util/random.hpp (#3129)
* Move util_random.hpp > util/random.hpp

* Use new random in libmamba

* Use template instanciation instead
2024-01-16 10:14:45 +01:00
Antoine Prouvost 13d034147f
Rename ChannelSpec > UndefinedChannel (#3117)
* Rename ChannelSpec > UndefinedChannel

* Rename UndefinedChannel > UnresolvedChannel
2024-01-09 13:52:23 +01:00
Antoine Prouvost 717456890a
Move PackageInfo in specs:: (#3109)
* Move PackageInfo in specs::

* Move PackageInfo in specs::

* Rename PackageInfo::url > PackageInfo::package_url

* Add changelog entry

* Add MatchSpec migration help
2024-01-08 16:06:22 +01:00
Antoine Prouvost 1633630e68
Refactor MatchSpec unlikey data (#3099)
* Fix test names

* Hide MatchSpec implementation detail

* Add heap_optional

* Refactor MatchSpec unlikely members

* Make private use of MatchSpec bracket

* Refactor MatchSpec switch

* Remove map from MatchSpec
2024-01-04 18:14:21 +01:00
Antoine Prouvost 276321427e
Add BuildNumberSpec (#3098)
* Add BuildNumberSpec

* Fix test case name

* use BuildNumberSpec in MatchSpec

* Fix BuildNumberSpec

* Simplify BuildNumberPredicate
2024-01-04 11:57:58 +01:00
Antoine Prouvost 18b77d62be
GlobSpec (#3094)
* Fix include guard

* Add GlobSpec

* Use GlobSpec for MatchSpec build_string

* Make MatchSpec::name a GlobSpec
2024-01-03 09:17:17 +01:00
Antoine Prouvost 1b56e38001
Add parsing utilities (#3090)
* Add util/parsers skeletton

* Add find_matching_parentheses

* conditional refactor

* Add find_not_in_parentheses

* Add some doc

* Add find_not_in_parentheses substr overload

* Add glob_match

* Remove warning
2024-01-02 10:52:44 +01:00
Antoine Prouvost 15e8056029
Some future proofing MatchSpec (#3082)
* Private MatchSpec::name

* Private MatchSpec::filename

* Private MatchSpec::url

* Make MatchSpec::is_file a function

* Private MatchSpec::namespace

* Private MatchSpec::build_number

* Remove dead affectation

* Private MatchSpec::optional

* Remove dead code

* Clean MatchSpec dist parsing

* Fix MatchSpec dist parse

* Private MatchSpec::version

* Private MatchSpec::build_string

* Private MatchSpec::channel

* Add missing MatchSpec setters

* Put MatchSpec in specs::
2023-12-26 17:23:33 +01:00
Johan Mabille 4f2d1ebd43
Added mamba as dynamic build of micromamba (#3060) 2023-12-14 14:22:31 +01:00
Orion Poplawski 72d5eb1895
Fix libmamba cmake version file (#3013) 2023-12-07 23:33:39 +01:00
Orion Poplawski 96e9be052b
Drop unneeded dependencies (#3016) 2023-12-07 16:02:01 +01:00
Antoine Prouvost c529199eef
Split validate.[ch]pp (#3041)
* Split validation errors

* Split validation keys

* Fix header include

* Split validation versioned namespaces

* Trailing return types

* Split update framework implementation

* Finish validation split

* Fix missing header
2023-12-06 19:34:19 +01:00
Antoine Prouvost 9c68ee239b
Refactor (some) OpenSSL functions (#3024)
* Add sha256 to cryptography

* Refactor cryptographic hasher

* Use new hasher in validation

* Split util::encoding

* Improve hash tests

* Move and refactor cache_name_from_url

* Fix conversion

* Fix namespace

* Fix conversion

* Refactor Base64 encoding

* Move URL percent encoding

* Document encoding.hpp

* Move EVPContextDeleter

* Add doc to DigestHasher

* Remove util::hex_string

* Add UTF8 source file encoding on Windows

* Add hex_to_bytes

* Use util::hex_to_bytes

* Private Digest inheritance

* Make thread_local hasher

* Use digester in validation

* Fix Win
2023-12-04 16:11:35 +01:00
Antoine Prouvost 1ee4893eeb
Move core/channel > specs/channel (#3000)
* Move core/channel > specs/channel

* Remove unnecessary [[nodiscard]]

* Minor specs::Channel improvements

* Add value based ChannelResolveParams

* Add specs::Channel tests

* Add more Channel tests

* ChannelContext::context const only

* Remove unnecessary ChannelContext functions

* Rename core/channel.hpp > core/channel_context.hpp

* Sort (some) CMake files

* Refactor ChannelContext constructor

* Review comments

* Const reference

* Use ChannelContext::make_conda_compatible
2023-11-22 15:29:34 +01:00
Antoine Prouvost 139b7ef020
Refactor env::which (#2997)
* Clenup env::which

* RAII C calls

* Refactor which functions

* Remove second param from which

* Change which namespace

* Fix which extension

* Add missing OSX headers

* Add util::which tests
2023-11-20 15:13:22 +01:00
Antoine Prouvost 2210f7db06
Add weakening_map (#2981)
* Add weakening_map

* Use weakening_map in Channel
2023-11-16 11:27:37 +01:00
Antoine Prouvost 0d42e81667
Modularize libmambapy (#2960)
* Modularize libmambapy

* Add test-libmambapy to Taskfile

* Fix libmamba installation

* Fix standalone libmambapy configuration

* Change libmambapy layout

* Add scikit-build

* Fix libmambapy extension name

* Add submodules shims

* Fix libmambaoy tests

* Fix stubgen

* Adapt libmambapy tests to scikit-build

* Read version from Python

* Replace confusing names
2023-11-10 18:29:16 +01:00