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

iosevka: 1.4.3 -> 2.3.0 #68820

Merged
merged 2 commits into from Sep 18, 2019
Merged

iosevka: 1.4.3 -> 2.3.0 #68820

merged 2 commits into from Sep 18, 2019

Conversation

babariviere
Copy link
Member

Integrate new Iosevka build system.
Add an extra arguments to add custom parameters (for example to map ligatures).

Motivation for this change

I want to build my Iosevka variant with version >=2.0.0.

Things done

This PR adds support for the new build system (makefile as been removed).
It basically convert config into a toml file (private-build-plans.toml) and build it via npm run build.
Only ttf font is built (as it was the only installed in version 1.4.3).

Optional parameters can be passed into 'parameters.toml' (example can be found in the Iosevka repository).

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @cstrahan @jfrankenau @ttuegel

Integrate new Iosevka build system.
Add an extra arguments to add custom parameters (for example to map ligatures).
Use node2nix instead of reading package lock.
@ofborg ofborg bot requested a review from ttuegel September 15, 2019 17:54
@ttuegel
Copy link
Member

ttuegel commented Sep 15, 2019

node-packages-generated.nix is more than 4,000 lines of generated code; that is much worse than only including the package-lock.json!

@babariviere
Copy link
Member Author

babariviere commented Sep 17, 2019

Only possible (in my knowledge) are:

  • keep the old package-json.lock
  • generate node packages for Iosevka only
  • generate node packages globally (in pkgs/development/node-packages)

What do you think is the best option ? I think the third one might be the best one but adding this much packages to node-packages might be an issue.

EDIT: It looks like it's harder to implement too. (we need to find which dependencies need to be copied, apart from the one specified in the package.json)

@ttuegel
Copy link
Member

ttuegel commented Sep 18, 2019

I think the third one might be the best one but adding this much packages to node-packages might be an issue.

I tried to do this locally, it wasn't hard to add it to the global nodePackages set, but I can't figure out how to override the generated package (to build the font) without breaking the build. I'm in favor of keeping the generated file until someone complains, because at least it works.

@ttuegel ttuegel merged commit 86db1ec into NixOS:master Sep 18, 2019
@ttuegel
Copy link
Member

ttuegel commented Sep 18, 2019

Thanks!

@babariviere
Copy link
Member Author

Thanks too !

@babariviere babariviere deleted the iosevka-2.0 branch September 18, 2019 13:04
@hlolli
Copy link
Member

hlolli commented Sep 22, 2019

As far as I understand, there should only be one generated node file in nixpkgs. This is too big and too many duplicates between that generated node file and the one in nodeModules.

@babariviere
Copy link
Member Author

Yes, this seems to be one of the problem with node packages. It's too difficult to use one global generated node-packages.nix as you can't import all dependencies (you have to do it manually)

@hlolli
Copy link
Member

hlolli commented Sep 22, 2019

You could take the vector it pkgs/data/fonts/iosevka/node-packages.json and turn it into a package.json, then you can symlink the node_modules directory

ln -s ${nodePackages."yourPackageName"}/lib/node_modules/yourPackageName/node_modules ./node_modules

@babariviere
Copy link
Member Author

Oh I see. I didn't know that. Maybe you could specify it for the new PR: #69219 ? It aims to clean the package

@rileyinman
Copy link
Contributor

rileyinman commented Sep 22, 2019

@hlolli The issue with doing it that way is Iosevka uses dev dependencies to build, so node2nix would have to be run in dev mode on the global nodeModules file. I commented on svanderburg/node2nix#149 about this, but I'm not sure if there's a better way right now.

@hlolli
Copy link
Member

hlolli commented Sep 22, 2019

I think adding devDependencies is the wrong way to go. Because then we would also adding hot-reloaders and stuff unrelated to the build (and runtime) of the application. I Think rather that the dependencies should be extanded, so that we as package maintainers add the packages manually which we need to build. This I did with lumoBuildDeps using hand-made package.json. It's already taking 15 minutes to generate the node-packages, but I don't see a better way to combine small size and fast generation time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants