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

Connect RetDec to a continuous integration service supporting FreeBSD #493

Open
s3rvac opened this issue Feb 6, 2019 · 20 comments
Open

Comments

@s3rvac
Copy link
Member

s3rvac commented Feb 6, 2019

At present, RetDec can be built on Windows, Linux, macOS, and (experimentally) on FreeBSD (#476). However, we have continuous integration only for Windows, Linux, and macOS. As suggested here, it would be a good idea to also connect RetDec to a continuous integration service supporting FreeBSD, such as https://cirrus-ci.com/.

As we have no experience with FreeBSD, we encourage the community to help. For inspiration, you can take a look at .appveyor.yml and .travis.yml.

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

Great! Also the FreeBSD community have what is called a ports collection, with over 26,000 ports being maintained by individuals and teams. The ports collection is compiled into packages which rather than building the port yourself, you can download and install a pre-built package.
There are many massive organisations that use FreeBSD as servers or in embeded systems and contribute including Apple (as the OSX & iOS are based on FreeBSD). Netflix, Cisco, Whatsapp ($1m donation every year), EMC, Sony, VMWare, Yahoo.. etc.
If you want to know more about a particular company go to youtube.com and search for example "netflix freebsd".
FreeBSD is exceptionally stable including all its ports and packages. Everything works first time every time! Updating to the latest FreeBSD operating system is as easy as freebsd-update -r <release>

I am sure there will be people interested to help. :)

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

PCBSD is probably the best place to start. As it will give you a nice GUI Desktop, where as FreeBSD (out of the box) will give you a basic server and you have to install all the packages to get a GUI Desktop.
(Another lifetime ago started on Linux/GNU but switched!)

@lwhsu
Copy link

lwhsu commented Feb 8, 2019

Hey @gwquk , since you ported RetDec to FreeBSD, do you want to help connect this project to Cirrus CI? Here is a simple example and hope it helps: https://github.com/facebook/zstd/blob/dev/.cirrus.yml

If you would also like to create a port, it will be even better and I'll do anything I can help!

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

I'll give it a go, more than happy to help with both. Not done it before but I am sure you and google can help. 👍

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

OK, If I understand what is going on below.

  1. For FreeBSD 12-0 & 11-2 releases on the amd64 architecture.
  2. Change the (searched) text in /etc/pkg/FreeBSD.conf backing up the original to /etc/pkg/FreeBSD.conf.bak
    from "pkg+http://pkg.FreeBSD.org/${ABI}/latest" to "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
  3. Upgrade all currently installed "Packages" to the latest package.
  4. Install all the packages needed by "retdec". (if already installed FreeBSD will say they are up to date)
  5. And finally ... the script needed to build "retdec"... including any environment variables to set.
    Note: That is as far as it goes... i.e. "retdec" is not installed by the look of things (just built)! Also.. A freshly installed version of FreeBSD may require more packages installed.

Iwshu, Is this what you are looking for?

#######################
env:
CIRRUS_CLONE_DEPTH: 1
ARCH: amd64

task:
freebsd_instance:
matrix:
image: freebsd-12-0-release-amd64
image: freebsd-11-2-release-amd64
install_script:
- sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf
- pkg upgrade
- pkg install git cmake python37 bison autotools
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/bin
- make -jN

@lwhsu
Copy link

lwhsu commented Feb 8, 2019

@gwquk yes this one looks nice to me, except that I think we need one more 'N' argument after make -j. Also, may I suggest you test this .cirrus.yml in your fork repository with cirrus-ci?

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

OK! I'll give it a go.

I have not submitted a port before, I'll make a few files.
I suspect "retdec" would go here "/usr/ports/devel/retdec" in the "ports tree"
I suspect these standard files will be needed..
Makefile distinfo pkg-descr pkg-message

@lwhsu
Copy link

lwhsu commented Feb 8, 2019

All of these sound reasonable to me. I would also recommend you reading the porter's handbook: https://www.freebsd.org/doc/en/books/porters-handbook/ and discuss on freebsd-ports list if you have further question: https://lists.freebsd.org/mailman/listinfo/freebsd-ports

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

Great! As I did not introduce myself.. I have been using FreeBSD activitely since around version 2.2.7 .. I did have a version 1.0 CD not sure where that went! Although I changed careers back in 2007, I have always maintained a few FreeBSD boxes. What about yourself?

@lwhsu
Copy link

lwhsu commented Feb 8, 2019

My FreeBSD history is shorter than you :) you can find my public information on my github page.

@gwquk
Copy link
Contributor

gwquk commented Feb 8, 2019

👍

@gwquk
Copy link
Contributor

gwquk commented Feb 9, 2019

@gwquk yes this one looks nice to me, except that I think we need one more 'N' argument after make -j. Also, may I suggest you test this .cirrus.yml in your fork repository with cirrus-ci?

Do I create a new file called ".cirrus.yml" in a "clone" of the retdec source code from github ..
Where do I start with this https://github.com/marketplace/cirrus-ci .. I have never used it before?

Sorry stupid questions..

@lwhsu
Copy link

lwhsu commented Feb 9, 2019

That's OK, you can create a new .cirrus.yml in a branch in your "forked" repository at https://github.com/gwquk/retdec , and please check cirrus-ci's doc at https://cirrus-ci.org/ for more information about how to enable that service in your repository.

@gwquk
Copy link
Contributor

gwquk commented Feb 9, 2019

OK.. I have made the "free" purchase. Uploaded the ".cirrus.yml" to my "forked" repository at https://github.com/gwquk/retdec .. it is not obvious what happens next! Will Cirrus CI just find the file and use it on my repository?

@lwhsu
Copy link

lwhsu commented Feb 9, 2019

Yes it will get triggered automatically, the result is at https://cirrus-ci.com/github/gwquk/retdec/
It looks you need check syntax and indentation of YAML.

@gwquk
Copy link
Contributor

gwquk commented Feb 9, 2019

I have uploaded a new version but I am only guessing .. all I have done is indent some of the lines. Could you please take a look into the file ".cirrus.yml" at https://github.com/gwquk/retdec ? Thanks

@lwhsu
Copy link

lwhsu commented Feb 9, 2019

@gwquk
Copy link
Contributor

gwquk commented Feb 9, 2019

cheers... some silly mistakes on my part. Also ... looks like FreeBSD 12.0 may compile retdec successfully on the forth attempt. (still going) FreeBSD 11.2 failed!

@lwhsu
Copy link

lwhsu commented Feb 9, 2019

That's great! Please also check the sed line in the above gist link, the line in your repository probably cannot do what we exactly want.

@lwhsu
Copy link

lwhsu commented Feb 20, 2019

Hello @gwquk how's the status? I see the .cirrus.yml in https://github.com/gwquk/retdec is good, but there seems some tweaks in the retdec's c++ codes, right?

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

No branches or pull requests

3 participants