B
BlueBuild•5mo ago
benoit_lx

What is the best way to install programs from source ?

I wanted to try the Ly login manager https://github.com/fairyglade/ly, but I'm not sure how I can install this since it's not like an rpm or a flatpak. Could it be a solution to make a script that will run at build-time and do the following : - install required dependencies for compilation (zig, libc ...) - clone the repository - compile the programs - copy binaries and systemd file to the right folder
Solution:
You are looking for Stages
BlueBuild
Stages
A stage is a separate image build flow executed in parallel with the main build.
Jump to solution
59 Replies
Solution
xyny
xyny•5mo ago
You are looking for Stages
BlueBuild
Stages
A stage is a separate image build flow executed in parallel with the main build.
benoit_lx
benoit_lxOP•5mo ago
oh, sorry, I missed this page ^^ I will take a look at it
xyny
xyny•5mo ago
Also, reading Ly's README;
Warning: You may encounter issues with SELinux on Fedora. It is recommended to add a rule for Ly as it currently does not ship one.
you may need to write a rule for SELinux
benoit_lx
benoit_lxOP•5mo ago
yes I will deal with that later but thanks It looks amazing 😇
Luke Skywunker
Luke Skywunker•5mo ago
Make sure to use the unstable_cli option for the github action
benoit_lx
benoit_lxOP•5mo ago
Does the src and dest option from the copy module support syntax like /etc/ly/*.sh ?
fiftydinar
fiftydinar•5mo ago
no
Luke Skywunker
Luke Skywunker•5mo ago
Umm it supports whatever the COPY instruction supports And I think it supports wildcard
benoit_lx
benoit_lxOP•5mo ago
how to do so in local with the bluebuild cli ? (I don't understand the or using the stages feature when compiling in the doc)
Luke Skywunker
Luke Skywunker•5mo ago
Right So locally, you will need to install it from source. Do you have cargo installed?
Luke Skywunker
Luke Skywunker•5mo ago
You can install it with rustup https://rustup.rs/
rustup.rs - The Rust toolchain installer
The Rust toolchain installer
benoit_lx
benoit_lxOP•5mo ago
no
Luke Skywunker
Luke Skywunker•5mo ago
Then you can run cargo install --all-features blue-build
benoit_lx
benoit_lxOP•5mo ago
there was no error just using bluebuild build (I think it could have thrown a warning or an erro) I can do this in a distrobox ?
Luke Skywunker
Luke Skywunker•5mo ago
Sure? You would still need docker to run the build Our images aren't distrobox ready. I have an issue out for it
benoit_lx
benoit_lxOP•5mo ago
(I will have to learn rust one day)
Luke Skywunker
Luke Skywunker•5mo ago
You shouldn't have to know any rust to get it installed. Rustup will install all the tooling in your home dir so it's all userspace But it's up to you
benoit_lx
benoit_lxOP•5mo ago
yes I know but I wanna try ^^
Luke Skywunker
Luke Skywunker•5mo ago
Rustlings is a great interactive course. @xyny 's been using it recently
benoit_lx
benoit_lxOP•5mo ago
Once I installed it, with wich command should I build my image ? (I don't see any stages option in the build command)
fiftydinar
fiftydinar•5mo ago
ohh, I misread copy module with files one my bad
xyny
xyny•5mo ago
the same build command builds the stages first
benoit_lx
benoit_lxOP•5mo ago
ok
xyny
xyny•5mo ago
yeah, it's great if you alrd know the basics of programming and other compsci concepts
benoit_lx
benoit_lxOP•5mo ago
How am I supposed to start the docker daemon within distrobox ?
Luke Skywunker
Luke Skywunker•5mo ago
I have no clue. I have docker layered in my image
benoit_lx
benoit_lxOP•5mo ago
I should have looked for such image
Luke Skywunker
Luke Skywunker•5mo ago
If you installed rustup, that should be available outside distrobox It installs into your home directory Though you might not have the dev tools local... Hmmm
benoit_lx
benoit_lxOP•5mo ago
indeed cargo is available in my base system
Luke Skywunker
Luke Skywunker•5mo ago
Well if you did a cargo install, then that should be available to you outside distrobox. It will be in ~/.cargo/bin/ So try bluebuild build from your native host. If you have podman it will use that if you don't have docker installed Docker just works better
benoit_lx
benoit_lxOP•5mo ago
Nice it's running the stage part !
Luke Skywunker
Luke Skywunker•5mo ago
Sweet!
benoit_lx
benoit_lxOP•5mo ago
The stage tool is really overpowered !
Luke Skywunker
Luke Skywunker•5mo ago
Oh yeah I use it to build the latest Helix editor build All you need to do is make sure you copy all the files you need into the right spot in your final image
benoit_lx
benoit_lxOP•5mo ago
hence the documentation
Luke Skywunker
Luke Skywunker•5mo ago
Yes lol
benoit_lx
benoit_lxOP•5mo ago
info: installed /usr/bin/ly
info: installed /etc/ly/config.ini
info: installed /etc/ly/xsetup.sh
info: installed /etc/ly/wsetup.sh
info: installed /etc/ly/lang/cat.ini
info: installed /etc/ly/lang/cs.ini
...
info: installed /etc/ly/lang/uk.ini
info: installed /etc/pam.d/ly
info: installed /usr/lib/systemd/system/ly.service
info: installed /usr/bin/ly
info: installed /etc/ly/config.ini
info: installed /etc/ly/xsetup.sh
info: installed /etc/ly/wsetup.sh
info: installed /etc/ly/lang/cat.ini
info: installed /etc/ly/lang/cs.ini
...
info: installed /etc/ly/lang/uk.ini
info: installed /etc/pam.d/ly
info: installed /usr/lib/systemd/system/ly.service
Normally my recipe will avoid to copy /etc/ly/config.ini and copy it with my own config in files
Luke Skywunker
Luke Skywunker•5mo ago
So if this is output from something like make install, then those files only exist in that stage
benoit_lx
benoit_lxOP•5mo ago
The build was succesful !
Luke Skywunker
Luke Skywunker•5mo ago
Awesome!
benoit_lx
benoit_lxOP•5mo ago
I will try to rebase
Luke Skywunker
Luke Skywunker•5mo ago
Use bluebuild switch if you want to boot a local build It combines reboot/upgrade into one command and will determine how to call rpm-ostree based on the status
benoit_lx
benoit_lxOP•5mo ago
I ran it without sudo but the command seems to run 🤔
Luke Skywunker
Luke Skywunker•5mo ago
Yeah, it will run certain commands with sudo so you don't have to call the main binary with sudo It'll ask for your password when it get's to the part where it moves the tarball to the correct directory
benoit_lx
benoit_lxOP•5mo ago
nice !
Luke Skywunker
Luke Skywunker•5mo ago
I did this so that we're in userspace as much as possible It's also good for podman/buildah since the container storage is separate as root. Less stuff to know to clean up
benoit_lx
benoit_lxOP•5mo ago
ok I was wondering if it was possible to have a copy of the filesystem in another partition with write permission in order to quickly be able to make change in config in /etc ?
Luke Skywunker
Luke Skywunker•5mo ago
¯\_(ツ)_/¯
benoit_lx
benoit_lxOP•5mo ago
Anyways, almost time to reboot !
Luke Skywunker
Luke Skywunker•5mo ago
Oh yeah there's a --reboot flag you can use to automatically do that for you Don't stop your build though 😛
benoit_lx
benoit_lxOP•5mo ago
it takes time to commit ... oh some error ! write /tmp/oci-archive.ZQgHw9vwTjdY/custom-hyprland-nvidia.tar.gz: no space left on device what I have 900Go left ... is there a way to set maximize_build_space: true in local ?
Luke Skywunker
Luke Skywunker•5mo ago
That's weird You're not in a distrobox are you?
benoit_lx
benoit_lxOP•5mo ago
no
Luke Skywunker
Luke Skywunker•5mo ago
I've not run into that issue before
benoit_lx
benoit_lxOP•5mo ago
The command I ran was ~/.cargo/bin/bluebuild switch
Luke Skywunker
Luke Skywunker•5mo ago
Yeah that's the one
benoit_lx
benoit_lxOP•5mo ago
I'm trying with the github action
Luke Skywunker
Luke Skywunker•5mo ago
Ok
benoit_lx
benoit_lxOP•5mo ago
should the image tag be different when building from a different branch ? it's ok I found it with skopeo list-tags forgot the ly binary in /usr/bin 😭 Nice it's working (not the authentication but I think it's because of SELinux)
Want results from more Discord servers?
Add your server