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

Allow to build for non-systemd systems #1666

Closed

Conversation

hasufell
Copy link
Contributor

@hasufell hasufell commented Aug 11, 2020

This will disable systemd integration for all cabal users,
but fixes #1200.

There are two other ways to fix this:

  • provide a hackage overlay, which contains lobemo-scribe-systemd
    only or all 3rdparty packages and then add that overlay to
    cabal.project (downside: stack doesn't seem to be able to use
    hackage overlays)
  • provide 2 cabal.project files and let user choose via e.g.:
    --project-file=cabal.project.nosystemd
    (downside: maintaining yet another file)

Edit: third option could be to document for non-systemd users how to edit cabal.project, but I guess that's a bit awkward?

This will disable systemd integration for all cabal users,
but fixes IntersectMBO#1200.

There are two other ways to fix this:

* provide a hackage overlay, which contains lobemo-scribe-systemd
  only or all 3rdparty packages and then add that overlay to
  cabal.project (downside: stack doesn't seem to be able to use
  hackage overlays)
* provide 2 cabal.project files and let user choose via e.g.:
  --project-file=cabal.project.nosystemd
  (downside: maintaining yet another file)
Copy link
Contributor

@erikd erikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution is not acceptable because it disables systemd for all cabal users. IOHK"s devops currently rely on this and they run the current core nodes, so they are pretty important.

Unfortunatley, the other options are also rather sub optimal.

What about supplying a simple shell script that reads in the current cabal.project file and spits out cabal.project.nosystemd . This script would live in the scripts/ directory and with a little extra documentation would have a very high probability to avoid bit rot and should just DoTheRightThing (tm).

@hasufell
Copy link
Contributor Author

That's certainly an option. What about providing a hackage overlay? I find that an interesting idea in general and would be eager to look into it. But it will add more steps to release cycle.

@rvl
Copy link
Contributor

rvl commented Aug 17, 2020

@hasufell Why do you need to disable systemd anyway?
You can just install the systemd development package for your Linux distribution and then the cabal build will succeed.
If you have religious objections to systemd, there is always cabal.project.local.

@hasufell
Copy link
Contributor Author

hasufell commented Aug 17, 2020

You can just install the systemd development package for your Linux distribution and then the cabal build will succeed.

  1. not all distros have systemd: https://pkgs.alpinelinux.org/packages?name=systemd&branch=edge
  2. on some distros you cannot have eudev and systemd installed at the same time, because they are both udev providers: https://gitlab.exherbo.org/exherbo/arbor/-/blob/aec8e96ed61483f92995680ad0e3b414934fee0a/packages/sys-apps/eudev/eudev.exlib#L34
  3. disabling systemd is already explicitly supported, this PR just deals with a cabal bug

If you have religious objections to systemd, there is always cabal.project.local.

That doesn't work, as discussed in this PR, because of #1200 and haskell/cabal#5444

@disassembler
Copy link
Contributor

That doesn't work, as discussed in this PR, because of #1200 and haskell/cabal#5444

This seems to me like an issue that should be fixed upstream.

@hasufell
Copy link
Contributor Author

This seems to me like an issue that should be fixed upstream.

Yes, there already is an issue open, but there is no clear timeline, so it needs a workaround.

@disassembler
Copy link
Contributor

I don't see a reason to address this. The work-around is you modify the cabal.proejct file (as this patch does, and ideally when cabal is fixed, just add to cabal.project.local), but this patch would break our nix builds and cabal builds for anyone that wants systemd (which there are a number of pool operators I've been helping this weekend trying to get systemd services setup on non-nixos).

@hasufell
Copy link
Contributor Author

@disassembler as @erikd pointed out, this could be done by a shell script. I don't believe users will figure this out on their own. Is there any reason to not accept a patch for that?

iohk-bors bot added a commit that referenced this pull request Oct 2, 2020
1775: Fix build for cabal users that don't have systemd r=intricate a=hasufell

This is mainly due to a cabal bug and should be removed in
the future: haskell/cabal#5444

There are various distros, where installing development files
of libsystemd won't be an option:

- Alpine (doesn't have systemd at all)
- Gentoo (not installable when eudev is installed)
- Exherbo (not installable when eudev is installed)

Users are expected to run the script and then execute cabal like so:

  cabal build --project-file=cabal.nosystemd.project all

----

related:
- #1666
- #1200

This has also been discussed on slack.

Instructions for this edge case should probably be added to the wiki?

Co-authored-by: Julian Ospald <[email protected]>
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.

[BUG] - Build System: flag -systemd is not being respected by cabal-install
4 participants