c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Fix docker build issue in ubuntu kinetic

Open MashyBasker opened this issue 1 year ago • 19 comments

The official ubuntu image in DockerHub does not contain 22.10 aka Kinetic. This merge request changes the UBUNTU_VERSION to 22.04 aka Jammy.

Changelog:

  • Update UBUNTU_VERSION to 22.04 to build on Jammy
  • Update LLVM_VERSION from 15 to 17 due to this line in CmakeLists.txt
  • Add an UBUNTU_CODENAME variable which is used to pull LLVM for a specific Ubuntu version

MashyBasker avatar Jul 30 '24 07:07 MashyBasker

Thank you. Can we get this into the CI somehow?

I don't use this myself, so I can't judge if we're missing something essential with the removal of 22.10. @Its-Kenta did the previous updates, and so might have a better opinion on how it should work.

lerno avatar Jul 30 '24 11:07 lerno

Would you like me to add a job to build the project in Ubuntu 22.04? I can start working on an MR right away or wait for more reviews, whichever you prefer.

MashyBasker avatar Jul 30 '24 12:07 MashyBasker

Getting a CI for it would be awesome.

lerno avatar Jul 30 '24 15:07 lerno

Something broke in the new ci:

You have an error in your yaml syntax on line 503

lerno avatar Jul 31 '24 12:07 lerno

Yeah, it was indentation problem. Sorry, about that

MashyBasker avatar Jul 31 '24 13:07 MashyBasker

On second thought, the CI for Ubuntu 22 already exists in the job build-linux. Wouldn't my addition be redundant?

MashyBasker avatar Jul 31 '24 13:07 MashyBasker

I wanted the CI to run the docker script. That's what I meant.

lerno avatar Jul 31 '24 16:07 lerno

There seems to be errors in the CI still.

lerno avatar Aug 01 '24 12:08 lerno

What is needed to make this work?

lerno avatar Aug 08 '24 13:08 lerno

It seems we need to add a command to the script to create the build directory where CMakeOutput.log is supposed to be written. The other errors also appear to be caused by the absence of this build directory.

MashyBasker avatar Aug 08 '24 15:08 MashyBasker

So just a mkdir? Do you know the path?

lerno avatar Aug 08 '24 17:08 lerno

This is the path expected by Cmake for the CmakeOutput.log: /home/c3c/source/build/CMakeFiles/CMakeOutput.log

However, the build-with-docker.sh script already has the command mkdir -p build bin which creates these directories.

MashyBasker avatar Aug 08 '24 17:08 MashyBasker

So what does that mean? That is should work but doesn't?

lerno avatar Aug 08 '24 17:08 lerno

I suspect the docker container is running as a non-root user, and the script is trying to write to a directory that the user doesn't have write permissions to. I'm adding a potential fix.

MashyBasker avatar Aug 08 '24 18:08 MashyBasker

Now we seem to be getting:

chown: cannot access 'build': No such file or directory

lerno avatar Aug 08 '24 21:08 lerno

I am adding the chmod and chown commands directly in the build-with-docker.sh script. This should provide the necessary permissions to write a file inside the build directory.

MashyBasker avatar Aug 09 '24 06:08 MashyBasker

Ok! Crossing my fingers here :D

lerno avatar Aug 09 '24 08:08 lerno

Failed again. It must be a permission error because the build and bin directory gets created when I run the script locally.

MashyBasker avatar Aug 09 '24 09:08 MashyBasker

So, are there still options to try?

lerno avatar Aug 09 '24 09:08 lerno

#1347 should have merged these changes, if that merge looks good, please close this @MashyBasker

lerno avatar Aug 13 '24 11:08 lerno

This looks right

MashyBasker avatar Aug 13 '24 13:08 MashyBasker