Tuesday, October 27, 2020

Learning Jenkins in an adhoc way

 It just happens that I have to setup a CI/CD ecosystem to test a series of changes to the compiler.  I am using Git and Jenkins as the framework.

I am getting to know both!

I am using corporate Jenkins, which means another team has downloaded, and configured Jenkins.  I have a personal Jenkins space, with limited configuration capabilities.  It is connected to a source repository which contains an application code, toolchain and build scripts.  The relationship between these pieces are as follow:

  the build scripts build the toolchain, which then is used to build the application code.

Each of these, the scripts, toolchain, and application, is maintained in a separate repository.  The main goal is changes to each repository triggers the build, guided by Jenkinsfile.

I added the build scripts and toolchain repositories as submodules of the application.  I then navigated through the Jenkinsfile documentation online to find a way to trigger a build when a commit was made to the git submodules.  After a couple days on the topic, I gave up.  

I tried GitSCM with various settings and none worked.

In order to make progress, I moved to an alternative way.  It is a simple minded way.  I git clone each repository, within on Jenkins Pipeline and go build the toolchain and the application in that order.

Jenkins, being so pervasive in the development world, should be able to handle multiple repositories and invoke the build when there's a change to one of them.  

Please, leave me a comment here, if you know how.  Thanks in advance!

Sunday, October 18, 2020

GNU GCC Register Transfer Expression RTX




Not a whole lot of documentation available on the topic!  I guess when you find something the hard way, you earned the right to show it off.  But, besides vanity, it's good to document it for future reference.  I can refresh my memory using this page.  It can also prove helpful to others.

Objective: gen_reg_rtx (machine_mode) vs gen_rtx_REG (machine_mode)

Declared: rtl.h

Defined: emit-rtf.c

Returns: a pseudo register/a hardware register (type rtx)

Implementation difference:   gen_reg_rtx asserts if called after compiler's register allocation phase is completed.

Code changes all the time! Above information is valid for GCC v8.3.1 source.