Deploying URCap does not update resources located in felix-cache

Versions

Affected Robot Software Version(s): 5.9.1

Impact

Daemon executable is not up to date after rebuilding URCap.

Issue details

Resources embedded into the URCap are not re-extracted when URCap is updated.

Steps to Reproduce

  1. Open the mydaemonswing sample available inside the Starter Package VM.
  2. Inside the pom.xml file set install path to /home/ur/ursim/ursim-5.9.1.1031110/.
  3. Build and install using mvn install -P ursim.
  4. Launch ursim and make sure you see the newly deployed URCap in the installation tab.
  5. Open HelloWorld.cpp and make a change to the startup log.
  6. Rebuild and install URCap.
  7. Relaunch ursim.
  8. View logs inside felix-cache folder and see that Hello World started is printed.

Expected Behavior

New version of the daemon is started. Therefore printing new log.

Actual Behavior

Old version of the daemon is started. Printing Hello World started.

Workaround Suggestion

Manually uninstall URCap using Polyscope GUI before installing updated version.

This workaround is functional however it is not very convenient as a developer to have to manually uninstall every single time a new URCap version is to be tested. I tend to use an earlier version of Polyscope to skip this completely.

1 Like

I have had the same problem with Python daemons.

Hi @alexander,

In your pom.xml file. You can modify your ursim id section to this:

		<id>ursim</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.1</version>

					<executions>
						<execution>
							<id>ursim-remove-felix-cache</id>
							<phase>install</phase>
							<goals>
								<goal>exec</goal>
							</goals>
							<configuration>
								<executable>rm</executable>
								<commandlineArgs>-rfv ${ursim.home}/GUI/felix-cache/*</commandlineArgs>
								<workingDirectory>.</workingDirectory>
							</configuration>
						</execution>
						<execution>
							<id>ursim-install-urcap</id>
							<phase>install</phase>
							<goals>
								<goal>exec</goal>
							</goals>
							<configuration>
								<executable>cp</executable>
								<commandlineArgs>target/${project.build.finalName}.jar ${ursim.home}/.urcaps/${urcap.symbolicname}.jar</commandlineArgs>
								<workingDirectory>.</workingDirectory>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build> 

Ebbe

@Ebbe Thank you for the workaround.

I am however wondering if there still might be a bug in the extraction process because based of what can be read here. (quoted below)

Improved PolyScope startup time when a URCap with a daemon contribution is installed on the system:
The unpacking of resources when the ‘installResource(URL)’ method is called on the implementation of the ‘DaemonContribution’ interface during startup will only occur the very first time (after the URCap has been installed or updated)

If it indeed is a bug, then the following inconvenience might be solved following a resolution.

Clearing all files and folders under felix-cache/ causes the removal of logs (ex. /log/log/current) which when open in a text editor for continuous preview, must now be reopened because filepath does not exist anymore. Considering the fact that the log file is never in the same location because the bundle number can change between reinstalls of the URCap (which is the case with an empty cache), it requires manually reopening log file every time URCap is deployed.

Hi @alexander,

As long as Polyscope does it when the URCap is updated(bumped version number), then it should never affect an end user. Since only a single URCap is release with that version number.
Then my suggested workaround will fix the issue in the development scenario.

Ebbe

1 Like

@Ebbe Thank you for the clarification. I will mark as solved.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.