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

Building deb packages fails on Windows #47007

Closed
alpar-t opened this issue Sep 24, 2019 · 8 comments · Fixed by #48246
Closed

Building deb packages fails on Windows #47007

alpar-t opened this issue Sep 24, 2019 · 8 comments · Fixed by #48246
Assignees
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team

Comments

@alpar-t
Copy link
Contributor

alpar-t commented Sep 24, 2019

The stack trace of the failure is :

begin 0, end -1, length 71
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':distribution:packages:buildOssDeb'.Open stacktrace
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 71Close stacktrace
at com.netflix.gradle.plugins.utils.GradleUtils.relativizeSymlink(GradleUtils.groovy:35)
at com.netflix.gradle.plugins.deb.DebFileVisitorStrategy.addFile(DebFileVisitorStrategy.groovy:34)
at com.netflix.gradle.plugins.deb.DebCopyAction.visitFile(DebCopyAction.groovy:123)
at com.netflix.gradle.plugins.packaging.AbstractPackagingCopyAction$StreamAction.processFile(AbstractPackagingCopyAction.groovy:60)

https://gradle-enterprise.elastic.co/s/sidkgld4awq4m/failure?openFailures=WzBd&openStackTraces=WzFd#top=0

@alpar-t alpar-t added the :Delivery/Build Build or test infrastructure label Sep 24, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@alpar-t
Copy link
Contributor Author

alpar-t commented Sep 24, 2019

I tried updating to the latest release of the plugin but the problem is still there.

Looking at the plugin implementation this happens because the Gradle API FileCopyDetails.path tracks files with / but the File object in FileCopyDetails.file has \ and the plugin implements string operations comparing them to figure out the relative path of the symlink.
Gradle stores these paths as a list, without a separator, and '/' is hard-coded when converting back to a string.

@alpar-t
Copy link
Contributor Author

alpar-t commented Sep 24, 2019

The reason the packages are build on windows in the first place is that we run some sanity checks against it, but we skip this on Windows anyhow since the extraction tools are not available so we could work around the issue by making the task dependencies conditional too.

alpar-t added a commit to alpar-t/elasticsearch that referenced this issue Sep 24, 2019
Relates to  elastic#47007 . the `gradle-ospackage-plugin` plugin doesn't
properly support symlink on windows.

This PR changes the way we configure tasks to prevent building these
packages as part of a windows check.
alpar-t added a commit that referenced this issue Sep 27, 2019
Relates to  #47007 . the `gradle-ospackage-plugin` plugin doesn't
properly support symlink on windows.

This PR changes the way we configure tasks to prevent building these
packages as part of a windows check.
alpar-t added a commit that referenced this issue Sep 27, 2019
Relates to  #47007 . the `gradle-ospackage-plugin` plugin doesn't
properly support symlink on windows.

This PR changes the way we configure tasks to prevent building these
packages as part of a windows check.
alpar-t added a commit that referenced this issue Sep 27, 2019
Relates to  #47007 . the `gradle-ospackage-plugin` plugin doesn't
properly support symlink on windows.

This PR changes the way we configure tasks to prevent building these
packages as part of a windows check.
@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 9, 2019

@mark-vieira @rjernst to summaries, the upstream plugin has a bug when dealing with symlinks on Windows. Do you think it's worth pursuing a fix upstream for this ? I'm leaning to wards saying it's not, since there should never be a need to build deb packages on windows.

@mark-vieira
Copy link
Contributor

I'm leaning to wards saying it's not, since there should never be a need to build deb packages on windows.

I wouldn't go so far as saying you never want to build a deb on Windows. That might be the release machine. Just as we build both RPM and DEB on our worker regardless of whether it's RedHat or Debian based.

That said, Windows support for unix packaging tools is probably not high priority but there might be folks doing development on Windows that might want the ability to build on Windows. I'll defer to @rjernst's judgement here.

@rjernst
Copy link
Member

rjernst commented Oct 9, 2019

We always build our releases on the same system (ubuntu based IIRC), and the vast majority of developers use a nix compatible OS. I think dropping support for building rpm/deb on windows is fine, as long as the build gracefully skips it on that platform (like assumeFalse basically).

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 10, 2019

I'm going to close this issue then, since there's no further work planned.

@alpar-t alpar-t closed this as completed Oct 10, 2019
@mark-vieira
Copy link
Contributor

I'm not sure we've resolved this. We should disable this on windows or have it fail gracefully with a useful message.

@alpar-t alpar-t reopened this Oct 15, 2019
@alpar-t alpar-t self-assigned this Oct 15, 2019
alpar-t added a commit to alpar-t/elasticsearch that referenced this issue Oct 18, 2019
alpar-t added a commit that referenced this issue Oct 21, 2019
* Don't build packages on non Linux

Closes #47007

* Explicitly exclude windows only
alpar-t added a commit that referenced this issue Oct 21, 2019
* Don't build packages on non Linux

Closes #47007

* Explicitly exclude windows only
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants