23
submitted 1 year ago by sapphire_stella to c/transprogrammer

Um. Hi. I have... a lot of questions these days as a washed out programmer who burnt out in college.

1. How does Linux do Arch

First, I got myself an Arch Linux install cause being able to build the operating system with the pieces I need sounds very cool, but ngl... the Arch community scares me. So if I may...

  • Do y'all know where I could find help for this?
  • If I uninstall a desktop environment, do I get my settings back if I reinstall it?
  • Is there a safe ish way to repartition if I set root and home to different partitions?

2. Very rusty

I've been trying my hand at Rust recently. But I am not sure of what can it actually do.

  1. Can Rust make .exe programs?
  2. Does it get crazy over time?
  3. How does one use git with Cargo?

3. Windows

So I have a main build that runs Windows, but I have been thinking of switching to a Linux DIstro. One SSD for OS, one HDD for data, 16GB RAM, AMD stuff. Anything I should know?

Yes I know this is dumb but I dont know where else to ask... Any help is appreciated

you are viewing a single comment's thread
view the rest of the comments
[-] AVincentInSpace@pawb.social 2 points 8 months ago* (last edited 8 months ago)

It just so happens I can answer all these questions!

  1. How does Linux do Arch
  • Do y’all know where I could find help for this? As cliche as it sounds to say, Archwiki is your best friend here. I've been running Arch exclusively for ~4 years now and there's rarely been a problem I've encountered with needing to get something specific set up that I haven't been able to just Google. "Rarely", however, does not mean "never", and the Arch Linux forums (bbs.archlinux.org) as well as people you can reach out to who are already familiar with Arch specifically (hi!!!!) are invaluable resources here. DMs open if you have specific questions.

  • If I uninstall a desktop environment, do I get my settings back if I reinstall it? Yes! Settings for your desktop environment (or any other program, for that matter) are stored as dotfiles in your home directory. (If you weren't already aware, this is just a fancy name for files whose names start with a dot, which on nix is how you mark a file as "hidden". Programs that are competent will follow the XDG specification and put their configuration in a program-specific subdirectory of ~/.config, and programs that are not coughcargocough* will put them as folders or (shudder) collections of files directly in your home directory.) Pacman does not know or care about these files, so if you uninstall and reinstall a program that uses them, you should keep your configuration (unless the program itself does something stupid and wipes its configuration on first startup, although I've never seen a program do this). That said, if there's one thing that using Linux for nearly half my life has taught me, it's that just because something theoretically should work doesn't mean it will. I'm also not sure why you'd want to uninstall and reinstall a DE, other than to save disk space -- any halfway decent display manager (this is the program that presents the login screen, not to be confused with a window manager or desktop environment, which is what you get after you log in) will give you a drop down menu of installed desktop environments to pick from each time you log in.

  • Is there a safe ish way to repartition if I set root and home to different partitions? I am not entirely sure what this question means, but I'll try to answer it anyway. First, let's get the important stuff out of the way -- NEVER try to resize or (worse) move the partition you're currently booted from. That is a one way ticket to disk corruption, and most partition managers will flatly refuse to let you do it. Resizing Linux partitions from Windows is also not a great idea, since Windows doesn't understand the filesystem and can't do it safely. If you want to repartition your system, ALWAYS do it from a Linux boot image separate from your main system. Usually this is the bootable flash drive you used to install Linux in the first place, although creating a separate, minimal Linux install on, say, a 16GB partition specifically for system recovery is never a bad idea. To this end, it is possible to install and use a desktop environment while booted from Archiso. Here's how to do it:

# increase the size of the in-RAM filesystem to make room for the software we're about to install
mount -o remount,size=50% /run/archiso/cowspace
# install the desktop environment and assorted other utilities (konsole for terminal emulator, gparted for, well, gparted)
pacman -Sy plasma plasma-wayland-session konsole gparted
# launch Plasma
startplasma-wayland

From there you can launch Gparted and screw around to your heart's content.

As for "safe-ish way to repartition" I'm not sure what you mean. Repartitioning is usually pretty safe if done from within a program that holds your hand, like Gparted, although having backups is never a bad idea. If you're talking about having root and home as separate partitions to start with, and being able to decide down the line to redo it as a single partition, that's certainly possible, but not without copying your entire home directory off onto an external hard drive and back again. Depending on why you want your home and root partitions to be separate, specifically if it's to make backups easier, you may be able to achieve something similar that wouldn't have that requirement using Btrfs subvolumes. If your root partition is formatted Btrfs, you can set up your home directory to be a subvolume. You'll then be able to take snapshots of your root partition, not unlike Windows's System Restore, to go back to if anything goes catastrophically awry, while keeping your personal files intact. I can provide detailed instructions on how to do this if you'd like.

  1. Very Rusty
  • Can Rust make .exe programs? Yes! This is the default option if you run Cargo on Windows, and you can make Windows .exe's from Linux too if you'd care to set up cross compilation. There are a number of different methods you can find for doing that if you just Google "rust linux to windows cross compilation". Here's my preferred one:
# install the Windows toolchain (stdlib etc. for Windows targets)
rustup target add x86_64-pc-windows-gnu
# install a Windows C compiler, in case we find ourselves depending on a Rust crate that needs to compile C code
sudo pacman -S mingw-w64-gcc
# compile your project for windows
cargo build --release --target x86_64-pc-windows-gnu

Note that I had to find the second command out for myself. Usually you can get away with just the first and third one, but sometimes you'll need to depend on a Rust crate that is partly written in C, and Cargo will need to be able to find a C compiler in order to compile them. It failed to build, complaining that it couldn't find the Windows C compiler:

  CMake Error at CMakeLists.txt:35 (project):
    The CMAKE_C_COMPILER:

      x86_64-w64-mingw32-gcc

    is not a full path and was not found in the PATH.

I asked Pacman which package that binary was found in (pacman -F x86_64-w64-mingw32-gcc) and it told me the name of that package, which I then installed. pacman -F (find packages containing the given file) is an invaluable resource that every Arch user should know about!

  • Does it get crazy over time?

Rust is famous for being difficult for existing programmers to pick up, due to new syntax constructs like named lifetimes that (to my knowledge) have no equivalent in any other language, and the unique way the borrow checker forces you to think about program flow, and, to a certain extent, about programming as a concept. It definitely took me a while to pick it up, but once I did, I was in heaven. There are a lot of rules to memorize about how things have to be laid out, but they're all clearly spelled out, they never change, and the Rust compiler holds your hand a lot as you learn them. For someone like me, at least, that's ideal. I love it when I can predict exactly how the compiler will behave and why with any given piece of code.

Rust's borrow checker may seem stifling at first, but as you learn more and more Rust and start to use RefCell<T> and Rc<T> less and less, you start to learn how to have the borrow checker work with you instead of against you, and I swear it gives you wings.

  1. Windows

If your GPU is AMD as well, there's nothing you need to worry about. Nvidia compatibility on Linux can be a bit dodgy, but it does work for the most part. Dual booting Windows and Linux from the same boot drive works fairly well, but unless your boot disk is exceedingly roomy (on the order of multiple terabytes), if you're anything like me, you'll fill up one partition or the other pretty quickly. I like to have physically separate drives for my Windows and Linux installs, but that's personal preference -- it works just as well either way. As for sharing your data drive, that will just about happen automatically.

this post was submitted on 06 Oct 2023
23 points (100.0% liked)

Transprogrammer

830 readers
1 users here now

A space for trans people who code

Matrix Space:

Rules:

founded 1 year ago
MODERATORS
Xea