Skip to content

Use package root as data-file base path, not cwd - #4641

Merged
fgaz merged 4 commits into
haskell:masterfrom
fgaz:new-run/datafiles-2
Aug 7, 2017
Merged

fgaz merged 4 commits into
haskell:masterfrom
fgaz:new-run/datafiles-2

Conversation

@fgaz

@fgaz fgaz commented Jul 28, 2017 •

Copy link
Copy Markdown
Member

Using the current directory worked with single packages, but cabal
projects can use packages in different places.

Fixes #4639

todo:

  • A meaningful error message It's a comment in a pure function that returns a Maybe now.
  • Modify the cmdrun/datafiles test to take this into account
  • Take into account local deps' datafiles

@fgaz fgaz added blocked: action-required cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds"). labels Jul 28, 2017
@mention-bot

Copy link
Copy Markdown

@fgaz, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dcoutts to be a potential reviewer.

@ezyang

ezyang commented Jul 29, 2017

Copy link
Copy Markdown
Contributor

I fixed an upstream CI problem, if you try a rebuild that should help.

@fgaz
fgaz force-pushed the new-run/datafiles-2 branch from 7c04d7a to e54e8ff Compare July 29, 2017 16:11
@fgaz

fgaz commented Jul 29, 2017 •

Copy link
Copy Markdown
Member Author

@ezyang

ezyang commented Jul 29, 2017

Copy link
Copy Markdown
Contributor

Looks like QuickCheck uncovered an unrelated bug ;) File an issue, will you?

@fgaz
fgaz force-pushed the new-run/datafiles-2 branch from e54e8ff to 6792ca1 Compare August 6, 2017 16:26
fgaz added 2 commits August 6, 2017 18:30
Using the current directory worked with single packages, but cabal
projects can use packages in different places.

Fixes haskell#4639
With cabal projects a package might depend on another inplace package in
the same project, so we need to add envoronment variables for each of
them when using new-run.
@fgaz fgaz changed the title [WIP] Use package root as data-file base path, not cwd Use package root as data-file base path, not cwd Aug 6, 2017
-- already included in the package at install/build time).
-- * The other cases are not handled yet. See below.
dataDirEnvVarForPackage :: ElaboratedConfiguredPackage
-> Maybe (String, Maybe FilePath)

@hvr hvr Aug 6, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docstring refers to the outer Maybe, but what about the inner Maybe FilePath in the 2nd element?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's the format that runProgramInvocation accepts. See progInvokeEnv in Cabal/Distribution/Simple/Program/Run.hs.

The inner Maybe is for valueless vars I think.

Oddly, we don't have an alias for it.

@fgaz
fgaz merged commit 93d8ddb into haskell:master Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds").

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants