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

rust plugin: use rust-toolchain by default if present #2613

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

sergiusens
Copy link
Collaborator

If the plugin options are not used and a rust-toolchain file
is found in the source, use that and only default to the
stable toolchain channel as a last resort.

Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh tests/unit?

If the plugin options are not used and a rust-toolchain file
is found in the source, use that and only default to the
stable toolchain channel as a last resort.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
If a rust-toolchain file is not present and neither rust-version
nor rust-channel are set, then stable will be returned.
"""
if self.options.source_subdir:
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT - could be simplified:

sourcedir = self.sourcedir
if self.options.source_subdir:
    sourcedir = os.path.join(sourcedir, self.options.source_subdir)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a a problem with all plugins, we should fix it across instead of just here

else:
sourcedir = self.sourcedir
rust_toolchain_path = os.path.join(sourcedir, "rust-toolchain")

if self.options.rust_revision:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it should error if both revision and channel are specified in the config? Otherwise it should probably spell out the precedence in the documentation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will do a follow-up for this, it is documented though

@sergiusens
Copy link
Collaborator Author

Failed unrelated test:

  • google:ubuntu-16.04-64:tests/spread/plugins/catkin/legacy-pull

@sergiusens sergiusens merged commit 374f042 into canonical:master Jun 26, 2019
@sergiusens sergiusens deleted the rust-toolchain branch June 27, 2019 13:11
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.

2 participants