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

Add Makefile #3789

Merged
merged 1 commit into from
Jul 31, 2021
Merged

Add Makefile #3789

merged 1 commit into from
Jul 31, 2021

Conversation

mjethani
Copy link
Contributor

@gorhill gorhill merged commit 43e7785 into gorhill:master Jul 31, 2021
@mjethani mjethani deleted the makefile branch July 31, 2021 12:53
@gorhill
Copy link
Owner

gorhill commented Jul 31, 2021

@mjethani

The command make ./node_modules/uBO-snfe in cliqz repo fails on my side. I get the following error:

npm install dist/build/uBlock0.nodejs.tgz --no-save
npm ERR! code ENOPACKAGEJSON

When I look at the content of dist/build/uBlock0.nodejs.tgz, the root directory is dist, hence I guess why npm complain of not finding package.json.

@mjethani
Copy link
Contributor Author

… the root directory is dist

This is why I have --strip-components 2 as an option to tar. Maybe it doesn't work on Linux too? Because everything I've tested is on macOS.

@gorhill
Copy link
Owner

gorhill commented Jul 31, 2021

I changed to the following on my side and this worked:

dist/build/uBlock0.nodejs.tgz: dist/build/uBlock0.nodejs
    tar -C ./dist/build -czf dist/build/uBlock0.nodejs.tgz uBlock0.nodejs

Does this work for you?

@gorhill
Copy link
Owner

gorhill commented Jul 31, 2021

Another issue with the benchmark is that on my side I need to replace:

const modulePromise = import('ubo-snfe');

With

const modulePromise = import('uBO-snfe');

For it to run successfully.

@mjethani
Copy link
Contributor Author

Does this work for you?

It works.

Maybe the most portable iscd dist/build && tar czf uBlock0.nodejs.tgz.

Another issue with the benchmark is …

That makes sense, my filesystem is case-insensitive. In that case, could you submit a patch?

gorhill added a commit that referenced this pull request Jul 31, 2021
@gorhill
Copy link
Owner

gorhill commented Jul 31, 2021

could you submit a patch?

Sure but that will have to wait for tomorrow on my side. Feel fee to submit if you feel for it.

@mjethani
Copy link
Contributor Author

Package names must be lowercase:

You can't create new packages with upper-case letters in the name any more, but packages with upper-case letters in their names are still in the registry and still in use.

Let me submit patches to fix this is both places.

@gorhill
Copy link
Owner

gorhill commented Aug 3, 2021

@mjethani

Is the following modification ok or is there a better way to accomplish this?

dist/build/uBlock0.nodejs: tools/make-nodejs.sh $(sources) $(platform) $(assets)
	tools/make-nodejs.sh

I modified the content of tools/make-nodejs.sh just to add a few more js files for the sake of testing them for eslint warnings, but since the target is not dependent on the script itself used to build them, I had to use -B to force a built. Adding a dependency on the build script would fix this.

@mjethani
Copy link
Contributor Author

mjethani commented Aug 3, 2021

Adding a dependency on the build script would fix this.

I think this makes sense.

@mjethani
Copy link
Contributor Author

mjethani commented Aug 3, 2021

If you do it though it's best to do it for Chromium and Firefox too.

gorhill added a commit that referenced this pull request Aug 3, 2021
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