Comments (10)
Yes, apologies. Here's what's happening:
- Your code is adding a LICENSE file
- Your code attempts to remove an existing license with
project.tryRemoveFile("LICENSE");
, but it's executed first, so this has no effect. - PDK is then attempting to add a LICENSE file as part of
preSynthesize
. This is kind of bad, because if it is doing it there it should check if a license already exists. It kind of does that, but only on a component level, not a file level. PDK checks forinstanceof projen.License
but you have just added a textfile. - 💥
To fix this, you need to tell PDK to not add licenses:
const monorepo = new MonorepoTsProject({
// other options
licenseOptions: {
disableDefaultLicenses: true,
},
});
This is not really a bug in projen, but the error could be much better.
You should consider re-opening this issue in the PDK repo: https://github.com/aws/aws-pdk (cc @agdimech)
from projen.
Thanks for reporting. We'll need your project type and config.
from projen.
You can probably fix this by removing your LICENSE file manually.
from projen.
You can probably fix this by removing your LICENSE file manually.
Hi, that was my first attempt... no luck. I have tried quite a few more tricks to narrow down the scope of the problem... no luck.
Re: project type (easy enough) and config, do you want the whole projenrc.ts?
from projen.
As much as you can share. I'll just need to reproduce the issue somehow.
from projen.
As much as you can share. I'll just need to reproduce the issue somehow.
This is a recently adopted project on my half, so not entirely sure for the reasoning behind this approach we are using, but I have narrowed it down to some custom license generation code:
export const licenseFile = (project: Project) => {
project.tryRemoveFile("LICENSE");
new TextFile(project, "LICENSE", { lines: getLongLicense() }); // line 3
};
Since we are running a monorepo with multiple projects, the license files were wanted to be added in many places. (ie licenseFile
is called in multiple spots like licenseFile(api)
, licenseFile(website)
etc. Disabling line 3 above fixes the projen synth, but then apache licenses show up everywhere in the repository :)
Created a repo which demonstrates the above. Thanks in advance!
from projen.
Thanks for the reproduction! I'll have a look.
so not entirely sure for the reasoning behind this approach we are using
My best guess is that you are using a custom/customized license (as in a license text that is not supported by projen).
from projen.
My best guess is that you are using a custom/customized license (as in a license text that is not supported by projen).
It is simply plain text, I am unsure how it could be unsupported. Anyhow thanks for looking, keen to hear your feedback. :)
from projen.
Thanks for the reproduction! I'll have a look.
Hi, were you able to reproduce this issue? Thanks in advance.
from projen.
Unfortunately we are stuck in an upgrade loop, and we need the latest version of pdk to fix this (licenseOptions does not exist...)
Referencing that upgrade issue here: aws/aws-pdk#784
from projen.
Related Issues (20)
- Publishing v0.80.16 to PyPI failed HOT 1
- Publishing v0.80.17 to Maven Central failed HOT 1
- Should `args` be returned by the task --inspect CLI command? HOT 1
- Error when using `NodePackageManager.BUN` with `NodejsFunction` HOT 5
- Update actions due to node v16 deprecation notice: codecov/codecov-action HOT 1
- gitlab build workflow HOT 1
- integ tests on private cdk lib fail since two days - ideas how to debug welcome HOT 6
- NpmConfig uses package 'ini' which adds CRLF on Windows HOT 1
- packaging fails when cdk.out dir is significant in size HOT 8
- Export util modules HOT 9
- Unable to ignore lines for coverage in projen project HOT 1
- `npx projen new jsii --package-manager npm` fails due to peer dependency issue HOT 2
- Publish to CodeArtifact fails for Nuget packages HOT 2
- github issue template
- Publishing v0.81.11 to PyPI failed HOT 1
- Generated source code for LambdaFunction where `edgeLambda: true` is incorrect HOT 3
- Release tags wrong commit HOT 1
- !reference tag in gitlab job scripts will be rendered in quotes
- typeRoots is missing in TypescriptConfigOptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projen.