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

Build does not pack all files #14

Closed
coogor opened this issue Mar 22, 2017 · 22 comments
Closed

Build does not pack all files #14

coogor opened this issue Mar 22, 2017 · 22 comments

Comments

@coogor
Copy link

coogor commented Mar 22, 2017

Did not change the spec file on OBS, but recently I noticed that the rpm contains only directories bower_components and node_modules, but not the other files (index.html etc) of the source package.
Affects all builds of tryton-sao

@marguerite
Copy link
Owner

@coogor

Hi, I didn't push the new release yet...so the problem lays in the old version.

I am refactoring nodejs-fixdep and nodejs-symlink-deps (the only two files left)...so I think a new version should be available for testing before this weekend.

BTW, tryton-sao and npm are the two modules I used for testing. I'll check if this problem still happens in the refactored version and report back.

@coogor
Copy link
Author

coogor commented Mar 22, 2017

Thanks!

@marguerite
Copy link
Owner

marguerite commented Mar 26, 2017

@coogor @illuusio @hurricanehrndz

Hi, the latest available for testing is at https://build.opensuse.org/project/show/home:MargueriteSu:nodejs

you can make your own testing prj, in its meta file, use trick like this:

    <repository name="openSUSE_Leap_42.2">
      <path project="home:MargueriteSu:nodejs" repository="openSUSE_Leap_42.2"/>
      <path project="openSUSE:Leap:42.2" repository="standard"/>
      <arch>x86_64</arch>
    </repository>

to have the latest nodejs-packaging.

NOTE:

because the .json is changed in format, you have to reproduce the json...eg:

    sudo zypper in ruby2.3-rubygem-node2rpm
    osc co home:yourname:nodejs
    osc mkpac jscs
    node2rpm -m jscs ( see node2rpm --help )

feel free to open any issue you met...

because I don't know your personal projects. I will massively test against the existing ones in devel:languages:nodejs like jscs...

Greetings

Marguerite

@marguerite
Copy link
Owner

There's no transfer from old .json to the new .json. the new json format contains more information like license, version, parents so no way to add those to the old jsons. but as it is automatic...generating a new one is not that unfriendly/hard I suppose 😅

@illuusio
Copy link

Thanks for update.. testing it now and run these problems:

    nodejs6 is needed by zxcvbn-cli-1.0.6-0.x86_64
    nodejs-rpm-macros is needed by zxcvbn-cli-1.0.6-0.x86_64

Is nodejs6 current nodejs (Should it be just nodejs) and can't find nodejs-rpm-macros which is nodejs-packaging is suppose but doesn't provide such dependency.

@marguerite
Copy link
Owner

@illuusio

Hello, there's also nodejs7 in tumbleweed. I asked adamm, the SUSE maintainer for nodejs, he told me those are not co-existentable

So it depends on yourself to select the best suitable nodejs version. and maybe also define it in repo's proj file with Prefer.

Actually my tool doesn't require any nodejs theoretically. Because it is written in ruby.

The only case it requires nodejs will be when you want to build nodejs C bindings (node-gyp). All those stuff (nodejs-devel, npm, gcc-c++, python) are required under that case only.

So if you like, I can also fix it the other way. But it will be yourself to manually add such buildrequires when needed.

So what do you think?

@illuusio
Copy link

but where to find 'nodejs-rpm-macros'? is it a something that doesnt exist or something i need to get somewhere?

@marguerite
Copy link
Owner

@illuusio

Provides: nodejs-rpm-macros

it's currently provided by the nodejs-packaging in home:MargueriteSu:nodejs

@coogor
Copy link
Author

coogor commented Jul 4, 2017

I'm currently testing this for Leap 42.3, and still run into the same issue.
As 42.3 is not a build target, I added your above branch into the prjconf. but still encounter missing dependencies (nothing provides rubygem(ruby:2.1.0:mini_portile2:2.2) >= 2.2 needed by ruby2.1-rubygem-nokogir). Any plans to update? Thanks!

@coogor
Copy link
Author

coogor commented Jul 12, 2017

I have now build against your above repo https://build.opensuse.org/project/show/home:MargueriteSu:nodejs
Following build error occurs:
[ 34s] + cd /home/abuild/rpmbuild/BUILD
[ 34s] + node2rpm-server --prep
[ 34s] /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/dependency.rb:51:in block in parse_tag': undefined method strip!' for nil:NilClass (NoMethodError)
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/dependency.rb:48:in each' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/dependency.rb:48:in parse_tag'
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/dependency.rb:12:in parse' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/parser.rb:51:in fill_dependency'
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/parser.rb:18:in block in parse' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/parser.rb:18:in each'
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/rpmspec-1.0.0/lib/rpmspec/parser.rb:18:in parse' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/node2rpm-1.0.0/lib/node2rpm/system.rb:32:in buildroot'
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/node2rpm-1.0.0/lib/node2rpm/system.rb:27:in buildroot' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/node2rpm-1.0.0/lib/node2rpm/server.rb:9:in initialize'
[ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/node2rpm-1.0.0/bin/node2rpm-server:7:in new' [ 34s] from /usr/lib64/ruby/gems/2.1.0/gems/node2rpm-1.0.0/bin/node2rpm-server:7:in <top (required)>'
[ 34s] from /usr/bin/node2rpm-server:23:in load' [ 34s] from /usr/bin/node2rpm-server:23:in

'
[ 34s] error: Bad exit status from /var/tmp/rpm-tmp.0hTWqB (%prep)

@marguerite
Copy link
Owner

@coogor Hi, I am back and I will fix it tomorrow

@marguerite
Copy link
Owner

@coogor looks like you didn't use the generated specfile from node2rpm because your current specfile contains some customizations. then rpmspec gem don't know how to deal with that. but anyway I'll modify the gem to satisfy your current specfile :-)

@coogor
Copy link
Author

coogor commented Aug 8, 2017

You mean the name-version tag in
Source2: http://registry.npmjs.org/tryton-sao/-/%{name}-%{version}.tgz ?
That eases life when maintaining the 600+ packages in Application:ERP:Tryton....
AFAIK it was working beforehand, so I did not notice that this might be the problem...

@marguerite
Copy link
Owner

you didn't make anything wrong. It's my duty to make the parser strong enough.

@marguerite
Copy link
Owner

@coogor

Hi, I made a few commits and now tryton-sao builds.

Now the filelist created by nodejs-packaging is located at builddir/tryton-sao.list, so you have to replace %files -f %{_sourcedir}/files.lst with %files -f %{name}.list. Or you can only see the directories packaged without anything.

@coogor
Copy link
Author

coogor commented Aug 10, 2017

Excellent, cant wait to test! Current nodejs-packaging in https://build.opensuse.org/package/show/home:MargueriteSu:nodejs/nodejs-packaging does not reflect the change so far?

@marguerite
Copy link
Owner

@coogor

those commits have already landed in home:MargueriteSu:nodejs before I comment here:-)

@coogor
Copy link
Author

coogor commented Aug 12, 2017

I checked the builds, but files in /usr/lib/node-modules/tryton-sao still missing :-(

@marguerite
Copy link
Owner

@coogor

You didn't update the .json file. it's still version 4.2.0. but you have uploaded 4.2.6 source.

node2rpm is json based, so if it can't find 4.2.0, it will not copy anything.

maybe I should raise an error for this case.

and please repackage bower_components.tar.gz to bower_components.tgz.

@coogor
Copy link
Author

coogor commented Aug 15, 2017

Ah, thanks for the hint! Did not have the .json file on he radar....
I now receive an error in ruby again:

[ 20s] + cd /home/abuild/rpmbuild/BUILD
[ 20s] + node2rpm-server --mkdir
[ 20s] /usr/lib64/ruby/gems/2.2.0/gems/node2rpm-1.0.0/lib/node2rpm/server.rb:47:in join': no implicit conversion of nil into String (TypeError) [ 20s] from /usr/lib64/ruby/gems/2.2.0/gems/node2rpm-1.0.0/lib/node2rpm/server.rb:47:in block in mkdir'
[ 20s] from /usr/lib64/ruby/gems/2.2.0/gems/node2rpm-1.0.0/lib/node2rpm/server.rb:45:in glob' [ 20s] from /usr/lib64/ruby/gems/2.2.0/gems/node2rpm-1.0.0/lib/node2rpm/server.rb:45:in mkdir'
[ 20s] from /usr/lib64/ruby/gems/2.2.0/gems/node2rpm-1.0.0/bin/node2rpm-server:13:in <top (required)>' [ 20s] from /usr/bin/node2rpm-server:23:in load'
[ 20s] from /usr/bin/node2rpm-server:23:in `

'

@marguerite
Copy link
Owner

@coogor

it was caused by my bower-related codes.

after I fixed it, another error jumped.

It turned out to be the directory hierarchy incompatibility between the old 'bower_components.tar.gz' and the new '.tgz'

So I added some backward compatibility for node2rpm today.

But finally I realized you didnt change the obs working directory from the old nodejs-packaging to the new one.

Maybe you just uploaded newer 'tryton-sao-%{version}.tgz' and left other things unchanged.

It will fail for sure. Because bower_components' content, that is the modules in bower.json, also changed among releases.

So I just ran 'node2rpm -m tryton-sao -v 4.2.6' for you (see my obs SR)

Now it builds and succeeds. I recommend you to do such things for 3.8, 4.0 and 4.4.

And 3 jobs left for me to prevent such tragedies from happening in the future:-)

  1. a check if the source file match the json version
  2. a check if bower_components are different with the bower.json
  3. finish the compatibility for the old directory hierarchy of bower_components.tgz

@marguerite
Copy link
Owner

The above jobs mentioned are done in [rubygem-node2rpm](https://github.com/marguerite/ruby gen-node2rpm), closed #14.

If you meet an error like this:

    Checking bower_components' consistency 
    Mis-matched keys: ['tether']
    Mis-matched versions: {}

It means your bower_components.tgz is not consistent.

The components themselves may include a bower.json that brings new bower components, which was not handled by node2rpm before. So you have to run 'node2rpm -m tryton -v 4.2.6' with latest node2rpm or put a rightly versioned 'tether' into bower_components.tgz by yourself.

There is a similar check for the generated json too. It compares the package names and versions in the json with the sources. It will be helpful when you forget to upload new sources. If everything is correct, you will just see 'Passed: module' messages.

Marguerite

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

No branches or pull requests

3 participants