Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added deb package #67

Merged
merged 6 commits into from
Aug 16, 2023
Merged

Added deb package #67

merged 6 commits into from
Aug 16, 2023

Conversation

mpolitzer
Copy link
Contributor

@mpolitzer mpolitzer commented May 31, 2023

build (On a debian/ubuntu docker container):

# 1. build the emulator and uarch
make -j$(nproc) dep
make -j$(nproc)
make -j$(nproc) uarch

# 2. create the package
make deb DESTDIR=$PWD/_install PREFIX=/usr MACHINE_EMULATOR_VERSION=0.14.0-dev

use:

# 1. install .deb in a clean image
apt update
apt install ./machine-emulator.deb

cartesi-machine --help
...

close #65
close #106

deb-control Outdated Show resolved Hide resolved
@edubart edubart linked an issue May 31, 2023 that may be closed by this pull request
1 task
@edubart edubart added the enhancement New feature or request label May 31, 2023
@edubart edubart added this to the v0.15.0 milestone May 31, 2023
@mpolitzer mpolitzer force-pushed the feature/deb-packaging branch 6 times, most recently from 9c48a4a to 402a77e Compare June 1, 2023 19:49
@mpolitzer mpolitzer marked this pull request as ready for review June 1, 2023 19:55
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
tools/template/cartesi-machine.template Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
tools/template/control.template Outdated Show resolved Hide resolved
@cartesi cartesi deleted a comment from edubart Jun 2, 2023
Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@alexmikhalevich alexmikhalevich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marcelo, great work, thank you. However, I have problems running the machine after installation.

I built the package and try to install it into a fresh debian image:

$ make -j15
$ make uarch-with-toolchain
$ make debian DESTDIR=$PWD/_install/usr PREFIX=/usr MACHINE_EMULATOR_VERSION=0.14.0-dev
$ docker run -v (pwd):/emulator -it debian:latest
$ (docker) apt update
$ (docker) cd emulator && apt install ./cartesi-machine-v0.14.0-dev.deb
$ (docker) cartesi-machine --help
lua5.3: error loading module 'cartesi' from file '/usr/lib/lua/5.3/cartesi.so':
        /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/lua/5.3/cartesi.so)
stack traceback:
        [C]: in ?
        [C]: in function 'require'
        /usr/bin/cartesi-machine.lua:19: in main chunk
        [C]: in ?

Could you please clarify what is going on here?

@mpolitzer
Copy link
Contributor Author

mpolitzer commented Jun 5, 2023

@alexmikhalevich Thanks for trying it out.

Sure. My guess is that make debian is creating a binary package.
The catch is that it has to be built on the same distro it will run.

Maybe the name is misleading (would make deb be better?).

Can you try doing both parts (build and run) in docker?
EDIT:

Build

# keep artifacts of the build stage.
sed -e 's/rm -rf \*/true/g' .github/workflows/Dockerfile > .github/workflows/builder.dockerfile
docker build --target builder -t cartesi/machine-emulator-builder -f .github/workflows/builder.dockerfile .

Copy

C=`docker create cartesi/machine-emulator-builder` &&
   docker cp $C:/usr/src/emulator/cartesi-machine-v0.0.0.deb . &&
   docker rm $C

Run

docker run --rm -it -v=$PWD:/mnt --workdir=/mnt ubuntu:22.04
|> apt update && apt install -y ./cartes-machine-0.0.0.deb # in the container

@mpolitzer mpolitzer force-pushed the feature/deb-packaging branch 2 times, most recently from 6b810e4 to 90987ed Compare June 5, 2023 20:14
tools/template/cartesi-machine-stored-hash.template Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@mpolitzer mpolitzer force-pushed the feature/deb-packaging branch 17 times, most recently from 0c6ee83 to f377f1c Compare August 15, 2023 20:02
@mpolitzer mpolitzer force-pushed the feature/deb-packaging branch 2 times, most recently from 917d825 to 5105fd7 Compare August 15, 2023 21:06
- migrated secrets.DOCKER_ORGANIZATION to github.repository_owner
- remove unnecessary uses of metadata actions
- use an explicit DEBIAN_IMG for copy
- upload and download multiple artifacts at once
@vfusco vfusco merged commit 5d14d14 into main Aug 16, 2023
7 checks passed
@vfusco vfusco deleted the feature/deb-packaging branch August 16, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Distribute versioned shared libraries Debian packaging
5 participants