Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
宣言的パッケージマネージャー
Search
tositada_nakada
March 10, 2025
0
3
宣言的パッケージマネージャー
tositada_nakada
March 10, 2025
Tweet
Share
More Decks by tositada_nakada
See All by tositada_nakada
とあるAWS開発者の開発環境
tositada17
0
250
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Heart Work Chapter 1 - Part 1
lfama
PRO
3
35k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The Curious Case for Waylosing
cassininazir
0
190
Game over? The fight for quality and originality in the time of robots
wayneb77
1
67
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
760
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
GitHub's CSS Performance
jonrohan
1032
470k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
Transcript
purely functional package manager tositada 宣言的パッケージマネージャー
プレゼンの概要 • 宣言的パッケージマネージャーとは
宣言的パッケージマネージャーとは • Reproducible(再現性) • 隔離された環境でパッケージのビルドを行うため、 • 依存関係を関係なく再現性の高いパッケージマネージャーを用意しま す。 • Declarative(宣言的)
• プロジェクト毎に開発環境と、ビルド環境を提供できます。 • プログラム言語や、ビルドツールは不要です。 • Reliable(信頼性) • Nixパッケージは他のパッケージに影響を与えません。 • 以前の状態にロールバックできます。
従来のパッケージマネージャー package lib firefox LibraryA V1.0 LibraryB V1.0 python LibraryC
V1.0 Firefox→ LibraryA >= version1.0, LibraryB >= version1.0 Python→ LibraryB >= version1.0, LibraryC >= version1.0 Firefoxだけアップデートする。
従来のパッケージマネージャー package lib firefox LibraryA V1.1 LibraryB V1.1 python LibraryC
V1.0 Firefox→ LibraryA >= version1.1, LibraryB >= version1.1 Python→ LibraryB >= version1.0??, LibraryC >= version1.0 LibraryB V1.0 見つからない!! Firefoxだけアップデートした場合他に紐づくパッケージがアップデートされ 別で使用している場合に動作しなくなる場合がある。
宣言的パッケージマネージャーの仕組み 宣言的パッケージマネージャーはパッケージ自体が独立したライブラリー を持ち、自身の範囲だけを参照するため依存関係が関係ない。 • 従来 /usr/bin/python3 /usr/lib/python /usr/share/man/man1/python • 宣言的パッケージマネージャーの場合
/nix/store/y305nk66f3rgz3vbmsy51sfi4j1gpj2h-python3- 3.9.21/bin/python /nix/store/y305nk66f3rgz3vbmsy51sfi4j1gpj2h-python3- 3.9.21/lib/python3.9 /nix/store/y305nk66f3rgz3vbmsy51sfi4j1gpj2h-python3-3.9.21/ share/man/man1/python
宣言的パッケージマネージャーの仕組み profileを呼び出して実行する。 profileは各パッケージをシンボリックリンクで指している。 echo $PATH $PATH=/nix/var/nix/profile/system/sw/bin /nix/var/nix/profiles/system/ -> system-15-link /nix/var/nix/profiles/system-15-link/sw/bin/python
-> /nix/store/xxxx-python/bin/python /nix/var/nix/profiles/system-15-link/sw/bin/bash /nix/var/nix/profiles/system-15-link/sw/bin/git /nix/var/nix/profiles/system-15-link...
宣言的パッケージマネージャーの仕組み profileを小分けにしておけば、特定の条件ではprofileを読み込ん だり、読み込まなかったり設定できる。 echo $PATH $PATH=/home/user/.local/state/nix/profile/: /etc/profiles/per-user/user/bin... /run/wrappers/bin/
代表的な宣言的パッケージマネージャー • Nix(ニックス) 10万を超えるパッケージを抱えるパッケージマネージャー Nix言語を使ってパッケージのインストールを行う。 • GuiX(ギークス) gnu packageの宣言的パッケージマネージャー、 gnuパッケージなので、GPLライセンスしか取り扱わない。Firefoxも
存在しない。非公式パッケージには存在する。 3万を超えるパッケージを抱える Schemaを使ってパッケージのインストールを行う。