Skip to content

Travis: fail fast on install failures#7239

Closed
pdillinger wants to merge 2 commits intofacebook:masterfrom
pdillinger:travis_install_fail_fast
Closed

Travis: fail fast on install failures#7239
pdillinger wants to merge 2 commits intofacebook:masterfrom
pdillinger:travis_install_fail_fast

Conversation

@pdillinger
Copy link
Copy Markdown
Contributor

@pdillinger pdillinger commented Aug 11, 2020

Summary: A recent build continued with confusing results after failing
to "snap install cmake" so ensure failures in installs are fatal. Also
upgrade snapd before "snap install" to hopefully avoid this error:

error: cannot perform the following tasks:
- Mount snap "cmake" (513) (snap "cmake" assumes unsupported features: command-chain (try to update snapd and refresh the core snap))

Test Plan: watch Travis

@pdillinger pdillinger requested a review from adamretter August 11, 2020 16:19
@pdillinger
Copy link
Copy Markdown
Contributor Author

Summary: A recent build continued with confusing results after failing
to snap install cmake

Test Plan: watch Travis
@pdillinger pdillinger force-pushed the travis_install_fail_fast branch from fdd9eef to cf1be39 Compare August 11, 2020 16:56
@adamretter
Copy link
Copy Markdown
Collaborator

adamretter commented Aug 11, 2020

@pdillinger I am not sure this will help. If sudo snap install cmake --beta --classic exited with a non-zero code I think the build would have stopped, if it exited with a zero code, then I don't think adding exit $? will help you, as you will just get the same code... or did I miss something subtle?

@pdillinger
Copy link
Copy Markdown
Contributor Author

Updated Travis link (I'm getting a bad one from GitHub): https://travis-ci.org/github/facebook/rocksdb/builds/716990002

It looks like two builds are failing the snap install.

The subtle thing is this:

$ bash -c 'cat doesnotexist; echo next_step'; echo $?
cat: doesnotexist: No such file or directory
next_step
0
$ bash -c 'cat doesnotexist || exit $?; echo next_step'; echo $?
cat: doesnotexist: No such file or directory
1
$

Unless using set -e or an operator like && or ||, the return code of a command will be ignored if followed by another command.

@adamretter
Copy link
Copy Markdown
Collaborator

Unless using set -e

Of course! Apologies, I am so used to always running scripts that include set -e

@pdillinger
Copy link
Copy Markdown
Contributor Author

@adamretter Can you look at fixing the two builds that are completely failing the snap install? Feel free to create your own PR that includes this change.

@adamretter
Copy link
Copy Markdown
Collaborator

@pdillinger Yes, but I probably won't get to it until the weekend

@pdillinger
Copy link
Copy Markdown
Contributor Author

@craigscott-crascit Is there a missing "snap refresh core" step we weren't told about or something? Our linux builds here are failing with

error: cannot perform the following tasks:
- Mount snap "cmake" (513) (snap "cmake" assumes unsupported features: command-chain (try to update snapd and refresh the core snap))

as in https://travis-ci.org/github/facebook/rocksdb/jobs/716990011

@craigscott-crascit
Copy link
Copy Markdown

@craigscott-crascit Is there a missing "snap refresh core" step we weren't told about or something? Our linux builds here are failing with

error: cannot perform the following tasks:
- Mount snap "cmake" (513) (snap "cmake" assumes unsupported features: command-chain (try to update snapd and refresh the core snap))

as in https://travis-ci.org/github/facebook/rocksdb/jobs/716990011

That's the first I've heard of this problem. After a quick bit of searching, it does seem likely that the core snap is not recent enough and needs to be refreshed. This issue seems to describe the problem reasonably well. Based on that, I would expect a sudo snap refresh core might fix it, but you'd have to try that and see.

@pdillinger
Copy link
Copy Markdown
Contributor Author

This issue seems to describe the problem reasonably well. Based on that, I would expect a sudo snap refresh core might fix it, but you'd have to try that and see.

I think we have a winner with sudo apt-get install snapd to update snapd before running snap. Perhaps this subsumes snap refresh core. (?) Thanks.

@adamretter
Copy link
Copy Markdown
Collaborator

@pdillinger Another option might be to place snaps under addons. I think (but am not certain) that there might then be an update option. The travis syntax for snaps does not have much documentation, but perhaps the following might work:

addons:
  snaps:
    update: true
    packages:
      - cmake
         confinement:
           - classic
           - beta

@pdillinger
Copy link
Copy Markdown
Contributor Author

Anything we add to Travis configuration now is better if it's more easily migrated to other CI systems.

@adamretter
Copy link
Copy Markdown
Collaborator

@pdillinger Okay understood. So the preference is to script things, rather than use the YAML config options?

@pdillinger
Copy link
Copy Markdown
Contributor Author

@pdillinger Okay understood. So the preference is to script things, rather than use the YAML config options?

At least not spend extra time trying to use Travis-specific configs. (Approval?)

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@pdillinger has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@pdillinger merged this pull request in 327ddb7.

codingrhythm pushed a commit to SafetyCulture/rocksdb that referenced this pull request Mar 5, 2021
Summary:
A recent build continued with confusing results after failing
to "snap install cmake" so ensure failures in installs are fatal. Also
upgrade snapd before "snap install" to hopefully avoid this error:

    error: cannot perform the following tasks:
    - Mount snap "cmake" (513) (snap "cmake" assumes unsupported features: command-chain (try to update snapd and refresh the core snap))

Pull Request resolved: facebook#7239

Test Plan: watch Travis

Reviewed By: akankshamahajan15

Differential Revision: D23244110

Pulled By: pdillinger

fbshipit-source-id: 33dbf145f6999d0b90576cdfde484f15c5d1ac19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants