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

Bug: Files with names like "$.a-function.js" can't be packaged #20

Closed
sshobotov opened this issue Oct 15, 2015 · 13 comments · Fixed by #25
Closed

Bug: Files with names like "$.a-function.js" can't be packaged #20

sshobotov opened this issue Oct 15, 2015 · 13 comments · Fixed by #25

Comments

@sshobotov
Copy link

File names should be transformed for safe use in https://github.com/jamesdbloom/grunt-debian-package/blob/master/tasks/debian_package.js#L35 expression.

Such trouble could occur if you use babel-core.

@mheiniger
Copy link

Like those files here: https://github.com/zloirock/core-js/tree/master/library/modules
They will be translated from $.a-function.js to a-function.js and makes the copy command searching for a non-existing file.

@gsikorski
Copy link

@jamesbloomnektan Could you please publish new version to NPM?

@jamesdbloom
Copy link
Owner

The build is failing but only in docker as follows:

module.js:472
    throw err;
    ^

Error: Cannot find module 'findup-sync'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/grunt-cli/bin/grunt:8:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
dmesg: read kernel buffer failed: Operation not permitted

Right now I don't have time to look into resolving this issue but I have added a script to the build that will reproduce this ./scripts/local_docker_build.sh. If you can look into the issue and either raise a PR or let me know the problem so I can easily fix it (as you prefer) then I'm happy to do a release. I don't want to do a release until the build is passing again.

@jamesdbloom jamesdbloom reopened this Apr 12, 2018
@gsikorski
Copy link

@jamesbloomnektan hmm, I doubt it is related to the change. I run the tests successfully on the docker image from docker file below:

FROM ubuntu:16.04
RUN apt-get autoclean -y
RUN apt-get update -y
RUN apt-get install --fix-missing -y curl nodejs npm
RUN npm i -g n
RUN n 8.10.0
RUN npm i -g npm
RUN npm i -g grunt-cli
COPY ./grunt-debian-package /gdp
WORKDIR /gdp
RUN npm i
RUN grunt

Here is the output:

Sending build context to Docker daemon 71.58 MB
Step 1/12 : FROM ubuntu:16.04
 ---> f975c5035748
Step 2/12 : RUN apt-get autoclean -y
 ---> Using cache
 ---> a990cc0fa9a2
Step 3/12 : RUN apt-get update -y
 ---> Using cache
 ---> 2d4c8e98e90f
Step 4/12 : RUN apt-get install --fix-missing -y curl nodejs npm
 ---> Using cache
 ---> 81a5adb4c854
Step 5/12 : RUN npm i -g n
 ---> Using cache
 ---> 6bd0a6219014
Step 6/12 : RUN n 8.10.0
 ---> Using cache
 ---> dee0145710f8
Step 7/12 : RUN npm i -g npm
 ---> Using cache
 ---> 293d878da891
Step 8/12 : RUN npm i -g grunt-cli
 ---> Using cache
 ---> 24163efdb0ca
Step 9/12 : COPY ./grunt-debian-package /gdp
 ---> Using cache
 ---> 3b16d000a301
Step 10/12 : WORKDIR /gdp
 ---> Using cache
 ---> 36bb8e5d6bba
Step 11/12 : RUN npm i
 ---> Using cache
 ---> 9d183a429a62
Step 12/12 : RUN grunt
 ---> Running in f63b16735efd
Running "jshint:all" (jshint) task
>> 9 files lint free.

Running "clean:pre_test" (clean) task
>> 0 paths cleaned.

Running "debian_package:default_options" (debian_package) task

Running "debian_package:custom_options" (debian_package) task

Running "nodeunit:unit" (nodeunit) task

fileOrDirectory_test.js
fileOfDirectory_test
    delete
        should delete existing file (pass)
        should delete existing empty directory (pass)
        should delete existing directory containing files (pass)
    copy
        should copy directory and its containing files (pass)

options_test.js
options_test
    endsWith string extension function
        should match correct trailing substring (pass)
        should not-match incorrect trailing substring (pass)
    option validation
        should display errors for empty options (pass)
        should display no errors for correct options (pass)
        should display when maintainer details not provided (pass)

replace_test.js
replace_test
    replaceAll string extension function
        should replace all basic string matches in string (pass)
        should replace all regex matches in string (pass)
        should not replace non-matching sub-strings (pass)
    replace in multiple files
        replace string multiple times in single file (pass)
        replace string multiple times in multiple files (pass)

OK: 59 assertions (125ms)

Running "nodeunit:integration" (nodeunit) task

debian_package_test.js
debian_package
    default_options (pass)
    custom_options (pass)

OK: 19 assertions (5ms)

Running "clean:post_test" (clean) task
>> 3 paths cleaned.

Done.
 ---> d402b28439f6
Removing intermediate container f63b16735efd
Successfully built d402b28439f6

@jamesdbloom
Copy link
Owner

I totally agree its not related to the change, but it is causing the build to fail, so its hard to do a release.

@gsikorski
Copy link

I am not familiar with your build system, you likely need to upgrade it. Maybe you are using old NodeJS/grunt, etc. I have no access to check this.

@jamesdbloom
Copy link
Owner

The build just runs the script ./scripts/local_docker_build.sh and does nothing else.

Everything in the build is fully self contained within a container docker so the build server has nothing installed on it.

#!/usr/bin/env bash

docker pull jamesdbloom/mockserver:grunt
docker run -v `pwd`:/mockserver -w /mockserver -a stdout -a stderr jamesdbloom/mockserver:grunt /mockserver/scripts/local_quick_build.sh

@jamesdbloom
Copy link
Owner

when I get a chance I'll look into this but it may be a few days at least

@gsikorski
Copy link

#26 should fix your CI problems. It also cleans up docker initialisation.

@gsikorski
Copy link

@jamesdbloom Any chance for the release anytime soon?

@jamesdbloom
Copy link
Owner

now released

@sshobotov
Copy link
Author

sshobotov commented Apr 23, 2018 via email

@jamesdbloom
Copy link
Owner

@sshobotov I think you are the only person who can do that via your github account, by turning off notifications for this issue / repository .

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 a pull request may close this issue.

4 participants