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

snapcraft.yaml: update PATH so that snapcraftctl is found #111

Merged
merged 1 commit into from Jan 7, 2019

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Jan 7, 2019

With snapcraft 3.0 the snapcraftctl binary is no longer an alias
but a binary that is installed into

/snap/snapcraftctl/$rev/bin/scriptlet-bin

This PR ensures this is reflected in the override-{stage,prime}
scriptlets. This will unbreak the travis builds.

@mvo5 mvo5 force-pushed the unbreak-travis branch 2 times, most recently from 32e6533 to 33569d7 Compare January 7, 2019 10:31
With snapcraft 3.0 the snapcraftctl binary is no longer an alias
but a binary that is installed into

    /snap/snapcraftctl/$rev/bin/scriptlet-bin

This PR ensures this is reflected in the override-{stage,prime}
scriptlets. This will unbreak the travis builds.
@mvo5 mvo5 changed the title [TEST] snapcraft.yaml: find and save snapcraftctl before unsetting PATH snapcraft.yaml: update PATH so that snapcraftctl is still found Jan 7, 2019
@mvo5 mvo5 changed the title snapcraft.yaml: update PATH so that snapcraftctl is still found snapcraft.yaml: update PATH so that snapcraftctl is found Jan 7, 2019
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# ensure snapcraftctl is found, see
# https://github.com/snapcore/snapcraft/pull/2251
export PATH="$PATH:/snap/snapcraft/current/bin/scriptlet-bin"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The path belongs to a private binary from snapcraft, is this really what we want to do?

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 can expand the command a bit maybe - so what happens is that snapcraft 3.0 will run the scriptlets in a subshell with custom PATH and LD_LIBRARY_PATH. Unfortunately this breaks on non-18.04 systems because of incompatible binaries. Hence the workaround to rewrite PATH was added. However in snapcraft 3.0 snapcraftctl is put into a custom PATH (it used to be a shell alias). This is why this is needed, does that answer the question?

Copy link
Contributor

@sil2100 sil2100 left a comment

Choose a reason for hiding this comment

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

This change does indeed seem a bit strange, but it makes sense in our case.

@zyga this is a private path but what mvo proposes here is anyway what snapcraft does by default anyway (I guess from the PR attached in the comment). Just in this case we need to do it ourselves as we have to tinker with the PATH manually.

@sil2100 sil2100 merged commit db8dd9f into snapcore:master Jan 7, 2019
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.

None yet

3 participants