Git Product home page Git Product logo

baulk / baulk Goto Github PK

View Code? Open in Web Editor NEW
352.0 10.0 34.0 17.73 MB

baulk - Minimal Package Manager for Windows

License: MIT License

CMake 0.54% C++ 26.56% C 70.47% PowerShell 0.18% Makefile 1.76% Assembly 0.23% Batchfile 0.02% Starlark 0.03% Python 0.01% Shell 0.06% Inno Setup 0.06% Roff 0.07%
windows installer baulk bucket baulk-bucket portable interesting package-management cpp20 software-management

baulk's Introduction

Baulk - Minimal Package Manager for Windows

license badge Master Branch Status Latest Release Downloads Total Downloads Version 996.icu

简体中文

Baulk is a minimalist, portable package manager for Windows.

Why Baulk

Baulk was originally born to solve the inefficiency of the package manager command devi of Clangbuilder, and devi is based on Powershell, and the poor performance is self-evident.

In May 2020, when Microsoft announced the Windows Package Manager Preview, Baulk had been in development for several months. It did not mean that winget appeared, and similar tools would not develop. In addition, Baulk is better than package managers such as winget/scoop in terms of portability, isolation, virtual environment, and zero dependencies on tools. These are the reasons for its existence.

Features

  • Core feature is of course the package management function, which is portable and free of installation. All packages, whether msi/exe or other archives, will be decompressed by Baulk to the root directory of the package itself.
  • Environment isolation and virtual environment
    • All packages have their own directory, and the invocation of the program in the package is initiated through its launcher or symbolic link, and the environment variables do not interfere or affect.
    • There are different major versions of the same software, and different distributions can be switched through venv, such as openjdk/msjdk.
  • Excellent package extraction experience: Baulk itself provides decompression capabilities in zip/tar and other formats, supports automatic detection of filename encoding, and avoids garbled filenames caused by CodePage.
    • Baulk also provides baulk extract/unzip/untar commands for users to use baulk's decompression function in other scenarios.
    • Baulk also provides Unscrew Extractor (unscrew) a minimalist graphical decompression tool that can be integrated into the right-click menu to provide the ability to decompress tar.* files with one click.
  • Limited compatibility with scoop manifest (compatibility mode, inability to use baulk advanced features like environment isolation and virtual environments).
  • Written in pure C++20 with superior performance.
  • IntelliSense network settings when downloading packages.
  • Supports updating buckets using github-archives or git.
  • Baulk also provides the baulk brand command to detect operating system information.

Get Started

We can go to Github Release to download the latest version:https://github.com/baulk/baulk/releases/latest, If in doubt, refer to the table below.

Installation Mode x64 arm64 Remark
Completely Portable Baulk-${VERSION}-win-x64.zip Baulk-${VERSION}-win-arm64.zip Unzip it to any directory and double-click baulk-terminal.exe (you can also create a shortcut for it)
Installation without administrator rights BaulkUserSetup-x64.exe BaulkUserSetup-arm64.exe Double click to run the installer
Install with administrator privileges BaulkSetup-x64.exe BaulkSetup-arm64.exe Double click to run the installer
Experimental Experience Appx Baulk-x64.appx Baulk-arm64.appx baulk version > 4.0

Once installed you can experience Baulk:

# Install any packages you need
# baulk i neovim curl wget ripgrep belautils
baulk install neovim curl wget ripgrep belautils
# Now you can run commands like curl in Windows Terminal 
curl -V
# update metadata (bucket)
# baulk u --> baulk update && baulk upgrade
baulk update
# upgrade package
baulk upgrade
# uninstall package
# baulk r wget
baulk uninstall wget

Look, it's so simple!

Search package:

Integration into Windows Terminal (shell replacement):

Changelog

Changelog

Baulk tools usage

Usually you can run baulk -h to see help for commands (other commands are also -h), you can also see:Detailed Help

Advanced Experience with Baulk

Other Baulk Tools

Barrels - Baulk environment dock (Windows 11 22H2 or Later)

Build Baulk

  • Visual Studio 2022 (17.2 or later)
  • Windows SDK 10.0.22000.0
  • CMake 3.22.0 or Later
git clone https://github.com/baulk/baulk.git
cd baulk
mkdir build
cd build
cmake -GNinja ..
ninja all

Article

《Baulk - 开发一个简单的包管理工具历程》

Thanks

Baulk depends many license-friendly open source projects, I would like to express my sincere gratitude.

Baulk Icons made by Smashicons from www.flaticon.com

baulk's People

Contributors

0-v-0 avatar chungzh avatar fcharlie avatar spectershell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

baulk's Issues

软件缺少问题

对于现在的软件缺少问题应如何解决,看 Issues 有说过想要兼容 scoop 软件需要做一些适配,具体指的是?想要抛弃 scoop 全力转用 baulk(短时间内应该无法实现)

Installation Scripts support

When I was using WindowsAppSDK to develop some extension tools for Baulk, I found that there may be some troubles in installing unpackaged software developed based on WindowsAppSDK in Baulk, and additional runtime components need to be installed(WindowsAppRuntimeInstall.exe: Windows App SDK deployment guide for framework-dependent non-MSIX-packaged apps), which does not seem to work in Baulk.

Although Baulk has repeatedly emphasized portability, try to be green, and use it out of the box, on Windows, this goal does not seem to be so feasible, and now WindowsAppSDK has caused us trouble.

Here I am going to add an installation script mechanism, that is, a specific package can choose to carry some scripts to do some actions before and after installation, before uninstallation and after uninstallation, to support the installation of specific dependencies and do some cleaning.

Resolve new filename after redirected

WINHTTP_CALLBACK_STATUS_REDIRECT

An HTTP request is about to automatically redirect the request. The lpvStatusInformation parameter contains a pointer to an LPWSTR indicating the new URL. At this point, the application can read any data returned by the server with the redirect response and can query the response headers. It can also cancel the operation by closing the handle.

See: WINHTTP_CALLBACK_FLAG_REDIRECT
See: WinHttpSendRequest (add context)

WinHttpSetStatusCallback( hRequest, &callback, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | 
            WINHTTP_CALLBACK_FLAG_SECURE_FAILURE | WINHTTP_CALLBACK_FLAG_SEND_REQUEST | WINHTTP_CALLBACK_STATUS_REDIRECT, NULL);

check process is running

func isRunning(pid int) (bool, error) {
	procHnd, err := syscall.OpenProcess(syscall.PROCESS_QUERY_INFORMATION, true, uint32(pid))
	if err != nil {
		if scerr, ok := err.(syscall.Errno); ok {
			if uintptr(scerr) == error_invalid_parameter {
				return false, nil
			}
		}
	}

	var code uint32
	err = syscall.GetExitCodeProcess(procHnd, &code)
	if err != nil {
		return false, err
	}

	return code == code_still_active, nil
}

baulk::archive::tar A design to reduce memory copy

baulk::archive::tar draws on the golang io.Reader interface design. This abstraction is very simple, but when using compression like zlib/bzip2/xz, one more data copy is needed, otherwise the compression context is not easy to handle A simpler solution is to add a new interface to change the copy memory into a reference memory, which seems to save a data copy.

Support unzip files

In fact, we can use libzip/libarchive/zlib/bzip2/lzma to decompress the package, which has the advantage of improving the progress output during decompression. But this is still an intention and needs to be studied.

请问怎么删除?

已经按照文档说明执行了对应操作。但并没在右键菜单中看见。现在想卸掉、请问怎么卸载掉啊。

baulk::archive::zip small file decompression optimization

libdeflate is a library for fast, whole-buffer DEFLATE-based compression and decompression.

The supported formats are:

  • DEFLATE (raw)
  • zlib (a.k.a. DEFLATE with a zlib wrapper)
  • gzip (a.k.a. DEFLATE with a gzip wrapper)

Many benchmarks show that well-designed libdeflate is much faster than zlib. But libdefalte does not support streaming compression and decompression. If the entries in the zip are particularly large, this requires a lot of space to be allocated at one time. This experience is not good, but we can use libdeflate to decompress some submitted smaller entries. Fortunately, there is uncompressedSize in the zip entry that represents the original size of the file. We can decompress files with uncompressedSize <2 MB using libdeflate to shorten the time taken for baulk::archive::zip decompression in many cases.

References:

ServerFault: Faster zlib alternatives [closed]

Terminal integration: Default Windows Terminal Profile Injection

A new command has been added to help users inject Windows Terminal's default configuration file (powershell/cmd) to run with environment variables constructed by baulk-exec.

Before:

            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "fontFace": "等距更纱黑体 SC",
                "fontSize": 12,
                "colorScheme": "One Half Dark",
                "name": "Windows PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },

After:

           {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "fontFace": "等距更纱黑体 SC",
                "fontSize": 12,
                "colorScheme": "One Half Dark",
                "name": "Windows PowerShell",
                "title": "Windows Terminal 💖 Baulk",
                "commandline": "C:\\baulk\\bin\\baulk-exec.exe --vs pwsh"
            }

off-topic: any community channel?

之前在 V2EX 看到宣传帖就关注了,对整个项目挺感兴趣和支持的,稍微尝试过一下,感觉还不太成熟,不过有些很亮眼的地方
。其实我有些想法,不过鉴于目前对项目整体不太熟悉,不好发表评论,我对 C/C++ 不是很了解,只能读个大概。作者有没有兴趣开个 Telegram group / Discord server 之类的讨论组给大家交流下?

P.S. 我是 Scoop 维护者之一,虽然已经名存实亡。

Add baulkexec command

By implementing the baulkexec command to support the execution of some commands according to the baulk environment settings, this is very helpful for future operations such as CI integration.

Baulk 4.0 Roadmap

Although baulk is a very portable package management tool, it does not mean that baulk cannot go further. Baulk 4.0 will be a very interesting version, and there may be many changes. If you want to add any features to baulk, please feel free to suggest it.

  • Better VFS design
  • Windows 11 context menu support
  • More C++20/23 experience
  • Better file extraction experience
  • Limited compatibility with scoop manifest (?)
  • More powerful bucket management and mirroring mechanism
  • baulk breakpoint download support
  • Integrate a better memory allocator, such as mimalloc
  • baulk brand command

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.