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

Patch Path.h to allow for external definition of UTILS_OS_POSIX, UTILS_OS_LINUX, ... #49

Closed
spchamp opened this issue Apr 28, 2016 · 6 comments

Comments

@spchamp
Copy link

spchamp commented Apr 28, 2016

Hello! I'm working on compiling the webthree-umbrella source tree (WU) on FreeBSD 10.3-RELEASE. WU uses libethereum as a Git submodule, which of course - in turn - uses evmjit as a submodule.

Personally, I'd like to be able to develop a complete port and some documentation about the WU build on FreeBSD - perhaps towards developing a manner of a FreeBSD edition specifically for Ethereum nodes? and of course it would include geth. Presently, I'm trying to - so to speak - to "Hash out" the dependencies for the build, onto the FreeBSD ports tree.

I noticed that libevmjit/support/Path.h defines a small number of preprocessor macros, such that are applied in the corresponding Path.cpp file as with regards to the definitions of the dev::path::user_home_directory() and dev::path::user_cache_directory() functions. Rather than trying to globally define -D__linux to pull in those macros' respective Linux definitions on FreeBSD, I've patched Path.h such as to allow for the macros to be declared in CXXFLAGS. The macros affected with this patch include:

  • UTILS_OS_LINUX
  • UTILS_OS_MAC
  • UTILS_OS_POSIX
  • UTILS_OS_WINDOWS

The applications of the bold annotated macros, of course, may be in some ways apropos to the FreeBSD build.

In reference to how these macros are applied in Path.cpp I've added a note to my own albeit ad-hoc notebook - towards adding a note to the documentation - that the UTILS_OS_LINUX definition is apropos to an environment variable named XDS_CACHE_HOME applied in Path.cpp. I'm not sure of whether or how that may pertain to XDG_CACHE_HOME as in reference to the XDG Base Directory spec. It seems that the XDS... environment variable's name does find some applications, however I'm not sure if it's quite as common as the XDG_CACHE_HOME form? Perhaps that could be addressed in a separate patch, but I wouldn't want to propose a change to it without being certain as with regards to applications of the XDS form viz a viz XDG_CACHE_HOME

The present patch will address only the definitions in Path.h

patch_evmjit_path.diff.txt

@spchamp spchamp changed the title Patch path.h allowing for external definition of UTILS_OS_POSIX, UTILS_OS_LINUX Patch Path.h to allow for external definition of UTILS_OS_POSIX, UTILS_OS_LINUX, ... Apr 28, 2016
@chfast
Copy link
Member

chfast commented May 4, 2016

Thanks very much for sharing that.

  1. XDS_CACHE_HOME was a typo. Fixed by c580932.
  2. I sent changes related to user home/cache dir to LLVM. They are available in LLVM 3.8 and I plan to use them as soon EVMJIT will be using LLVM 3.8.
  3. Before that, I simplified the implementation to not discriminate any OS. I just assume the OS is PASIX-like. See Simplify getting cache dir to support other POSIX-like systems #50. Will that help you?

@bobsummerwill
Copy link
Contributor

See also ethereum/webthree-umbrella#384, from @tymat.

@bobsummerwill
Copy link
Contributor

So @tymat has been periodically working towards that same aim, @spchamp, and I would love to see us having working FreeBSD builds.

@tymat even offered a build machine for our automation. We're not in a position to incorporate an extra machine yet, but I would certainly be happy to see that.

We need to have it working locally first, though :-)

On a slightly related theme, @rainbeam has been working on Alpine Linux support, which is probably in much the same ball-park as BSD and OS X, because it uses musl, and not GLIBC.

See ethereum/webthree-umbrella#495

Does FreeBSD support static linkage against runtime libraries?

@tymat
Copy link

tymat commented May 17, 2016

The offer still stands. I'd love to see FreeBSD part of the build process.

@bobsummerwill static linkage can be problematic in FreeBSD.

@bobsummerwill
Copy link
Contributor

Great, @tymat!

Does HEAD build successfully on FreeBSD, do you know?

@bobsummerwill
Copy link
Contributor

Does eth build on FreeBSD right now, @tymat? Thanks!

We're in the process of migrating our automation to TravisCI, CircleCI, Appveyor. Not sure how we would hook a FreeBSD machine into a SAAS CI solution. I'll have a similar question myself for my cross-builds and will ponder on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants