gitlab

Relocations in generic ELF (EM: 40)

Bradley Noyes published on
2 min, 292 words

Today I added caching to my gitlab CI since i keep on running low on minutes. This was annoyly challening for a few reasons.

  • Gitlab only caches data in the build directory, so if you want to cache $HOME/.cargo you can't. So you must redefine $CARGO_HOME.
  • There's a bug in cargo where it uses the wrong linker that seemd to pop-up when redefining $CARGO_HOME and cross compiling.

The error I was recieving was the following for each compiled object.

Relocations in generic ELF (EM: 40)
Relocations in generic ELF (EM: 40)
Relocations in generic ELF (EM: 40)
Relocations in generic ELF (EM: 40)
Relocations in generic ELF (EM: 40)
...
error adding symbols: File in wrong format
Read More

Rust + Diesel + GitLab + CI

Auto builds with Diesel using GitLab’s CI

Bradley Noyes published on
5 min, 905 words

Rust + Diesel + GitLab + CI🔗

The folks over at GitLab give away some free compute power to allow users to have CI builds of their project. It is very straightforward to get Rust projects to build within a CI environment. This post is going to take that build process one small step further, we’re going to build a Rust project that uses the Diesel ORM. This adds a step of complexity since to compile a Diesel project you need to have a postgresql database accessible if you’re using the infer_schema!() macro.

Note: diesel has instructions for using diesel print-schema instead of using infer_schema!() in version 1.3.x. It has been proposed to move away from infer_schema!(), but that issues was closed because infer_schema!() is still useful. A redditor commented that infer_schema!() has been deprecated in diesel 1.3.

Read More