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

Introduce workspaces #201

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Introduce workspaces #201

merged 4 commits into from
Aug 28, 2024

Conversation

LoZack19
Copy link
Contributor

@LoZack19 LoZack19 commented Aug 28, 2024

This PR aims to introduce workspaces in scraper, so that it is possible to provide scraper_proc_macros in a separate crate as an optional feature, as suggested in issue #188. Before introducing this change you need to make sure that it does not create problems. It would probably be appropriate to symlink the license and readme within the scraper crate, as other crates do, but since I work on windows I wasn't sure weather it would be a great idea, since links work differently between windows and linux, and probably many people use the latter.

This changes the directory structure from:

.
├── Cargo.toml
├── Cargo.lock
├── src/
├── examples/
├── README.md
├── scraper.1
└── LICENSE

To:

.
├── Cargo.toml
├── Cargo.lock
├── scraper/
│   ├── src/
│   ├── examples/
│   ├── Cargo.toml
│   └── Cargo.lock
├── README.md
├── scraper.1
└── LICENSE

@LoZack19 LoZack19 added the C-enhancement Category: enhancement label Aug 28, 2024
@LoZack19
Copy link
Contributor Author

LoZack19 commented Aug 28, 2024

This breaks the crate at the moment. Running cargo publish --dry-run -p scraper I get the following error:

error: couldn't read `src\../../scraper.1`: Impossibile trovare il file specificato. (os error 2)
  --> src/main.rs:90:27
   |
90 |         fs::write(&path, &include_bytes!("../../scraper.1")[..]).unwrap();
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
help: there is a file with the same name in a different directory
   |
90 |         fs::write(&path, &include_bytes!("../../../../scraper.1")[..]).unwrap();
   |                                          ~~~~~~~~~~~~~~~~~~~~~~~

error: could not compile `scraper` (bin "scraper") due to 1 previous error
error: failed to verify package tarball

@cfvescovo
Copy link
Member

Fixed

@LoZack19
Copy link
Contributor Author

LoZack19 commented Aug 28, 2024

Perfect, it works. I would merge this.

@cfvescovo cfvescovo merged commit f31452c into master Aug 28, 2024
5 checks passed
@LoZack19 LoZack19 deleted the workspaces branch August 28, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants