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

Make NativeTARDistribution usable #87

Merged
merged 4 commits into from
Mar 17, 2016
Merged

Make NativeTARDistribution usable #87

merged 4 commits into from
Mar 17, 2016

Conversation

olpaw
Copy link
Member

@olpaw olpaw commented Mar 17, 2016

Fixes bugs/missing features that make NativeTARDistribution usable for binary deployment of non-java projects.

@dougxc
Copy link
Member

dougxc commented Mar 17, 2016

@gilles-duboscq , can you please have a look at this

output = join(self.suite.dir, self.output)
assert tarfilename
with tarfile.open(tarfilename, 'r:') as tar:
log('Extract {} to {}'.format(tarfilename, output))
Copy link
Member

Choose a reason for hiding this comment

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

maybe s/Extract/Extracting/?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@gilles-duboscq
Copy link
Member

So the output argument only has a meaning when the distribution comes from a BinarySuite?

This feels a bit strange, how does it work when the distribution comes from a SourceSuite?
It looks like extracting to output should be both a post-pull and post-build action.

@olpaw
Copy link
Member Author

olpaw commented Mar 17, 2016

@gilles-duboscq only if the distribution is native the output argument is considered. And native distributions can only contain native projects. Here is the usecase:

"XXX_HOSTED_NATIVE" : {
  "dependencies" : ["com.oracle.xxx.native"],
  "native" : True,
  "relpath" : True,
  "output" : "clibraries",
  "os_arch" : {
    "linux" : {
      "amd64" : {
          "path" : "build/xxx-hosted-native-linux.tar",
      },
    },
    "darwin" : {
      "amd64" : {
        "path" : "build/xxx-hosted-native-darwin.tar",
      }
    },
  }
}, 

Specifying "output" : "clibraries" in the above native distribution specification ensures that after the tar-ball got pulled it will extract its contents to output (relative to the imported binary suite dir).
Specifying "relpath" : True ensures that sub-directory structures are replicated into the tar-ball on creation (e.g. libfoo.so, include/foo.h ... here it is important that we have include/foo.h in the tarball instead of foo.h (what basename would give us)).

@olpaw
Copy link
Member Author

olpaw commented Mar 17, 2016

Would it help if I rename the output attr to extract?

@olpaw
Copy link
Member Author

olpaw commented Mar 17, 2016

This feels a bit strange, how does it work when the distribution comes from a SourceSuite?
It looks like extracting to output should be both a post-pull and post-build action.

If you are in SourceSuite mode output has no effect. It's only relevant for the BinarySuite case to reconstruct certain folders that the suite depends on being at specific places. I thought it would be convenient for other users as well (instead of having each user reinvent the wheel with a post-pull action). BTW, how would I hook into post-pull for a given suite anyway?

@olpaw olpaw assigned gilles-duboscq and unassigned dougxc Mar 17, 2016
olpaw added a commit that referenced this pull request Mar 17, 2016
Make NativeTARDistribution more usable
@olpaw olpaw merged commit 0152f1a into graalvm:master Mar 17, 2016
@gilles-duboscq
Copy link
Member

So the output attribute has to match exactly the output attribute of the project that was included in the tar. We could also so that automatically. However that's not completely straightforward because project data is not currently loaded for BinarySuites.
I created #88 to track that.

dougxc added a commit that referenced this pull request May 20, 2016
…module-jars to master

* commit '9d1fe9c2ac181d143fbb97118f379cd097a84a18':
  added sources if possible to a module jar extracted from a JDK
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.

3 participants