You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we provide Debian package for the emulator, but it would also be nice to make easier to package the Cartesi Machine for any Linux distributions and even other operating systems. In this issue I listed suggestions and changes to improve this after packaging it for ArchLinux (see its build script in https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cartesi-machine).
Suggested enhancements
Remove the need of make dep step (bundle mongoose in source tree).
NOTE: Not possible because of license issues.
Remove the need of patchelf.
The tool patchelf hard code library paths when installing, this makes moving a package installed in one PREFIX to another impossible. Also patchelf is also not a common tool available, and somewhat hacky, it's responsibility of the packager to decide to use -rpath flags when linking, we should not enforce using -rpath. And when we think about operating systems that does not even use ELF, it doesn't make sense.
Command make DESTDIR=pkg is not working.
Workaround is to use make DESTDIR="$(pwd)/pkg", but it's common for a packager to use the shorthand version to "debug" the package.
Command make -j4 install-strip is not working.
It's common to use make with multiple threads when packaging, sometimes this is even done under the hood automatically, it should work.
Bundle keccak hash implementation and remove cryptopp.
Cryptopp is a huge library and a burden to compile to WebAssembly or other systems. This will also make packaging cartesi machine easier, that is, one less package for the packager to deal with. We only use it for one hash function.
Bundle nlohmann-json.
This is a header-only library and it's not available in all systems, we could just copy its header and bundle it. This will also make packaging cartesi machine easier, that is, one less package for the packager to deal with.
Bundle lua-dkjson lua sources.
We don't want to enforce the packager to install LuaRocks or lua packages himself, LuaRocks is notoriously problematic to install and unsupported in some operating systems.
Remove the need of protobuf, replace with something using JSON.
Remove the need of grpc and protobuf to compile libcartesi
Don't use shasum command when compiling.
This package is provided by perl, and requiring perl to compile is unnecessary.
Remove use of __FILE__ define from sources.
Because this is generating warnings by some package managers due to references to building source directory, mongoose is using this but there is a option to disable it.
Fix warning about cartesi::require() in uarch-solidity-compat.h when compiling in release.
Some tests are being compiled despite no being installed.
Like machine-c-tests and other binaries used only for testing, this increases the build time when packaging and also give us the burden to maintain test-only files build-able and workable in many systems.
Move emulator-defines inside emulator repository.
By having these outside the packager has to keep downloading them by hand and move files around.
Add make install-headers.
This is in case the packager don't want to install development headers.
Add a way to build static library libcartesi.a.
This will allow building contained Linux apps that use the cartesi machine emulator and facilitate WebAssembly use.
Remove the need of installing uarch-ram.bin (embed inside libcartesi.so)
Remove the need of downloading and installing ROM.
See the possibility of not needing boost to build (low priority).
We already removed many boost dependencies, we might not even need boost.
Remove the "proxy" scripts to run cartesi-machine and its tools.
Now that we are installing the emulator in standard OS paths, we may not need to have a Lua script just to append cartesi Lua paths. It's responsibly of the packager to sort out this, and most of the time he will have to do nothing because cartesi libraries will be available in standard Lua paths.
Environment variable CARTESI_IMAGES_PATH should not be mandatory.
The cartesi machine must try to auto detect where its images are in case CARTESI_IMAGES_PATH is unset.
This will alleviate the burden of the packager to have it properly set in /etc/profile. This will also give room for an user to override it, currently we can't override because it is hard-coded in the "proxy" scripts.
The text was updated successfully, but these errors were encountered:
Context
Currently we provide Debian package for the emulator, but it would also be nice to make easier to package the Cartesi Machine for any Linux distributions and even other operating systems. In this issue I listed suggestions and changes to improve this after packaging it for ArchLinux (see its build script in https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=cartesi-machine).
Suggested enhancements
Remove the need ofmake dep
step (bundle mongoose in source tree).NOTE: Not possible because of license issues.
patchelf
.The tool
patchelf
hard code library paths when installing, this makes moving a package installed in onePREFIX
to another impossible. Also patchelf is also not a common tool available, and somewhat hacky, it's responsibility of the packager to decide to use-rpath
flags when linking, we should not enforce using-rpath
. And when we think about operating systems that does not even use ELF, it doesn't make sense.make DESTDIR=pkg
is not working.Workaround is to use
make DESTDIR="$(pwd)/pkg"
, but it's common for a packager to use the shorthand version to "debug" the package.make -j4 install-strip
is not working.It's common to use make with multiple threads when packaging, sometimes this is even done under the hood automatically, it should work.
cryptopp
.Cryptopp is a huge library and a burden to compile to WebAssembly or other systems. This will also make packaging cartesi machine easier, that is, one less package for the packager to deal with. We only use it for one hash function.
nlohmann-json
.This is a header-only library and it's not available in all systems, we could just copy its header and bundle it. This will also make packaging cartesi machine easier, that is, one less package for the packager to deal with.
lua-dkjson
lua sources.We don't want to enforce the packager to install LuaRocks or lua packages himself, LuaRocks is notoriously problematic to install and unsupported in some operating systems.
protobuf
, replace with something using JSON.grpc
andprotobuf
to compile libcartesishasum
command when compiling.This package is provided by
perl
, and requiring perl to compile is unnecessary.__FILE__
define from sources.Because this is generating warnings by some package managers due to references to building source directory, mongoose is using this but there is a option to disable it.
cartesi::require()
inuarch-solidity-compat.h
when compiling in release.Like machine-c-tests and other binaries used only for testing, this increases the build time when packaging and also give us the burden to maintain test-only files build-able and workable in many systems.
emulator-defines
inside emulator repository.By having these outside the packager has to keep downloading them by hand and move files around.
make install-headers
.This is in case the packager don't want to install development headers.
libcartesi.a
.This will allow building contained Linux apps that use the cartesi machine emulator and facilitate WebAssembly use.
uarch-ram.bin
(embed insidelibcartesi.so
)We already removed many boost dependencies, we might not even need boost.
Now that we are installing the emulator in standard OS paths, we may not need to have a Lua script just to append cartesi Lua paths. It's responsibly of the packager to sort out this, and most of the time he will have to do nothing because cartesi libraries will be available in standard Lua paths.
CARTESI_IMAGES_PATH
should not be mandatory.The cartesi machine must try to auto detect where its images are in case CARTESI_IMAGES_PATH is unset.
This will alleviate the burden of the packager to have it properly set in /etc/profile. This will also give room for an user to override it, currently we can't override because it is hard-coded in the "proxy" scripts.
The text was updated successfully, but these errors were encountered: