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

Fix target ScanCode directories to copy binaries to #3

Merged
merged 1 commit into from Nov 14, 2018
Merged

Fix target ScanCode directories to copy binaries to #3

merged 1 commit into from Nov 14, 2018

Conversation

sschuberth
Copy link
Contributor

It does not exist when ScanCode was freshly cloned.

Signed-off-by: Sebastian Schuberth sschuberth@gmail.com

@sschuberth
Copy link
Contributor Author

@pombredanne, I'm wondering a bit why the copy step to ../../../scancode-toolkit/src/extractcode/bin/linux-64/lib is missing for the other architectures. Should maybe the copy step go away instead of calling mkdir?

@pombredanne
Copy link
Member

Ah! good catch.... this is a tad out of date and now these should be copied to their respective plugins in https://github.com/nexB/scancode-toolkit/tree/develop/plugins and no longer in the source code tree
Now this means also creating a proper new directory for each library os/arch combo.
What are the things that Alpine creates for these?

@pombredanne
Copy link
Member

I'm wondering a bit why the copy step to ../../../scancode-toolkit/src/extractcode/bin/linux-64/lib is missing for the other architectures.

So this is not missing but all moved to the new plugins instead. The build scripts are out of date :P

@sschuberth
Copy link
Contributor Author

What are the things that Alpine creates for these?

How can I find out? I mean, with my patch in this PR libarchive/build.sh succeeds on Alpine Linux 😁

@pombredanne
Copy link
Member

pombredanne commented Nov 7, 2018

So in your case it would something more or less like https://github.com/nexB/scancode-toolkit/tree/develop/plugins/extractcode-libarchive-manylinux1_x86_64 but where "extractcode-libarchive-manylinux1_x86_64" is likely something else that is Alpine specific, e.g. whatever Alpine Python creates as a tags in a wheel name when you would run on Alpine:
pip wheel bitarray
... what is the wheel file name that's created from this?

If you can tell here, we will know how to create a proper plugin copy where the prebuilt native code will live.

@pombredanne
Copy link
Member

How can I find out? I mean, with my patch in this PR libarchive/build.sh succeeds on Alpine Linux grin

FWIW, it may build, but this will not be functional at runtime :P

@sschuberth
Copy link
Contributor Author

pip wheel bitarray

Unfortunately the command fails 😢

$ pip wheel bitarray
Collecting bitarray
  Downloading https://files.pythonhosted.org/packages/e2/1e/b93636ae36d08d0ee3aec40b08731cc97217c69db9422c0afef6ee32ebd2/bitarray-0.8.3.tar.gz
Building wheels for collected packages: bitarray
  Running setup.py bdist_wheel for bitarray ... error
  Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-wheel-IcsuFI/bitarray/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-9DH76h:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for bitarray
  Running setup.py clean for bitarray
Failed to build bitarray
ERROR: Failed to build one or more wheels

@sschuberth
Copy link
Contributor Author

sschuberth commented Nov 7, 2018

Nevermind, installed wheel via pip first 😆

Edit: The file is called bitarray-0.8.3-cp27-cp27mu-linux_x86_64.whl.

@pombredanne
Copy link
Member

The file is called bitarray-0.8.3-cp27-cp27mu-linux_x86_64.whl.

Sigh... so there is no serious difference with a manylinux one... but at least this is a different name.

So you want to copy a plugin from https://github.com/nexB/scancode-toolkit/tree/develop/plugins
For instance copy the tree https://github.com/nexB/scancode-toolkit/tree/develop/plugins/extractcode-libarchive-manylinux1_x86_64 to plugins/extractcode-libarchive-linux_x86_64
and then in this newly created plugin, src/extractcode_libarchive/lib/ is where you would put your built libarchive.so

Then this plugin could be used as a wheel that would be used instead of the other wheels when ./configuring for Alpine

@sschuberth
Copy link
Contributor Author

Phew, not sure I'm following... mind if you would be simply doing the necessary changes to the build scripts and closing this PR? 😀

@pombredanne
Copy link
Member

@sschuberth the pre-built for alpine would have for now to be put in these plugins (replacing the exe, so and data (magic db) in these https://github.com/nexB/scancode-toolkit/tree/1262-alpine/plugins/alpine
that's the first step. Then this plugins will have to be built as wheels and then these wheel used instead of the default manylinux ones

The directory layout has changed when plugins were introduced.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@sschuberth
Copy link
Contributor Author

@pombredanne I've changed the PR to (hopefully) use the right plugin paths for "manylinux" distributions, i.e. make the scripts work again for the current state of ScanCode. Doing Alpine-specific changes would be a follow-up step.

@pombredanne
Copy link
Member

Thanks!

@pombredanne pombredanne merged commit a310fd6 into nexB:master Nov 14, 2018
@sschuberth sschuberth deleted the mkdir-lib branch November 14, 2018 15:54
@sschuberth sschuberth changed the title libarchive/build.sh: Ensure ScanCode's lib directory to copy to exists Fix target ScanCode directories to copy binaries to Nov 14, 2018
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

2 participants