Skip to content

copy source into prefix#4102

Merged
tgamblin merged 2 commits intodevelopfrom
features/copy_source
Aug 23, 2017
Merged

copy source into prefix#4102
tgamblin merged 2 commits intodevelopfrom
features/copy_source

Conversation

@junghans
Copy link
Copy Markdown
Contributor

@junghans junghans commented May 2, 2017

Fix #4083.

@junghans junghans added the WIP label May 2, 2017
are no exceptions during build. Set to True to keep the stage
even with exceptions.
install_source (bool): By default, source is not installed, but
for debugging it might useful to keep it around.
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.

Might be useful

if install_source:
src_target = join_path(self.spec.prefix, 'src')
tty.msg('Copying source to {0}'.format(src_target))
install_tree(self.stage.source_path, src_target)
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.

You'll probably want to check if the src directory actually exists first.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@junghans junghans force-pushed the features/copy_source branch from 37ce47b to d59139d Compare May 3, 2017 00:07
Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

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

Generally looks good. Some requests:

  1. Can we call the option --source? install --install-source seems redundant to me.

  2. Can you make the necessary modifications for this to be runnable after an existing install? e.g., say I install foo and it gets me foo /abc123. I should then be able to say:

    spack install --source /abc123
    

    and have it re-fetch, stage, patch, and add to the existing installation.

  3. Can the source go in the $prefix/.spack/src directory so that it doesn't interfere with a package install? Putting it in $prefix/src isn't really hier compliant.

  4. If you must have it in a non-dot location, it should probably go in $prefix/share/<pkgname>/src, otherwise you're going to run into issues with symlinking in spack view, and once we add environments.

I'd really rather have the source go into .spack so that it's not included by default in the prefix --
I'd really rather have Spack prefixes be considered read-only and final once installed. The prefix is what's going to get turned into an installable binary, too -- so it makes sense to keep it as an immutable artifact. Basically if I give you a prefix hash, you should know exactly what to expect.

Does that seem reasonable?

@junghans
Copy link
Copy Markdown
Contributor Author

junghans commented May 3, 2017

  1. Can you make the necessary modifications for this to be runnable after an existing install?

How would I do that?

Copy link
Copy Markdown
Member

@citibeth citibeth left a comment

Choose a reason for hiding this comment

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

Can you please be specific about elucidating the original problem and use case driving this PR? I'm a little concerned that we've gotten to the stage of code review without knowing what the original problem is we're trying to solve.

@junghans
Copy link
Copy Markdown
Contributor Author

junghans commented May 3, 2017

@citibeth: see #4083 (comment)

@junghans
Copy link
Copy Markdown
Contributor Author

junghans commented May 3, 2017

@tgamblin: I have done 1.) and 4.), I like having src inside the prefix as source could be patched different for different variants, so it is bit more clear.

However for 2.) I will need some pointer in the code. ( @adamjstewart / @tgamblin )

Copy link
Copy Markdown
Member

@citibeth citibeth left a comment

Choose a reason for hiding this comment

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

I'm "approving" because my request for a use case has been satisfied. I have unfortunately not reviewed the code.

pkg.fetcher = fetcher


@pytest.mark.usefixtures('install_mockery')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@adamjstewart : Is this test run?

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.

It should run. All functions that start with test_ should be run. I'm not sure how often Codecov updates, if that's what you're asking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm and the source_install=True below should trigger the new code path or does the mock_archive doesn't have source?

@junghans junghans force-pushed the features/copy_source branch from 85ab25f to 930385e Compare June 29, 2017 18:17
@junghans
Copy link
Copy Markdown
Contributor Author

Rebased: ping @tgamblin

@junghans junghans force-pushed the features/copy_source branch from 930385e to a0bb530 Compare August 3, 2017 17:16
@junghans
Copy link
Copy Markdown
Contributor Author

junghans commented Aug 3, 2017

Ping @tgamblin

@junghans junghans force-pushed the features/copy_source branch from a0bb530 to 4250ee2 Compare August 22, 2017 21:36
@junghans junghans removed the WIP label Aug 22, 2017
@junghans
Copy link
Copy Markdown
Contributor Author

Ping @tgamblin

@tgamblin tgamblin force-pushed the features/copy_source branch from 4250ee2 to 18645b5 Compare August 23, 2017 01:13
@tgamblin
Copy link
Copy Markdown
Member

fixed flake8 errors.

@tgamblin tgamblin force-pushed the features/copy_source branch from aa6ce30 to b97d092 Compare August 23, 2017 07:59
@tgamblin
Copy link
Copy Markdown
Member

Added a test. @junghans: it's easier to do now than it was when you added this :)

@tgamblin tgamblin merged commit fa1d0a8 into develop Aug 23, 2017
@adamjstewart adamjstewart deleted the features/copy_source branch August 24, 2017 00:09
@citibeth citibeth mentioned this pull request May 16, 2018
scheibelp pushed a commit that referenced this pull request Jun 8, 2018
The tcl package references the original sources upon install, and the tk build
requires the tcl sources. This updates the tcl package to install its sources following
the example of #4102, and also updates the tclConfig.sh file to properly reference
the installed sources (rather than the staging directory created by Spack).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants