Skip to content

right align size in solve table#1399

Merged
wolfv merged 1 commit intoprefix-dev:mainfrom
bollwyvl:patch-1
Jan 30, 2025
Merged

right align size in solve table#1399
wolfv merged 1 commit intoprefix-dev:mainfrom
bollwyvl:patch-1

Conversation

@bollwyvl
Copy link
Copy Markdown
Contributor

Thanks for rattler-build!

As I watch more builds, I noticed that the logged solve table doesn't
right-align package sizes, making it rather hard to do any kind of visual comparison.

 │ │ ╭──────────────────┬────────────┬────────────────────┬─────────────┬────────────╮
 │ │ │ Package          ┆ Version    ┆ Build              ┆ Channel     ┆ Size       │
 │ │ ╞══════════════════╪════════════╪════════════════════╪═════════════╪════════════╡
 │ │ │ _libgcc_mutex    ┆ 0.1        ┆ conda_forge        ┆ conda-forge ┆ 2.50 KiB   │
 │ │ │ _openmp_mutex    ┆ 4.5        ┆ 2_gnu              ┆ conda-forge ┆ 23.07 KiB  │
 │ │ │ bzip2            ┆ 1.0.8      ┆ h4bc722e_7         ┆ conda-forge ┆ 246.86 KiB │
 │ │ │ ca-certificates  ┆ 2024.12.14 ┆ hbcca054_0         ┆ conda-forge ┆ 153.41 KiB │
 │ │ │ ld_impl_linux-64 ┆ 2.43       ┆ h712a8e2_2         ┆ conda-forge ┆ 653.53 KiB │
 │ │ │ libffi           ┆ 3.4.2      ┆ h7f98852_5         ┆ conda-forge ┆ 56.93 KiB  │
 │ │ │ libgcc           ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 828.85 KiB │
 │ │ │ libgcc-ng        ┆ 14.2.0     ┆ h69a702a_1         ┆ conda-forge ┆ 52.87 KiB  │
 │ │ │ libgomp          ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 450.19 KiB │
 │ │ │ liblzma          ┆ 5.6.3      ┆ hb9d3cd8_1         ┆ conda-forge ┆ 108.53 KiB │
 │ │ │ libnsl           ┆ 2.0.1      ┆ hd590300_0         ┆ conda-forge ┆ 32.62 KiB  │
 │ │ │ libsqlite        ┆ 3.48.0     ┆ hee588c1_1         ┆ conda-forge ┆ 857.64 KiB │
 │ │ │ libuuid          ┆ 2.38.1     ┆ h0b41bf4_0         ┆ conda-forge ┆ 32.81 KiB  │
 │ │ │ libxcrypt        ┆ 4.4.36     ┆ hd590300_1         ┆ conda-forge ┆ 98.04 KiB  │
 │ │ │ libzlib          ┆ 1.3.1      ┆ hb9d3cd8_2         ┆ conda-forge ┆ 59.53 KiB  │
 │ │ │ ncurses          ┆ 6.5        ┆ h2d0b736_2         ┆ conda-forge ┆ 873.49 KiB │
 │ │ │ openssl          ┆ 3.4.0      ┆ h7b32b05_1         ┆ conda-forge ┆ 2.80 MiB   │
 │ │ │ pip              ┆ 25.0       ┆ pyh8b19718_0       ┆ conda-forge ┆ 1.20 MiB   │
 │ │ │ python           ┆ 3.9.21     ┆ h9c0c6dc_1_cpython ┆ conda-forge ┆ 22.53 MiB  │
 │ │ │ readline         ┆ 8.2        ┆ h8228510_1         ┆ conda-forge ┆ 274.86 KiB │
 │ │ │ setuptools       ┆ 75.8.0     ┆ pyhff2d567_0       ┆ conda-forge ┆ 757.42 KiB │
 │ │ │ tk               ┆ 8.6.13     ┆ noxft_h4845f30_101 ┆ conda-forge ┆ 3.17 MiB   │
 │ │ │ tzdata           ┆ 2025a      ┆ h78e105d_0         ┆ conda-forge ┆ 120.04 KiB │
 │ │ │ wheel            ┆ 0.45.1     ┆ pyhd8ed1ab_1       ┆ conda-forge ┆ 61.46 KiB  │
 │ │ ╰──────────────────┴────────────┴────────────────────┴─────────────┴────────────╯

Hopefully (as in, i copy and pasted from resolved_dependencies.rs), this PR will at least get it to:

 │ │ ╭──────────────────┬────────────┬────────────────────┬─────────────┬────────────╮
 │ │ │ Package          ┆ Version    ┆ Build              ┆ Channel     ┆       Size │
 │ │ ╞══════════════════╪════════════╪════════════════════╪═════════════╪════════════╡
 │ │ │ _libgcc_mutex    ┆ 0.1        ┆ conda_forge        ┆ conda-forge ┆   2.50 KiB │
 │ │ │ _openmp_mutex    ┆ 4.5        ┆ 2_gnu              ┆ conda-forge ┆  23.07 KiB │
 │ │ │ bzip2            ┆ 1.0.8      ┆ h4bc722e_7         ┆ conda-forge ┆ 246.86 KiB │
 │ │ │ ca-certificates  ┆ 2024.12.14 ┆ hbcca054_0         ┆ conda-forge ┆ 153.41 KiB │
 │ │ │ ld_impl_linux-64 ┆ 2.43       ┆ h712a8e2_2         ┆ conda-forge ┆ 653.53 KiB │
 │ │ │ libffi           ┆ 3.4.2      ┆ h7f98852_5         ┆ conda-forge ┆  56.93 KiB │
 │ │ │ libgcc           ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 828.85 KiB │
 │ │ │ libgcc-ng        ┆ 14.2.0     ┆ h69a702a_1         ┆ conda-forge ┆  52.87 KiB │
 │ │ │ libgomp          ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 450.19 KiB │
 │ │ │ liblzma          ┆ 5.6.3      ┆ hb9d3cd8_1         ┆ conda-forge ┆ 108.53 KiB │
 │ │ │ libnsl           ┆ 2.0.1      ┆ hd590300_0         ┆ conda-forge ┆  32.62 KiB │
 │ │ │ libsqlite        ┆ 3.48.0     ┆ hee588c1_1         ┆ conda-forge ┆ 857.64 KiB │
 │ │ │ libuuid          ┆ 2.38.1     ┆ h0b41bf4_0         ┆ conda-forge ┆  32.81 KiB │
 │ │ │ libxcrypt        ┆ 4.4.36     ┆ hd590300_1         ┆ conda-forge ┆  98.04 KiB │
 │ │ │ libzlib          ┆ 1.3.1      ┆ hb9d3cd8_2         ┆ conda-forge ┆  59.53 KiB │
 │ │ │ ncurses          ┆ 6.5        ┆ h2d0b736_2         ┆ conda-forge ┆ 873.49 KiB │
 │ │ │ openssl          ┆ 3.4.0      ┆ h7b32b05_1         ┆ conda-forge ┆   2.80 MiB │
 │ │ │ pip              ┆ 25.0       ┆ pyh8b19718_0       ┆ conda-forge ┆   1.20 MiB │
 │ │ │ python           ┆ 3.9.21     ┆ h9c0c6dc_1_cpython ┆ conda-forge ┆  22.53 MiB │
 │ │ │ readline         ┆ 8.2        ┆ h8228510_1         ┆ conda-forge ┆ 274.86 KiB │
 │ │ │ setuptools       ┆ 75.8.0     ┆ pyhff2d567_0       ┆ conda-forge ┆ 757.42 KiB │
 │ │ │ tk               ┆ 8.6.13     ┆ noxft_h4845f30_101 ┆ conda-forge ┆   3.17 MiB │
 │ │ │ tzdata           ┆ 2025a      ┆ h78e105d_0         ┆ conda-forge ┆ 120.04 KiB │
 │ │ │ wheel            ┆ 0.45.1     ┆ pyhd8ed1ab_1       ┆ conda-forge ┆  61.46 KiB │
 │ │ ╰──────────────────┴────────────┴────────────────────┴─────────────┴────────────╯
Aside: As a quick scan, which of the above packages is the biggest? The smallest?

Yes, it's:

       python   22.53 MiB 
_libgcc_mutex    2.50 KiB

I (with relatively poor eyes) had difficulty doing it quickly, and actually
likely cheated and fell back on some prior knowledge.

It would be interesting to see if there are some non-tricky, portable ways
to better help identify outliers.

@bollwyvl bollwyvl marked this pull request as ready for review January 29, 2025 23:53
@wolfv wolfv merged commit 61cd086 into prefix-dev:main Jan 30, 2025
15 checks passed
@wolfv
Copy link
Copy Markdown
Member

wolfv commented Jan 30, 2025

Thanks @bollwyvl - if you want to one-up yourself, we could sprinkle some colors. Because indeed, KiB, MiB, GiB look very similar :)

@wolfv
Copy link
Copy Markdown
Member

wolfv commented Jan 30, 2025

Or we could make everything that is not KiB or below bold?

@bollwyvl bollwyvl deleted the patch-1 branch January 30, 2025 13:33
@bollwyvl
Copy link
Copy Markdown
Contributor Author

I find that bold/color often don't make it all the way out to logs.

What we do have is good old TTY spacing, maybe indenting the unit which would cost at most 3 columns (given k, m, and g):


 │ │ ╭──────────────────┬────────────┬────────────────────┬─────────────┬─────────────╮
 │ │ │ Package          ┆ Version    ┆ Build              ┆ Channel     ┆        Size │
 │ │ ╞══════════════════╪════════════╪════════════════════╪═════════════╪═════════════╡
 │ │ │ _libgcc_mutex    ┆ 0.1        ┆ conda_forge        ┆ conda-forge ┆   2.50  KiB │
 │ │ │ _openmp_mutex    ┆ 4.5        ┆ 2_gnu              ┆ conda-forge ┆  23.07  KiB │
 │ │ │ bzip2            ┆ 1.0.8      ┆ h4bc722e_7         ┆ conda-forge ┆ 246.86  KiB │
 │ │ │ ca-certificates  ┆ 2024.12.14 ┆ hbcca054_0         ┆ conda-forge ┆ 153.41  KiB │
 │ │ │ ld_impl_linux-64 ┆ 2.43       ┆ h712a8e2_2         ┆ conda-forge ┆ 653.53  KiB │
 │ │ │ libffi           ┆ 3.4.2      ┆ h7f98852_5         ┆ conda-forge ┆  56.93  KiB │
 │ │ │ libgcc           ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 828.85  KiB │
 │ │ │ libgcc-ng        ┆ 14.2.0     ┆ h69a702a_1         ┆ conda-forge ┆  52.87  KiB │
 │ │ │ libgomp          ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆ 450.19  KiB │
 │ │ │ liblzma          ┆ 5.6.3      ┆ hb9d3cd8_1         ┆ conda-forge ┆ 108.53  KiB │
 │ │ │ libnsl           ┆ 2.0.1      ┆ hd590300_0         ┆ conda-forge ┆  32.62  KiB │
 │ │ │ libsqlite        ┆ 3.48.0     ┆ hee588c1_1         ┆ conda-forge ┆ 857.64  KiB │
 │ │ │ libuuid          ┆ 2.38.1     ┆ h0b41bf4_0         ┆ conda-forge ┆  32.81  KiB │
 │ │ │ libxcrypt        ┆ 4.4.36     ┆ hd590300_1         ┆ conda-forge ┆  98.04  KiB │
 │ │ │ libzlib          ┆ 1.3.1      ┆ hb9d3cd8_2         ┆ conda-forge ┆  59.53  KiB │
 │ │ │ ncurses          ┆ 6.5        ┆ h2d0b736_2         ┆ conda-forge ┆ 873.49  KiB │
 │ │ │ openssl          ┆ 3.4.0      ┆ h7b32b05_1         ┆ conda-forge ┆   2.80 MiB  │
 │ │ │ pip              ┆ 25.0       ┆ pyh8b19718_0       ┆ conda-forge ┆   1.20 MiB  │
 │ │ │ python           ┆ 3.9.21     ┆ h9c0c6dc_1_cpython ┆ conda-forge ┆  22.53 MiB  │
 │ │ │ readline         ┆ 8.2        ┆ h8228510_1         ┆ conda-forge ┆ 274.86  KiB │
 │ │ │ setuptools       ┆ 75.8.0     ┆ pyhff2d567_0       ┆ conda-forge ┆ 757.42  KiB │
 │ │ │ tk               ┆ 8.6.13     ┆ noxft_h4845f30_101 ┆ conda-forge ┆   3.17 MiB  │
 │ │ │ tzdata           ┆ 2025a      ┆ h78e105d_0         ┆ conda-forge ┆ 120.04  KiB │
 │ │ │ wheel            ┆ 0.45.1     ┆ pyhd8ed1ab_1       ┆ conda-forge ┆  61.46  KiB │
 │ │ ╰──────────────────┴────────────┴────────────────────┴─────────────┴─────────────╯

This doesn't help the (western) scanning right-to-left for size, so XXX KiB still looks bigger, and isn't something I've seen done before.

At the cost of more whitespace, the decimals could be more accurate, with at most six extra columns:


 │ │ ╭──────────────────┬────────────┬────────────────────┬─────────────┬─────────────────╮
 │ │ │ Package          ┆ Version    ┆ Build              ┆ Channel     ┆            Size │
 │ │ ╞══════════════════╪════════════╪════════════════════╪═════════════╪═════════════════╡
 │ │ │ _libgcc_mutex    ┆ 0.1        ┆ conda_forge        ┆ conda-forge ┆       2.50  KiB │
 │ │ │ _openmp_mutex    ┆ 4.5        ┆ 2_gnu              ┆ conda-forge ┆      23.07  KiB │
 │ │ │ bzip2            ┆ 1.0.8      ┆ h4bc722e_7         ┆ conda-forge ┆     246.86  KiB │
 │ │ │ ca-certificates  ┆ 2024.12.14 ┆ hbcca054_0         ┆ conda-forge ┆     153.41  KiB │
 │ │ │ ld_impl_linux-64 ┆ 2.43       ┆ h712a8e2_2         ┆ conda-forge ┆     653.53  KiB │
 │ │ │ libffi           ┆ 3.4.2      ┆ h7f98852_5         ┆ conda-forge ┆      56.93  KiB │
 │ │ │ libgcc           ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆     828.85  KiB │
 │ │ │ libgcc-ng        ┆ 14.2.0     ┆ h69a702a_1         ┆ conda-forge ┆      52.87  KiB │
 │ │ │ libgomp          ┆ 14.2.0     ┆ h77fa898_1         ┆ conda-forge ┆     450.19  KiB │
 │ │ │ liblzma          ┆ 5.6.3      ┆ hb9d3cd8_1         ┆ conda-forge ┆     108.53  KiB │
 │ │ │ libnsl           ┆ 2.0.1      ┆ hd590300_0         ┆ conda-forge ┆      32.62  KiB │
 │ │ │ libsqlite        ┆ 3.48.0     ┆ hee588c1_1         ┆ conda-forge ┆     857.64  KiB │
 │ │ │ libuuid          ┆ 2.38.1     ┆ h0b41bf4_0         ┆ conda-forge ┆      32.81  KiB │
 │ │ │ libxcrypt        ┆ 4.4.36     ┆ hd590300_1         ┆ conda-forge ┆      98.04  KiB │
 │ │ │ libzlib          ┆ 1.3.1      ┆ hb9d3cd8_2         ┆ conda-forge ┆      59.53  KiB │
 │ │ │ ncurses          ┆ 6.5        ┆ h2d0b736_2         ┆ conda-forge ┆     873.49  KiB │
 │ │ │ openssl          ┆ 3.4.0      ┆ h7b32b05_1         ┆ conda-forge ┆   2.80      MiB │
 │ │ │ pip              ┆ 25.0       ┆ pyh8b19718_0       ┆ conda-forge ┆   1.20      MiB │
 │ │ │ python           ┆ 3.9.21     ┆ h9c0c6dc_1_cpython ┆ conda-forge ┆  22.53      MiB │
 │ │ │ readline         ┆ 8.2        ┆ h8228510_1         ┆ conda-forge ┆     274.86  KiB │
 │ │ │ setuptools       ┆ 75.8.0     ┆ pyhff2d567_0       ┆ conda-forge ┆     757.42  KiB │
 │ │ │ tk               ┆ 8.6.13     ┆ noxft_h4845f30_101 ┆ conda-forge ┆   3.17      MiB │
 │ │ │ tzdata           ┆ 2025a      ┆ h78e105d_0         ┆ conda-forge ┆     120.04  KiB │
 │ │ │ wheel            ┆ 0.45.1     ┆ pyhd8ed1ab_1       ┆ conda-forge ┆      61.46  KiB │
 │ │ ╰──────────────────┴────────────┴────────────────────┴─────────────┴─────────────────╯

@wolfv
Copy link
Copy Markdown
Member

wolfv commented Jan 30, 2025

Hmm, I don't think I like that :D

We could do bold / non-bold in interactive / graphical terminal case and some other solution when not. Or find some other clever solution.

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