-
Notifications
You must be signed in to change notification settings - Fork 697
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
Haskell source pre-processing in Haskell no longer works #1541
Comments
Can't you just release |
That's really ugly, for a few reasons.
This being Haskell, I agree that it would be nice to move away from the imperative feel of requiring the artifacts to built in the order they physically appear in the cabal file. Perhaps we should add some cabal file syntax for expressing a dependency of one artifact on another defined in the same cabal file. In one direction we already have something primitive: an executable can list its own package name as a build dependency, causing the library to be built before this executable. But in the meantime, cabal has broken behavior that was previously working. |
I may have found a bug which is related to why cabal seems to be ignoring the build order. in: Cabal/Distribution/Simple/LocalBuildInfo.hs, lines 342 - 357:
Based on the comments of the withAllComponentsInBuildOrder function, it is looking for a field compBuildOrder of the LocalBuildInfo type, which seems to be defined on lines 116-160. However, I don't see a compBuildOrder field in that definition.
Sorry if I missed something; I'm still relatively new to Haskell. |
@ygale we already have a system for this, which is the build-tool field. You can use that to list that your lib or exe depends on the build tool defined within the same package. Now having said that, while I wrote that code I've never actually tested it (or if I did, I don't remember!) So could you give that a go and tell us if it works, and we can close this ticket, or re-purpose it. And about having broken existing things, we never promised the components would be built in order, and using |
@dcoutts Yes, this seems to work: https://gist.github.com/23Skidoo/7930870 Leaving the issue open for now because I want to add a test case for this. |
This is a little known feature of Cabal, not mentioned in the manual, and rarely known by many who have this problem in the wild. Additionally, it would be quite nice if we could support the preprocessor use-case without needing people to add a custom Setup.hs. Perhaps we can support |
When converting the component graph to operate in terms of UnitIds instead of CNames I accidentally introduced a regression where we stopped respecting build-tools when determining an ordering to build things. This commit fixes the regression (though perhaps not in the most clean/performant way you could manage it.) It also fixes a latent bug if internal libraries aren't processed in the correct order. Signed-off-by: Edward Z. Yang <[email protected]>
When converting the component graph to operate in terms of UnitIds instead of CNames I accidentally introduced a regression where we stopped respecting build-tools when determining an ordering to build things. This commit fixes the regression (though perhaps not in the most clean/performant way you could manage it.) It also fixes a latent bug if internal libraries aren't processed in the correct order. Signed-off-by: Edward Z. Yang <[email protected]>
When converting the component graph to operate in terms of UnitIds instead of CNames I accidentally introduced a regression where we stopped respecting build-tools when determining an ordering to build things. This commit fixes the regression (though perhaps not in the most clean/performant way you could manage it.) It also fixes a latent bug if internal libraries aren't processed in the correct order. Signed-off-by: Edward Z. Yang <[email protected]>
When converting the component graph to operate in terms of UnitIds instead of CNames I accidentally introduced a regression where we stopped respecting build-tools when determining an ordering to build things. This commit fixes the regression (though perhaps not in the most clean/performant way you could manage it.) It also fixes a latent bug if internal libraries aren't processed in the correct order. Signed-off-by: Edward Z. Yang <[email protected]>
When converting the component graph to operate in terms of UnitIds instead of CNames I accidentally introduced a regression where we stopped respecting build-tools when determining an ordering to build things. This commit fixes the regression (though perhaps not in the most clean/performant way you could manage it.) It also fixes a latent bug if internal libraries aren't processed in the correct order. Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
The standard technique for pre-processing Haskell source code using Haskell has stopped working in recent versions of Cabal. The technique is as follows:
The cabal file is structured like this:
Then you pass "
-F -pgmF dist/build/foo/foo-meta
" to GHC for the source file you want to pre-process, e.g., using anOPTIONS_GHC
pragma.The effect is that first cabal builds
foo-meta
, then uses it to build the library, then builds the final executable.But now, Cabal refuses to build the artifacts in the order I specified in the Cabal file. It always tries to build the library first, before the
foo-meta
executable, and the build fails.Note: We have only tried this so far inside a sandbox. However, we have verified that the problem is definitely that cabal is not even trying to build
foo-meta
, not a problem with differences in the path to thefoo-meta
executable in a sandbox.The text was updated successfully, but these errors were encountered: