Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

haskell-cabal-sandboxing #1698

Merged
merged 36 commits into from
Jan 20, 2018

Conversation

e1528532
Copy link
Contributor

@e1528532 e1528532 commented Nov 6, 2017

Purpose

Before this PR the haskell build process registered each build of the bindings to the global package db so that plugins can compile against the current version in all cases, overriding whatever is there. This is bad since it modifies the global system environment even when you only want to build elektra without installing it. The downside of this is that it obviously breaks the globally registered haskell bindings, like it happens when you do an actual installation and not only a compilation.

This PR makes use of cabal sandboxes. The advantage is that it registers each build of the haskell bindings only to their sandbox inside our build directory, and uses this sandbox for the compilation of the haskell plugins. Therefore it is not necessary to pollute the global haskell package database when one only builds the plugin without wanting to install it.

To give another example why its useful, i use the bindings for my type system experiments too, and each time i recompiled elektra for whatsoever purpose the re-registering of the newly built bindings broke my typesystem programs somehow...

Checklist

  • I ran all tests and everything went fine

@markus2330 Its only an internal change so its not necessary to document anything. lets see if the build still passes.
@sanssecours this is relevant for caching. Since the intentation of a sandbox is to provide an environment independent of the global one, it installs hspec and QuickCheck into the sandbox. So the sandbox directory should be cached too, at least the one at src/bindings/haskell/.cabal-sandbox

@markus2330
Copy link
Contributor

Thank you for creating this PR!

Seems like the build server went amok (many "Build triggered. sha1 is merged." messages).

@sanssecours Any idea what went wrong with the build server?

@e1528532 e1528532 changed the title haskell-cabal-sandboxing: haskell-cabal-sandboxing Nov 6, 2017
@e1528532 e1528532 closed this Nov 6, 2017
@sanssecours sanssecours mentioned this pull request Nov 8, 2017
31 tasks
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@e1528532 e1528532 deleted the haskell-cabal-sandboxing branch November 9, 2017 13:49
@e1528532 e1528532 restored the haskell-cabal-sandboxing branch November 9, 2017 13:49
@e1528532 e1528532 reopened this Nov 9, 2017
@e1528532
Copy link
Contributor Author

e1528532 commented Nov 9, 2017

Well i don't feel like deleting all the comments, lets see if it behaves better now, then we can merge it i think.

@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@ElektraInitiative ElektraInitiative deleted a comment from markus2330 Nov 9, 2017
@e1528532 e1528532 force-pushed the haskell-cabal-sandboxing branch from ac06dfe to 0ff004f Compare January 15, 2018 12:54
@e1528532
Copy link
Contributor Author

e1528532 commented Jan 15, 2018

@markus2330 Any idea about the glib issue? https://travis-ci.org/ElektraInitiative/libelektra/jobs/329037050 I'm not sure how it'd be related to my changes (if it even is).

@markus2330
Copy link
Contributor

It is quite certain that all errors that the build server reports stem from the respective PRs because we do not merge PRs that break builds anymore.

What could be the reason is that glib bindings were wrongly (?) removed before and this PR now includes them.

@e1528532
Copy link
Contributor Author

e1528532 commented Jan 16, 2018

What could be the reason is that glib bindings were wrongly (?) removed before and this PR now includes them.

Thanks! You are totally right, i've overlooked that and mistakenly changed the bindings to all by default, reverted the respective travis settings change. We shouldn't deal with glib in this PR its unrelated.

@e1528532
Copy link
Contributor Author

e1528532 commented Jan 20, 2018

looks good finally, anything left to do @markus2330 ? i'd love to have this merged so i can proceed with my next PRs which are based on this.

@markus2330 markus2330 merged commit 7277b47 into ElektraInitiative:master Jan 20, 2018
@markus2330
Copy link
Contributor

Great job! Thank you for your endurance.

@e1528532 e1528532 mentioned this pull request Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants