Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up rpm spec for odo for rpm build #2107

Merged
merged 13 commits into from Sep 20, 2019

Conversation

mohammedzee1000
Copy link
Contributor

What this is

This add rpm spec to odo repository.
As per @navidshaikh from knative, it will be easier if we first have rpms as ART already has a ready-made script for extracting odo binaries from rpms, so moving to add spec. Also having rpm makes it easy to have a proper paper trail

Note it is assumed rpmbuild is installed, on Fedora do dnf install rpm-build

Output

$ scripts/rpm-prepare.sh 
Reading ODO_VERSION, ODO_RELEASE and GIT_COMMIT env, if they are set
Making release for atomic-openshift-odo-rpm-1.0.0test-1, git commit af9f7aad
Cleaning up old content
Configuring output directory .rpmbuild
Generating spec file .rpmbuild/SPECS/atomic-openshift-odo-rpm.spec
Generating taball .rpmbuild/SOURCES/atomic-openshift-odo-rpm-1.0.0test-1.tar.gz
~/workbench/work/golang/redhat/src/github.com/openshift/odo/.rpmbuild/SOURCES ~/workbench/work/golang/redhat/src/github.com/openshift/odo
~/workbench/work/golang/redhat/src/github.com/openshift/odo/.rpmbuild/SOURCES/atomic-openshift-odo-rpm-1.0.0test-1 ~/workbench/work/golang/redhat/src/github.com/openshift/odo/.rpmbuild/SOURCES ~/workbench/work/golang/redhat/src/github.com/openshift/odo
~/workbench/work/golang/redhat/src/github.com/openshift/odo/.rpmbuild/SOURCES ~/workbench/work/golang/redhat/src/github.com/openshift/odo
~/workbench/work/golang/redhat/src/github.com/openshift/odo
Finalizing...
Generated content in <redacted>/workbench/work/golang/redhat/src/github.com/openshift/odo/dist/rpmbuild

$ scripts/rpm-local-build.sh 
Copying content to local rpmbuild
'dist/rpmbuild/SOURCES/atomic-openshift-odo-rpm-1.0.0test-1.tar.gz' -> '<redacted>/rpmbuild/SOURCES/atomic-openshift-odo-rpm-1.0.0test-1.tar.gz'
'dist/rpmbuild/SPECS/atomic-openshift-odo-rpm.spec' -> '<redacted>/rpmbuild/SPECS/atomic-openshift-odo-rpm.spec'
Building locally
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.PMetD2
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ cd <redacted>/rpmbuild/BUILD
+ rm -rf atomic-openshift-odo-rpm-1.0.0test-1
+ /usr/bin/gzip -dc <redacted>/rpmbuild/SOURCES/atomic-openshift-odo-rpm-1.0.0test-1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.qu8pom
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ export GITCOMMIT=af9f7aad
+ GITCOMMIT=af9f7aad
+ mkdir -p <redacted>/rpmbuild/BUILD/gocode/src/github.com/openshift
++ pwd
+ ln -s <redacted>/rpmbuild/BUILD/atomic-openshift-odo-rpm-1.0.0test-1 <redacted>/rpmbuild/BUILD/gocode/src/github.com/openshift/odo
+ export GOPATH=<redacted>/rpmbuild/BUILD/gocode
+ GOPATH=<redacted>/rpmbuild/BUILD/gocode
+ cd <redacted>/rpmbuild/BUILD/gocode/src/github.com/openshift/odo
+ make cross
./scripts/cross-compile.sh '-X github.com/openshift/odo/pkg/odo/cli/version.GITCOMMIT=af9f7aad'
Cross compiling linux-amd64 and placing binary at dist/bin/linux-amd64/
Cross compiling darwin-amd64 and placing binary at dist/bin/darwin-amd64/
Cross compiling windows-amd64 and placing binary at dist/bin/windows-amd64/
+ unlink <redacted>/rpmbuild/BUILD/gocode/src/github.com/openshift/odo
+ rm -rf <redacted>/rpmbuild/BUILD/gocode
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.LXf6xe
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ '[' <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64 '!=' / ']'
+ rm -rf <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
++ dirname <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
+ mkdir -p <redacted>/rpmbuild/BUILDROOT
+ mkdir <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ mkdir -p <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64//usr/bin
+ install -m 0755 dist/bin/linux-amd64/odo <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64//usr/bin/odo
+ mkdir -p <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share
+ install -d <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/linux <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/macos <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/windows
+ install -p -m 755 dist/bin/linux-amd64/odo <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/linux/odo-linux-amd64
+ install -p -m 755 dist/bin/darwin-amd64/odo <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/macos/odo-darwin-amd64
+ install -p -m 755 dist/bin/windows-amd64/odo.exe <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/windows/odo-windows-amd64.exe
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 1
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
Processing files: atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.ofGaOa
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ LICENSEDIR=<redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm
+ export LC_ALL=C
+ LC_ALL=C
+ export LICENSEDIR
+ /usr/bin/mkdir -p <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm
+ cp -pr LICENSE <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm
+ exit 0
warning: Missing build-id in <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/bin/odo
Provides: atomic-openshift-odo-rpm atomic-openshift-odo-rpm = 1.0.0test-1.fc29 atomic-openshift-odo-rpm(x86-64) = 1.0.0test-1.fc29
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit)
Obsoletes: atomic-openshift-odo-rpm
Processing files: atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.fi0as7
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ LICENSEDIR=<redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm-redistributable
+ export LC_ALL=C
+ LC_ALL=C
+ export LICENSEDIR
+ /usr/bin/mkdir -p <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm-redistributable
+ cp -pr LICENSE <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/licenses/atomic-openshift-odo-rpm-redistributable
+ exit 0
warning: Missing build-id in <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64/usr/share/atomic-openshift-odo-rpm/linux/odo-linux-amd64
Provides: atomic-openshift-odo-rpm-redistributable atomic-openshift-odo-rpm-redistributable = 1.0.0test-1.fc29 atomic-openshift-odo-rpm-redistributable(x86-64) = 1.0.0test-1.fc29
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit)
Obsoletes: atomic-openshift-odo-rpm-redistributable
Checking for unpackaged file(s): /usr/lib/rpm/check-files <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
Wrote: <redacted>/rpmbuild/SRPMS/atomic-openshift-odo-rpm-1.0.0test-1.fc29.src.rpm
Wrote: <redacted>/rpmbuild/RPMS/x86_64/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64.rpm
Wrote: <redacted>/rpmbuild/RPMS/x86_64/atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.sRPWj1
+ umask 022
+ cd <redacted>/rpmbuild/BUILD
+ cd atomic-openshift-odo-rpm-1.0.0test-1
+ /usr/bin/rm -rf <redacted>/rpmbuild/BUILDROOT/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64
+ exit 0

$ sudo dnf install ~/rpmbuild/RPMS/x86_64/atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64.rpm

Dependencies resolved.
====================================================================================================
 Package                         Architecture  Version                    Repository           Size
====================================================================================================
Installing:
 atomic-openshift-odo-rpm        x86_64        1.0.0test-1.fc29           @commandline        9.2 M

Transaction Summary
====================================================================================================
Install  1 Package

Total size: 9.2 M
Installed size: 46 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Installing       : atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64                           1/1 
  Verifying        : atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64                           1/1 

Installed:
  atomic-openshift-odo-rpm-1.0.0test-1.fc29.x86_64                                                  

Complete!

$ odo version
odo 1.0.0-test (af9f7aad)

$ sudo dnf install ~/rpmbuild/RPMS/x86_64/atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64.rpm
Last metadata expiration check: 0:11:57 ago on Tuesday 10 September 2019 02:48:43 PM IST.
Dependencies resolved.
====================================================================================================
 Package                                     Arch      Version                Repository       Size
====================================================================================================
Installing:
 atomic-openshift-odo-rpm-redistributable    x86_64    1.0.0test-1.fc29       @commandline     41 M

Transaction Summary
====================================================================================================
Install  1 Package

Total size: 41 M
Installed size: 152 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Installing       : atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64           1/1 
  Verifying        : atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64           1/1 

Installed:
  atomic-openshift-odo-rpm-redistributable-1.0.0test-1.fc29.x86_64                                  

Complete!

$  tree /usr/share/atomic-openshift-odo-rpm/
/usr/share/atomic-openshift-odo-rpm/
├── linux
│   └── odo-linux-amd64
├── macos
│   └── odo-darwin-amd64
└── windows
    └── odo-windows-amd64.exe

3 directories, 3 files

echo "Generating spec file $SPEC_DIR/atomic-openshift-odo-rpm.spec"
envsubst <rpms/atomic-openshift-odo-rpm.spec > $SPEC_DIR/atomic-openshift-odo-rpm.spec

echo "Generating taball $SOURCES_DIR/$NAME.tar.gz"
Copy link
Member

Choose a reason for hiding this comment

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

s/taball/tarball/

export ODO_RELEASE=${ODO_RELEASE:=1}
export GIT_COMMIT=${GIT_COMMIT:=`git rev-parse --short HEAD 2>/dev/null`}
export ODO_RPM_VERSION=${ODO_VERSION//-}

Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to print the values of ODO_VERSION, ODO_RELEASE, GIT_COMMIT and ODO_RPM_VERSION here as verification that the correct one are used

@kadel
Copy link
Member

kadel commented Sep 10, 2019

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Sep 10, 2019
@kadel
Copy link
Member

kadel commented Sep 10, 2019

/retest

[INFO] Acquiring a lease ...
failed to acquire a resource: Post http://boskos.ci/acquire?dest=leased&owner=ci-op-zbn3qcyk-bcc26&request_id=4993630242308893301&state=free&type=aws-quota-slice: dial tcp: lookup boskos.ci on 10.142.15.242:53: no such host
2019/09/10 14:48:05 Container lease in pod benchmark failed, exit code 1, reason Error
Another process exited
2019/09/10 14:48:05 Container setup in pod benchmark failed, exit code 1, reason Error
Another process exited
2019/09/10 14:48:05 Container test in pod benchmark failed, exit code 1, reason Error
2019/09/10 14:48:58 Ran for 35m34s
2019/09/10 14:49:00 Submitted failure event to sentry (id=f31297da9b7a45fc8ddad90b80fd072d)
error: could not run steps: step benchmark failed: template pod "benchmark" failed: the pod ci-op-zbn3qcyk/benchmark failed after 6m27s (failed containers: lease, setup, test): ContainerFailed one or more containers exited
Container lease exited with code 1, reason Error
---
[INFO] Acquiring a lease ...
failed to acquire a resource: Post http://boskos.ci/acquire?dest=leased&owner=ci-op-zbn3qcyk-bcc26&request_id=4993630242308893301&state=free&type=aws-quota-slice: dial tcp: lookup boskos.ci on 10.142.15.242:53: no such host
---
Container setup exited with code 1, reason Error
---
Another process exited
---
Container test exited with code 1, reason Error
---
Another process exited
---

@mohammedzee1000
Copy link
Contributor Author

CI is flaky
/retest

@dharmit
Copy link
Member

dharmit commented Sep 11, 2019

The rpm-local-build.sh script fails for me:

$ ./scripts/rpm-local-build.sh
Copying content to local rpmbuild
'dist/rpmbuild/SOURCES/atomic-openshift-odo-1.0.0test-1.tar.gz' -> '/home/dshah/rpmbuild/SOURCES/'
cp: cannot create regular file '/home/dshah/rpmbuild/SOURCES/': No such file or directory
'dist/rpmbuild/SPECS/atomic-openshift-odo.spec' -> '/home/dshah/rpmbuild/SPECS/'
cp: cannot create regular file '/home/dshah/rpmbuild/SPECS/': No such file or directory
Building locally
error: failed to stat /home/dshah/rpmbuild/SPECS/atomic-openshift-odo.spec: No such file or directory

$ ls ~/rpmbuild
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS

Am I missing something that needs to be done to build rpm as a normal Linux user?

Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

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

Few questions. LGTM otherwise.

echo "Making release for $NAME, git commit $GIT_COMMIT"

echo "Cleaning up old content"
if [[ -d $DIST_DIR ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Since we're doing an rm -rf, why do we even need the if checks in these two cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm makes sense as rm -rf never fails but still., it's better to check. file exists before any operation.

pushd $NAME
# Remove bin if it exists, we dont need it in tarball
if [[ -f ./odo ]]; then
rm -rf ./odo
Copy link
Member

Choose a reason for hiding this comment

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

Again, why have an if when we're doing rm -rf?

#this is a template spec and actual spec will be generated
#debuginfo not supported with Go
%global debug_package %{nil}
%global package_name atomic-openshift-odo
Copy link
Member

Choose a reason for hiding this comment

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

I have not reviewed any spec files in the past. Heck, I don't even understand them so please pardon me if the query is silly/naive.

Does this mean that yum install atomic-openshift-odo will install the odo binary for the users? If yes, out of sheer curiosity, why do we have atomic in the name?

If no, what does this mean? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not reviewed any spec files in the past. Heck, I don't even understand them so please pardon me if the query is silly/naive.

Does this mean that yum install atomic-openshift-odo will install the odo binary for the users? If yes, out of sheer curiosity, why do we have atomic in the name?

If no, what does this mean?

yes and no both. It is actually prefixed to package name
full name = package_name-odo_version-odo_release.dist.arch.rpm
the atomic-openshoft is rec prefix for all openshift packages

Choose a reason for hiding this comment

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

Does this mean that yum install atomic-openshift-odo will install the odo binary for the users?

Yes.

Its upto us to decide what we want to name, the naming discussions are always ..
but we can align to what's done for oc, oc is provided by openshift-clients RPM, which is a RPM of openshift package (multiple RPMs, part of one package).

Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that yum install atomic-openshift-odo will install the odo binary for the users?

Yes.

Its upto us to decide what we want to name, the naming discussions are always ..
but we can align to what's done for oc, oc is provided by openshift-clients RPM, which is a RPM of openshift package (multiple RPMs, part of one package).

Thanks @navidshaikh for the response. It helps. And I agree that naming discussions are always... I'm afraid I'm the one who's making it painful this time. 😂

@kadel @mohammedzee1000 do we really need atomic in the name of the rpm that provides odo binary? I feel that openshift-odo is good enough. I don't see why we want to connect this with Project Atomic which is, AFAIU, more about underlying container technologies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well @kadel i will leave final call to you. But i would require the decision at earliest as i will need to raise rcm ticket to set up a new brew package (removing old one in the process)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should not matter too much in my book as the rpm is for rcm satisfaction and the paper trail. We will be delivering it to other delivery mechanisms such as mirror / cdn / cli artifacts image and a few mad red hatters who might want the rhel rpm :P

Most devs will not be developing on rhel to care about the directly delivery of rpm

Copy link
Member

Choose a reason for hiding this comment

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

If it is possible I would drop the atomic prefix.

@dharmit
Copy link
Member

dharmit commented Sep 11, 2019

The rpm-local-build.sh script fails for me:

$ ./scripts/rpm-local-build.sh
Copying content to local rpmbuild
'dist/rpmbuild/SOURCES/atomic-openshift-odo-1.0.0test-1.tar.gz' -> '/home/dshah/rpmbuild/SOURCES/'
cp: cannot create regular file '/home/dshah/rpmbuild/SOURCES/': No such file or directory
'dist/rpmbuild/SPECS/atomic-openshift-odo.spec' -> '/home/dshah/rpmbuild/SPECS/'
cp: cannot create regular file '/home/dshah/rpmbuild/SPECS/': No such file or directory
Building locally
error: failed to stat /home/dshah/rpmbuild/SPECS/atomic-openshift-odo.spec: No such file or directory

$ ls ~/rpmbuild
BUILD  BUILDROOT  RPMS  SOURCES  SPECS  SRPMS

Am I missing something that needs to be done to build rpm as a normal Linux user?

I think this was happening because cp was aliased to cp -i on my setup. But I'm assuming that #/usr/bin/env bash should have taken care of it and not used the settings on my zsh shell, no?

@kadel
Copy link
Member

kadel commented Sep 11, 2019

/retest

[odo]  ✗  Failed To Update Config To Component Deployed

#1981

install -d %{buildroot}%{_datadir}/%{name}/{linux,macos,windows}
install -p -m 755 dist/bin/linux-amd64/odo %{buildroot}%{_datadir}/%{name}/linux/odo-linux-amd64
install -p -m 755 dist/bin/darwin-amd64/odo %{buildroot}%{_datadir}/%{name}/macos/odo-darwin-amd64
install -p -m 755 dist/bin/windows-amd64/odo.exe %{buildroot}%{_datadir}/%{name}/windows/odo-windows-amd64.exe

Choose a reason for hiding this comment

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

For following 4 lines

install -d %{buildroot}%{_datadir}/%{name}/{linux,macos,windows}
install -p -m 755 dist/bin/linux-amd64/odo %{buildroot}%{_datadir}/%{name}/linux/odo-linux-amd64
install -p -m 755 dist/bin/darwin-amd64/odo %{buildroot}%{_datadir}/%{name}/macos/odo-darwin-amd64
install -p -m 755 dist/bin/windows-amd64/odo.exe %{buildroot}%{_datadir}/%{name}/windows/odo-windows-amd64.exe

I'd use the name %{name}-redistributable to align with -redistributable RPM.
If we change this as suggested, respective change needs to be done in %files section too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok will take care of that, thanks

rm -rf ./odo
fi
# Replace version info
sed -i "s/v[0-9]*.[0-9]*.[0-9]*-\w*/"${ODO_VERSION}"/g" pkg/odo/cli/version/version.go
Copy link
Member

Choose a reason for hiding this comment

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

this should not be edited here.
The version change should be committed into the git repo before the build is triggered

Choose a reason for hiding this comment

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

instead it should be inserted via ldflags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 In fact ldflags is the best route forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok removed we should document this fact though, that at the very least the file be edited before running script

Choose a reason for hiding this comment

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

if it has to edit manually, its better done in this script (avoids building without updating the version) and update the script later when ldflags are in place

Copy link
Member

Choose a reason for hiding this comment

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

The main thing is that the update to the version.go should be committed to the git to have a record of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be good to have a version file then with all necessary information. Any changes get committed to version file and then scripts take care of replacement be it via sed or ldflags or in the RPM spec file. That way we have commits on record at same time taking advantage of automation so nothing is missed, wdyt

@mohammedzee1000
Copy link
Contributor Author

Seems to be some issue related to accessing github

# cd .; git clone https://github.com/onsi/ginkgo /go/src/github.com/onsi/ginkgo
fatal: unable to access 'https://github.com/onsi/ginkgo/': Could not resolve host: github.com; Unknown error
package github.com/onsi/ginkgo/ginkgo: exit status 128

/retest

@dharmit
Copy link
Member

dharmit commented Sep 19, 2019

@mohammedzee1000 can you please drop the atomic prefix #2107 (comment) unless there's a reason to absolutely have it?

cc @kadel

@mohammedzee1000
Copy link
Contributor Author

RCM ticket raised to update brew target
https://projects.engineering.redhat.com/browse/RCM-66285
Will update once that get done

@mohammedzee1000
Copy link
Contributor Author

RCM ticket is being serviced and should close soon. It should be safe to move forward

Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Sep 20, 2019
@openshift-merge-robot openshift-merge-robot merged commit 567ad81 into redhat-developer:master Sep 20, 2019
@rm3l rm3l added the estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants