Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Package count fails on NetBSD #182

Closed
0323pin opened this issue Nov 1, 2021 · 28 comments
Closed

[BUG] Package count fails on NetBSD #182

0323pin opened this issue Nov 1, 2021 · 28 comments

Comments

@0323pin
Copy link

0323pin commented Nov 1, 2021

/home/pin()
2021-11-01 09:48 > macchina -v
macchina    5.0.0
libmacchina 3.3.1
/home/pin()
2021-11-01 09:49 > macchina
                                                                
  Host         pin@mybox                                        
  Machine      Hewlett-Packard HP EliteBook 820 G1 A3009DD10303
  OS           NetBSD 9.99.92                                   
  WM           Franken                                          
  Terminal     xterm                                            
  Shell        nu                                               
  Uptime       1h 19m                                           
  CPU          Intel® Core™ i5-4210U CPU @ 1.70GHz (4)          
  Memory       1.5 GB/7.5 GB                                    
  Battery      98% & Charging                                   

/home/pin()
2021-11-01 09:49 > macchina -d
Let's check your system for errors... Here's a summary:

We've collected 11 readouts, including 1 failed read(s) and 0 read(s) which resulted in a warning.
Readout "Packages" failed with message: No packages found — Do you have a package manager installed?
/home/pin()
2021-11-01 09:49 > 

Although, ls /usr/pkg/pkgdb | wc -l reports the correct number of installed packages.
I'm still working on properly installing the themes so they get detected.

You can find my configuration and theme files here, https://codeberg.org/pin/franken-nbsd/src/branch/main/home/.config/macchina

@0323pin 0323pin added the bug label Nov 1, 2021
@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

That shouldn't be happening, I'll see what I can do to fix it.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Thanks but, I'm not sure why it's happening.
I see in the code that it should look for LOCALBASE in /etc/mk.conf. I don't have this variable defined, it defaults to /usr/pkg but, even if I add that it still fails. Also, if a user is only using pre-compiled binaries a /etc/mk.conf doesn't need to exist.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

The first directory whose entries we try to count is actually the one set by PKG_DBDIR, if that fails, we count the entries inLOCALBASE/pkgdb.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

I'm releasing a minor bug fix release that addresses the weird bar issue that is presented when no custom themes are in use, after that, I'll have a deeper look at this.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Hmm... that one is defined here,

/home/pin()
2021-11-01 15:00 > cat /etc/mk.conf | textview
       READER
   1   # mk.conf
   2   
   3   NETBSD_LOGIN_NAME=pin
   4   ALLOW_VULNERABLE_PACKAGES=1
   5   MAKE_JOBS=4
   6   PKG_DEVELOPER=yes
   7   RUST_TYPE=src
   8   PKG_DBDIR=/usr/pkg/pkgdb

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

I'm releasing a minor bug fix release that addresses the weird bar issue that is presented when no custom themes are in use, after that, I'll have a deeper look at this.

Why not wait? I haven't merged 5.0.0 yet.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

The bug could deter some people as it shows up simply by running macchina, something I missed because I use a custom theme.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Yeah, I understand that. Usually, I move the macchina directory somewhere else to test defaults and then move it back.
I think I wait for 5.0.2, then as I haven't merged 5.0.0 yet.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

I can't build macchina :(

I'm getting a linker cc not found error.

  • I've got two versions of gcc (10 and 9) installed, as well as clang and cmake.
  • Running cc in the terminal results in a command not found error.

Is this a PATH issue on my part?

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

How are you trying to build it?

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

with plain ol' cargo build.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Ahh... you need to tell cargo where to find somethings.
Here's NetBSD cargo.mk, http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/rust/cargo.mk?rev=1.29&content-type=text/x-cvsweb-markup

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Do you want a tarball of 5.0.0 to build inside pkgsrc?

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Btw, some packages have started to fail on default set-ups, NetBSD has rust-1.54

I'm running rust-1.56 built from source.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

I'm pretty sure compiling Rust in a VM with 4 threads of a not so powerful processor would take a millenium.

Here's NetBSD cargo.mk

I'm more confused than I previously was, lol.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

I mainly want to play around with the package count method to see what I can do to fix it, so a fixed tarball isn't going to help much :(

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

Ok, one thing at the time,
-What NetBSD version did you install?
-Full installation?
-gcc is included in base but rust needs the standard c toolchain to link.
-Why would you build rust? You can simply install 1.54 as a pre-compiled binary.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

What NetBSD version did you install?

I installed one of the daily images.

Full installation?

No, minimal.

Why would you build rust? You can simply install 1.54 as a pre-compiled binary.

rustc -V reports rustc 1.54.0

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

No, minimal

Do you have gcc installed?

gcc -v?

I don't know if you need rust > 1.54.0 to build macchina

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

Nope, gcc doesn't appear to be in my PATH...

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

A full base install is not too large and it would give you the needed tools. I'm building 5.0.1 patched to use the latest libmacchina right now.

If you have any patches you'd like me to try to fix the package count issue, I can build and test them.

@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

I still haven't tried anything, I was hoping to play with mk.conf's variables and isolate parts of the code to see what was the true culprit. I guess I'm all out of options, I'll reinstall.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

I've never done this in a VM but, on bare metal you can just boot a more recent image and choose to upgrade an already installed system. You can than pick the full install option and it will install the things you are missing.

Btw, as you might have seen, the latest libmacchina solved the issue with the brightness readout.

@0323pin
Copy link
Author

0323pin commented Nov 1, 2021

:o building macchina v5.0.1 with libmacchina v3.4.2 solved this as well. All good now.

Please could you release 5.0.2?

@0323pin 0323pin closed this as completed Nov 1, 2021
@grtcdr
Copy link
Member

grtcdr commented Nov 1, 2021

Will do! I'm just fixing #188

(so excited to see all these bugs getting squashed)

@0323pin
Copy link
Author

0323pin commented Nov 2, 2021

@grtcdr Hi again!

There's always a but, isn't it?
First of all, I've merged 5.0.2 into the main branch earlier today.

macchina is working fine but, the package count is incorrect by one package, I have 185 packages installed and macchina reports 186.

The answer for this is obvious, though. Inside /usr/pkg/pkgdb there're all the installed packages + pkgdb.byfile.db, i.e. the package database itself.
This will always be the case, so a solution would be to always subtract one from the count before displaying the readout.

Not a rush to get this fixed, just wanted to let you know.

Best,
pin

@grtcdr
Copy link
Member

grtcdr commented Nov 2, 2021

Oops, thanks for letting me know.

I'll have this fixed no later than tonight.

@0323pin
Copy link
Author

0323pin commented Nov 2, 2021

Oops, thanks for letting me know.
I'll have this fixed no later than tonight.

As said, no rush. And no need for another quick release either. Take your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants