How to move files in a bff? - aix

I am building a bff using mkinstallp.
My template file is :
Package Name: svr_exForum
Package VRMF: 7.2
Update: N
Fileset
Fileset Name: svr_exForum.rte
Fileset VRMF: 7.2
USRLIBLPPFiles
Pre-installation Script: /lppdir/lpp/exForum/F_pre_i
Post-installation Script: /lppdir/lpp/exForum/F_post_i
Pre_rm Script: /lppdir/lpp/exForum/F_prerm_i
Unpre-installation Script: /lppdir/lpp/exForum/F_unpre_i
Unpost-installation Script: /lppdir/lpp/exForum/F_unpost_i
Pre-deinstall Script: /lppdir/lpp/exForum/F_predes_i
EOUSRLIBLPPFiles
USRFiles
/exForum7/
/exForum7/full/
/exForum7/full/exForum7
/exForum7/exForum7up
EOUSRFiles
Fileset Description: Package d'installation du produit exForum pour aix versions 6.1-7.1
Bosboot required: N
License agreement acceptance required: N
Include license files in this package: N
Copyright file path: /lppdir/lpp/exForum/svr_exForum.copyright
Requisites:
ROOT Part: N
ROOTLIBLPPFiles
EOROOTLIBLPPFiles
ROOTFiles
EOROOTFiles
Relocatable: N
OVERRIDE_INVENTORY: /lppdir/lpp/exForum/svr_exForum.override
EOFileset
I have a compressed source file and once decompress I have to move some files in a different location.
In my Post-installation Script I am then moving some of the USRFiles is a different location.
If I do that when installing the bff I get the following error message :
sysck: 3001-022 The file ... was not found.
Is there a way to skeep the test done during the installation of the bff that verify if all the USRFiles are present?
If I have done the same operations in rpm packages and I would use the missingok in the %files section.

Related

conan doesn't upload export/conanfile.py to remote

I have created customized OpenCV package using conan package manager and uploaded it to a remote storage.
Workflow:
create package
cd c:\path\to\conanfile.py
conan create . smart/4.26 --profile ue4
Export with conan export . opencv-ue4/3.4.0#smart/4.26
Result:
c:\path\> conan export . opencv-ue4/3.4.0#smart/4.26
[HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute
Exporting package recipe
opencv-ue4/3.4.0#smart/4.26 exports_sources: Copied 3 '.patch' files: cmakes.patch, check_function.patch, typedefs.patch
opencv-ue4/3.4.0#smart/4.26: The stored package has not changed
opencv-ue4/3.4.0#smart/4.26: Exported revision: ceee251590f4bf50c4ff48f6dc27c2ed
I upload everything to the remote:
c:\path> conan upload -r bart opencv-ue4/3.4.0#rs7-smart/4.26 --all
Uploading to remote 'bart':
Uploading opencv-ue4/3.4.0#smart/4.26 to remote 'bart'
Recipe is up to date, upload skipped
Uploading package 1/1: 1d79899922d252aec6da136ce61bff640124c1c4 to 'bart'
Uploaded conan_package.tgz -> opencv-ue4/3.4.0#smart/4.26:1d79 [23667.97k]
Uploaded conaninfo.txt -> opencv-ue4/3.4.0#smart/4.26:1d79 [0.75k]
Uploaded conanmanifest.txt -> opencv-ue4/3.4.0#smart/4.26:1d79 [11.81k]
Our remote storage runs on the Artifactory, and I can see in a browser that conanfile.py is not listed anywhere.
I can also verify that directory C:\Users\user\.conan\data\opencv-ue4\3.4.0\smart\4.26\export on my Windows PC does contain both conanfile.py and conanmanifest.txt
I am using Windows PC for doing all above.
Now I'm trying to consume that package on another machine, running Ubuntu Linux.
Here is my conanfile.txt
[requires]
opencv-ue4/3.4.0#smart/4.26
[generators]
json
Command and results
> conan install -g json . opencv-ue4/3.4.0#smart/4.26
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=9
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
opencv-ue4/3.4.0#smart/4.26: Not found in local cache, looking in remotes...
opencv-ue4/3.4.0#smart/4.26: Trying with 'bart'...
Downloading conanmanifest.txt completed [0.33k]
opencv-ue4/3.4.0#-smart/4.26: Downloaded recipe revision 0
ERROR: opencv-ue4/3.4.0#smart/4.26: Cannot load recipe.
Error loading conanfile at '/home/user/.conan/data/opencv-ue4/3.4.0/smart/4.26/export/conanfile.py': /home/user/.conan/data/opencv-ue4/3.4.0/smart/4.26/export/conanfile.py not found!
Running ls -la /home/user/.conan/data/opencv-ue4/3.4.0/smart/4.26/export/ shows that the directory indeed contains only file conanmanifest.txt
Below is the relevant part of the conanfile.py that I've used to build the package
from conans import ConanFile, CMake, tools
class OpenCVUE4Conan(ConanFile):
name = "opencv-ue4"
version = "3.4.0"
url = ""
description = "OpenCV custom build for UE4"
license = "BSD"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
exports_sources = 'patches/cmakes.patch', 'patches/check_function.patch', 'patches/typedefs.patch'
def requirements(self):
self.requires("ue4util/ue4#adamrehn/profile")
self.requires("zlib/ue4#adamrehn/{}".format(self.channel))
self.requires("UElibPNG/ue4#adamrehn/{}".format(self.channel))
def cmake_flags(self):
flags = [
"-DOPENCV_ENABLE_NONFREE=OFF",
# cut
]
return flags
def source(self):
self.run("git clone --depth=1 https://github.com/opencv/opencv.git -b {}".format(self.version))
self.run("git clone --depth=1 https://github.com/opencv/opencv_contrib.git -b {}".format(self.version))
def build(self):
# Patch OpenCV to avoid build errors
for p in self.exports_sources:
if p.endswith(".patch"):
tools.patch(base_path='opencv', patch_file=p, fuzz=True)
cmake = CMake(self)
cmake.configure(source_folder="opencv", args=self.cmake_flags())
cmake.build()
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
Conan version both in Windows and in Linux is 1.54.0
How do I correctly upload and consume the package?
Update.
After conversation with #drodri in comments I have removed conanfile.py from exports_sources, deleted all conan-generated files in all PCs and removed uploaded files from the Artifactory.
Then I've rebuilt the package, re-exported and re-uploaded it.
The issue was in restrictions of our Artifactory. Admins have forbidden uploading .py files.

Dotnet Sonarcloud end failed

I trying to integrate my Solution based on .net6 with SonarCloud and Github actions.The problem is that the action build failed on the sonar scanner end.I tried to change working dirs but with the same effect.The project is public HERE
The SonarScanner for MSBuild integration failed: SonarCloud was unable to collect the required information about your projects.
Possible causes:
The project has not been built - the project must be built in between the begin and end steps
An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
The begin, build and end steps have not all been launched from the same folder
None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln) SonarScanner for MSBuild 5.7.2 Using
the .NET Core version of the Scanner for MSBuild Post-processing
started. 10:38:06.016 Generation of the sonar-properties file failed.
Unable to complete the analysis. 10:38:06.024 Post-processing failed.
Exit code: 1 Error: Process completed with exit code 1.
name: build-all
# Controls when the action will run.
on:
push:
branches:
- main
env:
DOTNET_VERSION: 6.0.x
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-windows:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout#v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- uses: actions/setup-dotnet#v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- uses: microsoft/setup-msbuild#v1
- uses: actions/setup-java#v2
with:
distribution: 'adopt'
java-version: '11'
- name: Restore NuGet packages
run: |
cd App
nuget restore App.sln
- name: Begin Sonar scan
run: |
cd App
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /o:vladimirpetukhov /k:vladimirpetukhov_Musement_CLI /d:sonar.login=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url=https://sonarcloud.io
- name: Build Api
run: |
cd ./App/App.API
dotnet build App.API.csproj --no-restore
# dotnet test App.API.csproj --no-build --no-restore --verbosity normal -p:CollectCoverage=true -p:CoverletOutputFormat=opencover
- name: Build Main
run: |
cd ./App/App.Main
dotnet build App.Main.csproj --no-restore
# dotnet test App.Main.csproj --no-build --no-restore --verbosity normal -p:CollectCoverage=true -p:CoverletOutputFormat=opencover
- name: End Sonar scan
run: |
cd App
dotnet sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}

Accessing agent computer in azure devops

I am new in azure devops services, and i am trying to run a pipeline that process an asp.net core application.
I have a task for restoring the project dependencies. Its code is dotnet Restore
.
The piepeline fail on that command with this message :
1:5>C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [D:\a\1\s\AspNetProjectOnDocker.csproj]
Done executing task "NETSdkError" -- FAILED.
1:5>Done building target "_CheckForUnsupportedNETCoreVersion" in project "AspNetProjectOnDocker.csproj" -- FAILED.
1:5>Done Building Project "D:\a\1\s\AspNetProjectOnDocker.csproj" (_GenerateRestoreGraphProjectEntry target(s)) -- FAILED.
1>Done executing task "MSBuild" -- FAILED.
1>Done building target "_GenerateRestoreGraph" in project "AspNetProjectOnDocker.csproj" -- FAILED.
1>Done Building Project "D:\a\1\s\AspNetProjectOnDocker.csproj" (Restore target(s)) -- FAILED.
AspNetProjectOnDocker is the name of my .net project
My Questions :
How to access to the folder : C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets specified in the error message above.
Thanks.
My Questions :
How to access to the folder : C:\Program
Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets
specified in the error message above.
Answer to your question:
This is not a folder, it is a file. You can access it via the following YAML pipeline definition.
trigger:
- none
pool:
vmImage: windows-2019
steps:
- script: |
echo Check target file
C:
cd C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets
more Microsoft.NET.TargetFrameworkInference.targets
displayName: 'Check target file'
# if you encounter some issue such as can't find directory, you can use the following method to check what happens.
# - script: |
# echo Check target file step by step
# dir
# C:
# dir
# cd Program Files
# dir
# cd dotnet
# dir
# cd sdk
# dir
# cd 5.0.410
# dir
# cd Sdks
# dir
# cd Microsoft.NET.Sdk
# dir
# cd targets
# dir
# more Microsoft.NET.TargetFrameworkInference.targets
# displayName: 'Check target file step by step'
Successfully get the file content:

No such file or directory -- Building an RPM with CPACK using custom spec file

I'm trying to build an RPM with CPACK using my own .spec file. In following the tutorial from here.
I'm getting an error when building the RPM:
No such file or directory
It has to do with the Source0 line in the .spec file
I've got this in my CMakeLists.txt file:
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/my_project.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/my_project.spec" #ONLY IMMEDIATE)
SET(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/my_project.spec")
SET(CPACK_PACKAGE_RELEASE 2)
INCLUDE(CPack)
This works and generates a .spec file. In my .spec.in file, it's got:
Buildroot: #CMAKE_CURRENT_BINARY_DIR#/_CPack_Packages/Linux/RPM/#CPACK_PACKAGE_FILE_NAME#
Name: #CPACK_PACKAGE_NAME#
Version: #CPACK_PACKAGE_VERSION#
Release: #CPACK_PACKAGE_RELEASE#%{dist}
Summary: Blah blah
Vendor: #CPACK_PACKAGE_VENDOR#
License: MIT
Source0: https://github.com/me/%{name}/archive/%{version}.tar.gz
BuildRequires: gcc, make, cmake
BuildRequires: doxygen, graphviz, doxygen-latex
%description
<SNIPPED>
Then I get rhe error
CPackRPM:Debug: *** error: File /home/me/projects/my_project/build/_CPack_Packages/Linux/RPM/SOURCES/1.0.0.0.tar.gz: No such file or directory
That error is due to the Source0 line I imagine.
If I do this instead, I get a little different error:
CPackRPM:Debug: *** error: File /home/me/projects/my_project/build/_CPack_Packages/Linux/RPM/SOURCES/my_project: No such file or directory
And somewhat related, this doesn't seem to generate an SRPM either. I need one of those to submit to Fedora for inclusion in package db.

Have hudson compile a repo with maven

I'm trying to have Hudson compile a Java project of mine, but it keeps failing.
I've started a new job, with "build a free-style software project"
I've set the SCM to Mercurial, added a build step "mvn compile" and had it publish Junit and JDepend results. JUnit test report simple named "*.xml"
The cloning of the repo works, but the repo refuses to compile. I get this error message:
[workspace] $ /usr/local/bin/hg log --rev . --template {node}
[workspace] $ /bin/bash -xe /tmp/hudson1162267116265588070.sh
+ mvn compile
/tmp/hudson1162267116265588070.sh: line 2: mvn: command not found
Recording test results
[JDepend] JDepend plugin is ready
[JDepend] Starting JDepend file, outputting to /tmp/jdepend6348540211061861772.xml
[JDepend] Found 2 classes in 1 packages
Finished: FAILURE
EDIT: result of mvn -ver
Java version: 1.6.0_21
Java home: /usr/java/jdk1.6.0_21/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-25-generic" arch: "i386" Family: "unix"
Also, what I added to my /etc/bash.bashrc file.
export JAVA_HOME=/usr/java/jdk1.6.0_21
export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
export MAVEN_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export MAVEN=$MAVEN_HOME/bin
And the $PATH echo.
/usr/local/apache-maven/apache-maven-2.2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/java/jdk1.6.0_21/bin
The essential part of John V's answer and its comments.
It can't find maven, because it is not in the path. If you set the path in Hudson's .profile you are out of luck. The profile will only be executed for login shells. AFAIK, Hudson opens a non-interactive shell to execute the build steps and therefore, the .profile will not be executed.
When you login using the Hudson user account and run the maven command you will not have any problems, since the profile is correctly executed.