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

WIP: Windows support -- depends on Meson build system (#3160) #3185

wants to merge 169 commits into from


Copy link

@Ericson2314 Ericson2314 commented Oct 31, 2019

Credits to @volth and @p01arst0rm for doing the real work. I just fixed some merge conflicts, fixed linux regressions, and unified the build systems. [Will delete @volth's temporary build system once I can get things building with]

The history is....wild, but if someone want's that fixed, I don't think it's worth fixing until this is closer to being ready.

ivan and others added 30 commits Aug 30, 2018
It's all dead code since 2014 (commit 0c6d62c).

(cherry picked from commit 458282b)
Dead code since NixOS/nixpkgs@6669a3b

(cherry picked from commit 2894197)
This reverts commit d277442.

Make sucks.

(cherry picked from commit c651b7b)
(cherry picked from commit 64d7d1a)
This reduces the size of the closure by 45 MiB.

(cherry picked from commit 145db70)
(cherry picked from commit 5e83b02)
(cherry picked from commit 4143977)
The profile present in PATH is not necessarily the actual profile
location. User profiles are generally added as $HOME/.nix-profile
in which case the indirect profile link needs to be resolved first.

/home/user/.nix-profile -> /nix/var/nix/profiles/per-user/user/profile
/nix/var/nix/profiles/per-user/user/profile -> profile-15-link
/nix/var/nix/profiles/per-user/user/profile-14-link -> /nix/store/hyi4kkjh3bwi2z3wfljrkfymz9904h62-user-environment
/nix/var/nix/profiles/per-user/user/profile-15-link -> /nix/store/6njpl3qvihz46vj911pwx7hfcvwhifl9-user-environment

To upgrade nix here we want /nix/var/nix/profiles/per-user/user/profile-16-link
instead of /home/user/.nix-profile-1-link. The latter is not a gcroot
and would be garbage collected, resulting in a broken profile.

Fixes NixOS#2175

(cherry picked from commit d85bb48)
(cherry picked from commit 264e66f)

  $ nix upgrade-nix
  error: directory '/home/eelco/Dev/nix/inst/bin' does not appear to be part of a Nix profile

instead of

  $ nix upgrade-nix
  error: '/home/eelco/Dev/nix/inst' is not a symlink

(cherry picked from commit f08b14c)

Also some cosmetic improvements.

(cherry picked from commit 39f1722)
shell.nix defines the install prefix as $(pwd)/inst

(cherry picked from commit 8ad2def)
Maybe there is a better place to document this, which is more generic?

(cherry picked from commit 33712fe)
(cherry picked from commit 2df21b7)
(cherry picked from commit 149d10c)
(cherry picked from commit 4095cd6)
Fixes NixOS#2390.

(cherry picked from commit b7409c5)
This is already done by coerceToString(), provided that the argument
is a path (e.g. 'fetchGit ./bla'). It fixes the handling of URLs like It breaks 'fetchGit "./bla"', but that
was never intended to work anyway and is inconsistent with other
builtin functions (e.g. 'readFile "./bla"' fails).

(cherry picked from commit 475a0a5)
(cherry picked from commit f66fa7c)
Use sh <(...) syntax for installation to preserve stdin and prompting

also update installation docs to account for changes in multi-user selection

(cherry picked from commit c3e508d)
(cherry picked from commit 51f9682)
…t selected for Linux with systemd, and the bug about selinux

(cherry picked from commit 4be7652)
(cherry picked from commit c42eaaf)
Copy link
Member Author

@Ericson2314 Ericson2314 commented Nov 11, 2019

@volth What did you get for libbacktrace with MinGW, that is the one thing I see, but no pkg-config file so doesn't really match what you wrote.

Ericson2314 added 8 commits Nov 11, 2019
This is needed when cross compiling, and good practice in native builds
too to ensure developers don't accidentally use newer stuff.
This partially reverts commit 986f28a.
I'll try to fix this upstream so we can revert this commit.
Ensure no linux regressions!
Needs the gccpp lib, which the pkg-config file doesn't mention.
Copy link
Member Author

@Ericson2314 Ericson2314 commented Nov 12, 2019

BOOST_STACKTRACE_USE_BACKTRACE in src/libutil/ I just commented that out for now.

In other news, it builds!! Will push very shortly. NixOS/nixpkgs#73265 is the real secret sauce.

Ericson2314 added 2 commits Nov 12, 2019
Meson should get mesonbuild/meson#106 fixed so
that we don't have to manually propogate the public dep.
Copy link
Member Author

@Ericson2314 Ericson2314 commented Nov 12, 2019

OK build instructions

  1. NixOS/nixpkgs#73265 wait for that to hit nixos-19.09 or switch to release-19.09.
  2. Comment out git and mercurial in release-common.nix. They are bringing in python2 which is confusing meson, something I need to fix in nixpkgs.
  3. Do a nix-shell for now, I haven't tested other things.
  4. Add -Ddefault_library=static to mesonFlags so you do static builds, since we have no dllimport/dllexport and putting those in too soon will just cause merge hell.
  5. Run mesonConfigurePhase so that the cross file is passed in.
  6. ninja -j<N>

Of course, I hope to automate all of this away.

Meson works fine with MinGW, and will work fine with MSVC, if only I
could finish building all the deps to prove it.
Copy link

@p01arst0rm p01arst0rm commented Nov 12, 2019

nice work :)

Copy link
Member Author

@Ericson2314 Ericson2314 commented Oct 30, 2020

Yes, that's a good idea. Also, I think I should close this one until something more up to date is ready :).

Copy link

@p01arst0rm p01arst0rm commented Nov 5, 2020

Yes, that's a good idea. Also, I think I should close this one until something more up to date is ready :).

is this in regards to the meson port? are you waiting for it to be brought up to latest ?

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

Successfully merging this pull request may close these issues.

None yet