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

Path to build artifacts changes depending on the build-type #4771

Open
23Skidoo opened this issue Sep 18, 2017 · 6 comments
Open

Path to build artifacts changes depending on the build-type #4771

23Skidoo opened this issue Sep 18, 2017 · 6 comments

Comments

@23Skidoo
Copy link
Member

For example, if I have a package foo with an executable exe, with build-type: Simple the executable will be under

dist-newstyle/build/x86_64-linux/ghc-8.2.1/foo-1.0/c/exe/build/exe/exe

But if I change the build type to Custom, it will be under

dist-newstyle/build/x86_64-linux/ghc-8.2.1/foo-1.0/build/exe/exe

This is with Cabal 2.0.

/cc @ezyang

@ezyang
Copy link
Contributor

ezyang commented Sep 18, 2017

Unfortunately, this is expected behavior. In particular, it has less to do with Custom, and more to do with whether or not we support per-component builds; per-component builds have a different directory layout.

Is there a broader context where this is a problem?

@23Skidoo
Copy link
Member Author

It's just a bit confusing and annoying. For example, if a user switches a build-type: Simple project to build-type: Custom, it may take them a while to realise that the directory layout is now different. Plus if those paths are hardcoded somewhere (e.g. in CI conf, scripts or an external build system) they now have to be changed.

@ezyang
Copy link
Contributor

ezyang commented Oct 9, 2017

So, there are some workarounds available to us. For example, after running an old-style setup script, we could copy / otherwise move binaries so that they show up in the locations people "expect". This might be a bit too magical, but it would "solve" the problem, to a certain extent.

@ivan-m
Copy link
Collaborator

ivan-m commented Oct 9, 2017

Is there support to programmatically discover where these paths are? If that's promoted, then scripts can refer to those locations rather than trying to discover them themselves.

@gbaz
Copy link
Collaborator

gbaz commented Oct 9, 2017

Agreed -- a flag to builds that output paths to executable artifacts as a result would be welcome in general.

@hvr
Copy link
Member

hvr commented Oct 9, 2017

@ivan-m for new-build, you can use http://hackage.haskell.org/package/cabal-plan to programmatically query the paths for build targets.

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

No branches or pull requests

5 participants