Developing under windows and linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Developing under windows and linux

1,333 Views
kai2
Contributor I

Currently I'm developing in S32DS unter windows 10, but I want to automate build and compilation as a CI job via jenkins in a ubuntu system.

I installed S32ds there too and can start in as a gui, but want to run the command line version there for automation.

Some problems I'm still trying to solve:

Somehow I find lots of windows related absolute path settings within my .project file. Those should be using variable prefixes instead.

The SDK variable names contain dots which isn't allowed anywhere under linux. So I can't redefine them from external shell scripts.

Currently I tried to define my own variables without any strange characters in it to contain the SDK folders, but now it doesn't find the cross compiler.

arm-none-eabi-gcc: not found

So it seems now the SDK stuff loads, but some other environment stuff is still missing.

So the big Question: Did anyone already tried developing under windows but command line compiling from the same git repo under linux?

0 Kudos
3 Replies

1,067 Views
maksimsalau
Contributor II

Hi Kai,

I had the very same goal as yours and have solved it!

There are several points to consider:

  1. your PE code should be pre-generated and stored in the repo (PE code generation is not functional on Linux);
  2. you need to copy SDK sources into S32DS installation on jenkins;
  3. your and jenkins' S32DS setup should be identical (same number of updated applied);

With all the step completed here is the command I use to build a project non-interactively by Jenkins:

set -x
set -e

NXP_DIR=/opt/NXP
PROJECT_NAME=FOOBAR
PROJECT_DIR=./${PROJECT_NAME}
WORKSPACE_DIR=./workspace

# Fix linked resources
sed -i -e "s#<location>C:/NXP/#<location>${NXP_DIR}/#g"  ${PROJECT_DIR}/.project

# Fix path to extenal tools
sed -i -e 's#${MSYS_LOC}/bash.exe#/bin/bash#g'  ${PROJECT_DIR}/.externalToolBuilders/*
sed -i -e 's#${MSYS_LOC}/make.exe#/usr/bin/make#g'  ${PROJECT_DIR}/.externalToolBuilders/*

# Build
${NXP_DIR}/S32DS_ARM_v2018.R1/eclipse/s32ds \
    -nosplash \
    --launcher.suppressErrors \
    -application org.eclipse.cdt.managedbuilder.core.headlessbuild \
    -data ${WORKSPACE_DIR} \
    -no-indexer \
    -importAll ${PROJECT_DIR} \
    -build all

# Rename SREC files to have version number embedded
for file in $(find ./${PROJECT_DIR} -name *.srec); do
    if [ -e "${file}" ]; then
        pushd $(dirname "${file}")
        TAG=$(git describe --always --long)
        mv "$(basename "${file}")" $(basename "${file}" .srec)-${TAG}.srec
        popd
    fi
done‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Few comments:

  1. project sources are cloned into ./FOOBAR by Jenkins (you can set this in "Git" -> "Additional Behaviours" -> "Check out to a sub-directory" = "FOOBAR");
  2. in my case S32DS is installed into /opt/NXP, so you may need to adjust it;
  3. line 10: we fix location of SDK source files that are linked into the project (if any);
  4. lines 13 and 14: we fix location of make and bash (I use them in external tool builders);
  5. line 17: a new workspace is creates in ./workspace, the project is imported into it and builded;
  6. line 27: the resulting SREC file is renamed to have commit hash in its name so you can always distinguish different build artifacts.

Good luck!

Regards,

Maksim.

0 Kudos

1,067 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

quick update - the SDK (and processor expert)  is not supported on Linux host  for S32DS Arm (please see release notes). Anyway, the same issue is on S32DS Power, where is SDK present and projects are incompatible. 

Jiri 

0 Kudos

1,067 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

thank you for report. I did some tests and projects based on SDK aren't compatible between S32DS running on Windows and Linux. I'm afraid that right now there is no workaround to have one project which can be build on both platforms. Only what may be working is to have shared source code and separate projects settings data for for each platform (at least linux and win .cproject, .project and ProcessorExpert.pe files version). 

Non SDK projects are working fine across both platforms. I'll rise JIRA ticket for this issue. Thanks. 

Jiri 

0 Kudos