Failed to build S32DS project when implement automatically and periodically build use cron

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Failed to build S32DS project when implement automatically and periodically build use cron

跳至解决方案
1,491 次查看
x-z-m-happy
Contributor I

OS: ubuntu 16.04 x86_64

s32ds: S32 Design Studio for Power Architecture v1.2

hello everyone,

I create a script as shown below to build my S32DS project, It can be successfully executed to generate  the final binary file.  but, when I use this script in cron to realize automatically and periodically build of S32DS project.  It failed and show lots of error.  I've pasted some of it as shown below. 

 How could I use cron to build S32DS project?  I guess  the reason related to environment variables of

cron,  But I have no idea how to how to  specify  S32DS environment variables to cron? 

     

 Any help  will be greatly appreciated.

#!/bin/bash
source /etc/profile
source ~/.bashrc

/home/jeremy/NXP/S32DS_Power_v1.2/eclipse/s32ds \
-vm /usr/local/java/jdk1.8.0_161/jre/bin \
-nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-importAll /home/jeremy/work/tmp/code_analysis/gateway/MPC5748g/MPC5748g_Z4_0 \
-cleanBuild MPC5748g_Z4_0/Debug_ImgA \
--launcher.ini /home/jeremy/NXP/S32DS_Power_v1.2/eclipse/s32ds.ini \
--launcher.suppressErrors

Opening 'MPC5748g_Z4_0'.
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.ui.ide was unable to load class org.eclipse.ui.internal.ide.misc.FileInfoAttributesMatcher.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.core.internal.resources.FilterDescriptor.createFilter(FilterDescriptor.java:76)
at org.eclipse.core.internal.resources.Filter.match(Filter.java:59)
at org.eclipse.core.internal.resources.Filter.filterIncludes(Filter.java:126)
at org.eclipse.core.internal.resources.Filter.filter(Filter.java:109)
at org.eclipse.core.internal.resources.Resource.filterChildren(Resource.java:2171)
at org.eclipse.core.internal.resources.Resource.filterChildren(Resource.java:2133)
at org.eclipse.core.internal.localstore.UnifiedTree.getLocalList(UnifiedTree.java:350)
at org.eclipse.core.internal.localstore.UnifiedTree.addChildren(UnifiedTree.java:138)
at org.eclipse.core.internal.localstore.UnifiedTree.addNodeChildrenToQueue(UnifiedTree.java:244)
at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:110)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904)
at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1705)
at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:167)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.ui.ide (609).
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:116)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 19 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.ui.internal.ide.IDEWorkbenchPlugin.start() of bundle org.eclipse.ui.ide.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
... 29 more

0 项奖励
1 解答
1,261 次查看
x-z-m-happy
Contributor I

Thanks for your reply

The problem here is the environment variables of cron is not correct set, but not SHELL and PATH.

I have already specified SHELL and PATH in ~/.bashrc, and sourced this file in script.

My solution is: I added  the following two variables in my shell script, then it work correctly with cron

export DISPLAY=:0
export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh

Actually, I don't know exactly what does this two envionment variables mean. 

Please let me know If anyone knows.

Thanks a lot.

在原帖中查看解决方案

0 项奖励
2 回复数
1,261 次查看
b48014
NXP Employee
NXP Employee

Hi,

Well, actually, you have problem with cron configuration, not with Design Studio, but I will try to help you anyway. :smileyhappy:

Could you show me the output of crontab -l command? 

Please note that you should specify SHELL and PATH for cron. This is my output for this command:

pastedImage_9.png

with the crontab file above I was able to build the project each minutes without any errors.

And I think you can use more simple version of headless build:

#!/bin/bash
source /etc/profile
source ~/.bashrc

/home/b48014/NXP/S32DS_Power_v2017.R1/eclipse/s32ds \
-nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data /home/b48014/workspaceS32DS.Power.2017.R1 -build test/Release

the project was located in workspace - /home/b48014/workspaceS32DS.Power.2017.R1

project name is test, build configuration is Release

Best regards,

Dmitry

0 项奖励
1,262 次查看
x-z-m-happy
Contributor I

Thanks for your reply

The problem here is the environment variables of cron is not correct set, but not SHELL and PATH.

I have already specified SHELL and PATH in ~/.bashrc, and sourced this file in script.

My solution is: I added  the following two variables in my shell script, then it work correctly with cron

export DISPLAY=:0
export SSH_AUTH_SOCK=/run/user/1000/keyring/ssh

Actually, I don't know exactly what does this two envionment variables mean. 

Please let me know If anyone knows.

Thanks a lot.

0 项奖励