NixOS Feel for any OS

That applies to computer languages too. It is one of the benefits of diversity in free software.

I once had a lady working with me who came to Australia as a refugee at age 12 and speaking Russian and Chinese. She had to ‘learn’ English.
What you say is true, she thought about things in entirely different ways, so much so that communication about technical matters could be difficult.

The reference looks helpful, thanks

1 Like

@Akito
Install problems with rust have been overcome -
I can either use

  • package install in Void of rustc and cargo. This gives version 1.61
  • rustup install in Void. This gives version 1.62
  • In Devuan the package install is too old, and the rustup install gives 1.62 as for Void.

Both 1.61 and 1.62 have the same errors trying to compile goldboot. The errors are dependencies missing from the Cargo.toml file.
In one case I was able to work out that the missing dependency was ‘serde_json’… I added it and that error disappeared.

But there a re dozens of missing dependencies?
They look like this

Script started on 2022-07-14 21:27:36+10:00 [TERM="xterm-256color" TTY="/dev/pts/9" COLUMNS="78" LINES="26"]
[nevj@trinity Goldboot]$ cargo build
^M   Compiling goldboot v0.0.1 (/common/Goldboot/goldboot)
    Building [=======================> ] 389/393: goldboot                  ^Merror[E0433]: failed to resolve: use of undeclared type `TemplateMetadata`
   --> goldboot/src/cmd/init.rs:110:45
    |
110 |                     let templates: Vec = TemplateMetadata::load()
    |                                                            ^^^^^^^^^^^^^^^^ use of undeclared type `TemplateMetadata`

    Building [=======================> ] 389/393: goldboot                  ^Merror[E0433]: failed to resolve: use of undeclared type `TemplateBase`
  --> goldboot/src/templates/linux/arch.rs:91:11
   |
91 |                 base: TemplateBase::ArchLinux,
   |                       ^^^^^^^^^^^^ use of undeclared type `TemplateBase`

It does not make sense. The developer is not going to have all these things missing. They would never get a compile.
There must be something in the developers environment that I do not have?
I wonder is he using an IDE that is looking after some of the dependencies?
I think I am going to have to ask

I’m not a Rust expert, so I’m not qualified to give a very Rust specific answer, however I can respond to the matter based on my experiences with a variety of languages I have used in my life.

According to my experience, all these errors do not indicate any fault on the author’s side. It’s a matter of missing dependencies and wrong Rust compiler version.

First, we must know which compiler version is the one working with the current state of the code.
Secondly, we need to install all dependency packages, to make the compilation work.

https://doc.rust-lang.org/cargo/guide/dependencies.html

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html

https://doc.rust-lang.org/cargo/reference/resolver.html

Another thing I would’ve done in the first place, if I were in your shoes, is using Docker.

Using Docker guarantees a clean, uninfected & reproducible environment. If you just make a Docker image with all the necessary dependencies & the absolutely correct Rust compiler version, you don’t have to endure the pain you described in previous posts.

Now, I’m pretty sure Docker won’t run on Void to begin with, as it lacks systemd. Not sure, if Docker has a method of running without systemd. I doubt that.

That said, if you have a working Docker image, you don’t even have to send any instructions, if you want other people to experience the same. Just send a link to the image or send the link to the Dockerfile source on Github and that’s it. No messing around needed!

1 Like

Thank you.
There are a couple of leads there for me.
I need to understand how to work out what goldboot’s dependencies are interms of cargo crates. I would have thought the Cargo.toml file from the goldboot repository would contain all the dependencies, but it clearly does not.

Thank you

Docker would be a whole new world for me. It would take time, but I can see your argument. A clean environment is essential.
Void seems to have docker

I am very experienced with Docker. If you provide me the essential steps to make it work, I can turn it into a Docker environment and fix lose ends, if necessary.

We would need to read up on how Cargo exactly works. However, we shall not forget that the compiler version is very important. If we are super lucky, all this might be solved just by using the precisely correct compiler version, which is used by the author.

1 Like

Rustup has 3 release channels called stable, beta, and nightly.

I am using stable

[nevj@trinity ~]$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/nevj/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.62.0 (a8314ef7d 2022-06-27)
[nevj@trinity ~]$ 

The goldboot Github repo is using nightly

- name: Install rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          override: true

The above comes from

They are using some Github facility called Actions where they set a workflow that Github will perform automatically every night.

If you look at the above , they just do cargo build , after updating rust. That is the same as I am doing by hand. So the mystery of missing dependencies remains… unless I need to use ‘nightly’ rust updates. I will try that.

I did manage to work out the dependency libraries correctly ( in Void they are libgudev-devel and gtk4-devel . I missed jq so I added that but it makes no difference. It is the internal rust/cargo dependencies that are giving trouble.

Cheers
Neville

https://github.com/goldboot/goldboot/runs/7383149835?check_suite_focus=true

Seems like the configuration on Github is faulty, resulting in compilation errors, too.

I guess, the author has everything running fine locally and didn’t bother to update the Github Action configuration to make it work there, too. That definitely needs to be fixed.

Looking further into this, I see that serde_json is supposed to be missing during compilation. However, the generated Cargo.lock file has it listed as an explicit dependency.

[[package]]
name = "serde_json"
version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
dependencies = [
 "itoa",
 "ryu",
 "serde",
]

I tried adding serde_json to Cargo.toml. That removes some of the compile errors, but there are others

I changed to nightly toolchain. Then I get version 1.64.0. It makes no difference, I get the same compile errors


That is with serde_json added to Cargo.toml

without it added I get other errors first

It seems your diagnosis is right — their Github is not setup properly. It is not just serde_json, there are other things missing.
Do we tell them or just wait?

The problem with Nightly is, that it’s always up to date. So, if Nightly worked 2 months ago, it doesn’t have to still work, at this moment.

I would open a Github issue. If you want to do it, you can do it or if you want me to do it, I can do it too. Your pick.

I think you should do it. You seem to understand these Github Action things better than I do , so you might get the terminology right.
I dont want to add to the confusion.
Thanks
Neville

1 Like

@Akito
Thank you,
I might see if I can set up docker while we wait

After all, the author said, he is in the process of applying major changes to the code base and plans to fix everything in the next few weeks.

1 Like

@Akito ,
How could he not have it running locally?
Is it possible to develop code entirely on Github without having a local copy?
I always do it locally and push stuff to Github.

I mean running, as in, having it compile locally.
He makes a lot of changes and let’s them stay in Work In Progress, I assume.
If it compiles locally for him, that means he didn’t push all the necessary changes to make us able to compile it, as the code on Github is lacking those parts of the code.
If it does not compile locally for him, it means he is sitting on one module, making heavy breaking changes and didn’t get to fixing the other module, where the changes broke something already.

I’ve personally been through all those scenarios.

You can edit all code in the Web UI, yes. However, I doubt anyone does it like that, because it’d be a chore and it’s just way easier and more convenient to download it and have it run in an IDE or code editor.

The Web UI editing feature is usually used for small and quick edits. Or if the repository is huge and you don’t want to download GBs of repository content, just to edit one line in a file.

At least, that’s how I edit files in Github.


I actually played around with code compilation of this project myself, yesterday. I noticed, there are definitely things missing. Even if I add the serde_json dependency correctly, other things still won’t compile, because there are missing things in other places. For example, there is a structure missing certain fields. This is a clear indication of the author letting things stay Work In Progress, which makes the project not compile, if you only get the Github code. We would need the code that is not yet pushed to Github by the author.
Though, even then it’s not guaranteed it works for us.

Either way, there is no immediate solution to this. We need to wait. He is currently, as he said, in a pre-implementation stage and still questions the ideas portrayed in this project.

1 Like

Well given that, the only use I can see for Github Actions is to check that you uploaded everything properly. Is that what it is for?

Not, it’s a continuous integration tool.

It’s there, to ensure the code is reproducibly working and not only locally for the developer. This ensures integrity, reproducibility, better programming quality and less bugs on average.

For example, it automatically runs custom tests for the particular program. If the tests don’t pass, the developer has to adjust the code, until all tests pass.

OK, so its like a git merge, only across developers working from multiple locations.
Thankfully I have no need for it.

I’d say, it’s more like a replacement for developers wasting their time to manually test and check codes for buildability, etc.

With CI you can have automatic tests running “for free”, as in, you don’t waste developer’s time to do it manually and you don’t risk manual errors, because everything is tested reproducibly and automatically.

If you have all those one-off playbooks for data science, I think it’s not needed there. However, if you produce a product, that is continuously worked on, it’s even worth it for a one man project, if it’s an important or popular one.