Skip to content

added QNX SPD CLI support#57

Open
srinivasugithub wants to merge 10 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/QNX_SDP_update
Open

added QNX SPD CLI support#57
srinivasugithub wants to merge 10 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/QNX_SDP_update

Conversation

@srinivasugithub

Copy link
Copy Markdown

added QNX SPD CLI support

Comment thread packages/qnx/SDP/MODULE.bazel Outdated
@@ -0,0 +1,26 @@
# *******************************************************************************

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you create module here? As far as I can see, we don't need this.

Comment thread packages/qnx/SDP/BUILD Outdated
)

# Package the SDP as a tarball for distribution (optional)
genrule(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need genrule to package the output of CLI QNX (SDP). Bazel support already all sorts of packaging rules like pkg_tar or pkg_zip.

Comment thread packages/qnx/SDP/BUILD Outdated
)

# Create a filegroup that references the output directory
filegroup(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used?

Comment thread packages/qnx/SDP/extensions.bzl

"""Rule to create a QNX SDP distribution from a patchset file."""

def _qnx_sdp_distribution_impl(ctx):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need to run the command over the script? Why not directly via ctx.actuins.run?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see at start what is done here. The script that is here, I would set it as resource and just pull it into the rule as tool dependency.

# "gcc_version": "12.2.0",
# },
"aarch64-qnx-sdp_8.0.0": {
"build_file": "@score_bazel_cpp_toolchains//packages/qnx/aarch64/sdp/8.0.0:sdp.BUILD",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not remove old references, just add the new one if you need them.

# Create a BUILD file that exports the qnxsoftwarecenter_clt binary
# Note: The installer extracts to ./qnxsoftwarecenter (not qnx_software_center/qnxsoftwarecenter)
repository_ctx.file("BUILD", """
exports_files([

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need this. Filegroup already exposes tool.

doc = "The QNX installer file",
),
},
local = False,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this option by default set?

Comment thread packages/qnx/SDP/BUILD
@@ -0,0 +1,49 @@
# *******************************************************************************

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename SDP directory to sdp_install.

@@ -0,0 +1,38 @@
#!/bin/bash

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to have some sanity testing in place, then create directory test under sdp_install and set all test files and resources there.

Comment thread packages/qnx/SDP/extensions.bzl

# Create a BUILD file that exports the qnxsoftwarecenter_clt binary
# Note: The installer extracts to ./qnxsoftwarecenter (not qnx_software_center/qnxsoftwarecenter)
repository_ctx.file("BUILD", """

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider having BUILD file set as resource rather than writing it within the rule.

progress_message = "Installing QNX SDP from patchset %s" % patchset.short_path,
use_default_shell_env = True,
execution_requirements = {
"no-sandbox": "1", # May need to run without sandbox for installer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very bad option. It will destroy hermeticity of the build.


"""Rule to create a QNX SDP distribution from a patchset file."""

def _qnx_sdp_distribution_impl(ctx):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see at start what is done here. The script that is here, I would set it as resource and just pull it into the rule as tool dependency.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants