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

Profiling settings don't seem to be passed on from build config #887

Open
michaelpj opened this issue Oct 19, 2020 · 12 comments
Open

Profiling settings don't seem to be passed on from build config #887

michaelpj opened this issue Oct 19, 2020 · 12 comments
Assignees
Labels
bug Something isn't working preserved Keep stale bot away

Comments

@michaelpj
Copy link
Collaborator

Setting

profiling: true

in cabal.project doesn't seem to get propagated to the Nix setup, it still builds non-profiled libraries.

Similarly, setting

build:
  library-profiling: true
  executable-profiling: true

in stack.yaml has no effect.

(Yes, I made sure my haskell.nix build was using each of those files as the source of truth when I tried it!)

@michaelpj
Copy link
Collaborator Author

Quoth Hamish:

I suspect profiling: true does not make it into the plan.json or plan-to-nix does not process it. There is a similar issue with ghc-options haskell/cabal#6343

@tscholak
Copy link

Is there a workaround?

@tscholak
Copy link

for those who follow me here:

modules = [
{
# Package has no exposed modules which causes
# haddock: No input file(s)
packages.cabal-simple.doHaddock = false;
packages.cabal-simple.enableExecutableProfiling = true;
enableLibraryProfiling = true;
# executableProfiling = false;
}
];
does the trick

@stale
Copy link

stale bot commented Sep 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 28, 2022
@stale stale bot closed this as completed Nov 27, 2022
@michaelpj michaelpj reopened this Nov 28, 2022
@michaelpj michaelpj added bug Something isn't working and removed wontfix labels Nov 28, 2022
@stale
Copy link

stale bot commented Mar 28, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 28, 2023
@michaelpj
Copy link
Collaborator Author

Still annoying

@stale stale bot removed the wontfix label Mar 29, 2023
@michaelpj
Copy link
Collaborator Author

@andreabedini now we're processing the plan ourselves is this something we could fix?

@andreabedini
Copy link
Member

I had a first look at this. AFAIU we don't try to pass the content of cabal.project to the builder, we mostly rely on the information that cabal writes in plan.json (or at least we did until #1775). Setting flags in cabal.project works because cabal puts them in plan.json.

Whether we want profiling or not does not get written in plan.json so it never reaches our builder.

This is the current state.

Now, whether or not to turn profiling on is part of ElaboratedInstallPlan, which we started using since #1775 so one could extract this information from there.

I'd be keen but I think there's quite a bit of refactoring we need to do before we get there.

MakeInstallPlan was added separately from Plan2Nix because I didn't quite get around to figure how the schema of the nix plan, so rather than risk breaking it I made MakeInstallPlan write out plan.json as usual so that Plan2Nix could keep doing its job.

I'd like to first merge these two steps, then we are fully in control of how we make the plan end to end. Then adding stuff like this is trivial.

ping @angerman @hamishmack

@michaelpj
Copy link
Collaborator Author

Right, that makes sense. I thought it might now be trivial but alas not. I guess we could consider writing out another file that contains the missing info from plan.json like ghcOptions and profiling info.

@andreabedini
Copy link
Member

Right, that makes sense. I thought it might now be trivial but alas not. I guess we could consider writing out another file that contains the missing info from plan.json like ghcOptions and profiling info.

... or solve the technical debt and make all these problems go away :)

@stale
Copy link

stale bot commented Aug 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 3, 2023
@michaelpj
Copy link
Collaborator Author

Still very relevant

@stale stale bot removed the wontfix label Aug 3, 2023
@andreabedini andreabedini added the preserved Keep stale bot away label Aug 4, 2023
@andreabedini andreabedini self-assigned this Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

3 participants